Skip to contentSkip to conversation

scheduling while atomic on radeon rv620, kernel 3.30-rc3

DISCUSSION Mikko Vinni 2 participants 5 messages Feb 9, 2012 – Feb 13, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

testing 3.3.0-rc3 on an HP Pavilion dv5 (last tested kernel 3.2.5 works fine) and getting bugs apparently right after the radeon module is loaded.

Linux version 3.3.0-rc3-CUST (mikko@koni) (gcc version 4.6.2 20120120 (prerelease) (GCC) ) #198 SMP PREEMPT Thu Feb 9 09:36:43 EET 2012 Command line: BOOT_IMAGE=Arch_GitKernel ro root=803 ro root=/dev/sda3 init=/bin/systemd pcie_aspm=force
...
firewire_core: created device fw0: GUID 00241b00322a5501, S400
[drm] radeon defaulting to kernel modesetting.
[drm] radeon kernel modesetting enabled.
radeon 0000:01:00.0: power state changed by ACPI to D0
radeon 0000:01:00.0: power state changed by ACPI to D0
[drm] initializing kernel modesetting (RV620 0x1002:0x95C4 0x103C:0x3600).
[drm] register mmio base: 0xD2300000
[drm] register mmio size: 65536
ATOM BIOS: M82
radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used)
radeon 0000:01:00.0: GTT: 512M 0x0000000020000000 - 0x000000003FFFFFFF
[drm] Detected VRAM RAM=512M, BAR=256M
[drm] RAM width 64bits DDR
[TTM] Zone  kernel: Available graphics memory: 2023082 kiB.
[TTM] Initializing pool allocator.
[TTM] Initializing DMA pool allocator.
[drm] radeon: 512M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[drm] Driver supports precise vblank timestamp query.
radeon 0000:01:00.0: irq 46 for MSI/MSI-X
radeon 0000:01:00.0: radeon: using MSI.
[drm] radeon: irq initialized.
[drm] GART: num cpu pages 131072, num gpu pages 131072
[drm] radeon: ib pool ready.
[drm] Loading RV620 Microcode
usbcore: registered new interface driver usbfs
...
[drm] PCIE GART of 512M enabled (table at 0x0000000000040000).
radeon 0000:01:00.0: WB enabled
[drm] fence driver on ring 0 use gpu addr 0x20000c00 and cpu addr 0xffff8801364bfc00
[drm] ring test on 0 succeeded in 1 usecs
[drm] ib test on ring 0 succeeded in 0 usecs
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   LVDS
[drm]   Encoders:
[drm]     LCD1: INTERNAL_KLDSCP_LVTMA
[drm] Connector 1:
[drm]   VGA
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
[drm]   Encoders:
[drm]     CRT1: INTERNAL_KLDSCP_DAC1
[drm] Connector 2:
[drm]   DIN
[drm]   Encoders:
[drm]     TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 3:
[drm]   HDMI-A
[drm]   HPD1
[drm]   DDC: 0x7e20 0x7e20 0x7e24 0x7e24 0x7e28 0x7e28 0x7e2c 0x7e2c
[drm]   Encoders:
[drm]     DFP1: INTERNAL_UNIPHY
[drm] radeon: power management initialized

...
[drm] fb mappable at 0xC0142000
[drm] vram apper at 0xC0000000
[drm] size 4096000
[drm] fb depth is 24
[drm]    pitch is 5120
fbcon: radeondrmfb (fb0) is primary device
Feb  9 16:54:56 koni systemd-fsck[287]: /dev/sda5: clean, 1102549/17514496 files, 32142735/70035359 blocks (check in 2 mounts) Feb  9 16:54:56 koni systemd-tmpfiles[298]: Two or more conflicting lines for /tmp configured, ignoring.
Console: switching to colour frame buffer device 160x50
fb0: radeondrmfb frame buffer device
drm: registered panic notifier
[drm] Initialized radeon 2.13.0 20080528 for 0000:01:00.0 on minor 0
snd_hda_intel 0000:01:00.1: irq 47 for MSI/MSI-X
HDMI status: Codec=0 Pin=3 Presence_Detect=0 ELD_Valid=0
input: HDA ATI HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:02.0/0000:01:00.1/sound/card1/input15 EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: commit=30

BUG: scheduling while atomic: kworker/1:3/119/0x00000003
Modules linked in: snd_hda_codec_hdmi uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev v4l2_compat_ioctl32 arc4 snd_hda_codec_idt ohci_hcd joydev snd_hda_intel ath5k snd_hda_codec ehci_hcd usbcore snd_hwdep snd_pcm mac80211 radeon ath snd_page_alloc snd_timer snd hp_wmi sdhci_pci sparse_keymap sp5100_tco i2c_piix4 soundcore cfg80211 sdhci wmi usb_common drm_kms_helper jmb38x_ms hp_accel psmouse r8169 ttm mmc_core thermal memstick rtc_cmos lis3lv02d evdev k10temp pcspkr input_polldev firewire_ohci mii serio_raw rfkill battery video ac button powernow_k8 mperf processor autofs4 sr_mod cdrom sd_mod pata_acpi ahci libahci pata_atiixp libata scsi_mod
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
Call Trace:
[<ffffffff81440f6c>] __schedule_bug+0x5d/0x61
[<ffffffff81446dbc>] __schedule+0x84c/0x9c0
[<ffffffff81097b34>] ? check_preempt_curr+0x84/0xa0
[<ffffffff8109d519>] ? pull_task+0x49/0x60
[<ffffffff8144705a>] schedule+0x3a/0x50
[<ffffffff81444936>] schedule_timeout+0x166/0x380
[<ffffffff81445ab5>] ? __mutex_lock_slowpath+0x235/0x340
[<ffffffff81077fe0>] ? init_timer_deferrable_key+0x20/0x20
[<ffffffffa02a940a>] radeon_pm_set_clocks+0x4ca/0x690 [radeon]
[<ffffffff8108b010>] ? abort_exclusive_wait+0xb0/0xb0
[<ffffffffa02a9930>] radeon_dynpm_idle_work_handler+0x160/0x170 [radeon]
[<ffffffffa02a97d0>] ? radeon_acpi_event+0xc0/0xc0 [radeon]
[<ffffffff8108509b>] process_one_work+0x11b/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: scheduling while atomic: kworker/1:3/119/0x00000003
Modules linked in: snd_hda_codec_hdmi uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev v4l2_compat_ioctl32 arc4 snd_hda_codec_idt ohci_hcd joydev snd_hda_intel ath5k snd_hda_codec ehci_hcd usbcore snd_hwdep snd_pcm mac80211 radeon ath snd_page_alloc snd_timer snd hp_wmi sdhci_pci sparse_keymap sp5100_tco i2c_piix4 soundcore cfg80211 sdhci wmi usb_common drm_kms_helper jmb38x_ms hp_accel psmouse r8169 ttm mmc_core thermal memstick rtc_cmos lis3lv02d evdev k10temp pcspkr input_polldev firewire_ohci mii serio_raw rfkill battery video ac button powernow_k8 mperf processor autofs4 sr_mod cdrom sd_mod pata_acpi ahci libahci pata_atiixp libata scsi_mod
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
Call Trace:
[<ffffffff81440f6c>] __schedule_bug+0x5d/0x61
[<ffffffff81446dbc>] __schedule+0x84c/0x9c0
[<ffffffff81097b34>] ? check_preempt_curr+0x84/0xa0
[<ffffffff8109d519>] ? pull_task+0x49/0x60
[<ffffffff81078ac3>] ? lock_timer_base.isra.33+0x33/0x70
[<ffffffff81078b91>] ? try_to_del_timer_sync+0x91/0x150
[<ffffffff8144705a>] schedule+0x3a/0x50
[<ffffffff81444936>] schedule_timeout+0x166/0x380
[<ffffffff81077fe0>] ? init_timer_deferrable_key+0x20/0x20
[<ffffffffa02a9521>] radeon_pm_set_clocks+0x5e1/0x690 [radeon]
[<ffffffff8108b010>] ? abort_exclusive_wait+0xb0/0xb0
[<ffffffffa02a9930>] radeon_dynpm_idle_work_handler+0x160/0x170 [radeon]
[<ffffffffa02a97d0>] ? radeon_acpi_event+0xc0/0xc0 [radeon]
[<ffffffff8108509b>] process_one_work+0x11b/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
last function: radeon_dynpm_idle_work_handler+0x0/0x170 [radeon]
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
Call Trace:
[<ffffffff810853c0>] process_one_work+0x440/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
last function: cfq_kick_queue+0x0/0x50
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
Call Trace:
[<ffffffff810853c0>] process_one_work+0x440/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
last function: do_dbs_timer+0x0/0x3d0

Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
...

These messages continued to scroll by until the machine hanged up. Does it look familiar to anybody? Anything to test or give more information about?

Mikko

#1 lore raw

Hi,

Testing a bit more. With the defaults:

$  cat /sys/class/drm/card0/device/power_profile
default
$  cat /sys/class/drm/card0/device/power_method
profile

the laptop boots and works fine. However, doing:

$ echo dynpm > /sys/class/drm/card0/device/power_method

leads to the scheduling while atomic bug.

Mikko

----- Original Message -----

Quoted 186 lines

From: Mikko Vinni:

testing 3.3.0-rc3 on an HP Pavilion dv5 (last tested kernel 3.2.5 works fine) and getting bugs apparently right after the radeon module is loaded.

Linux version 3.3.0-rc3-CUST (mikko@koni) (gcc version 4.6.2 20120120 (prerelease) (GCC) ) #198 SMP PREEMPT Thu Feb 9 09:36:43 EET 2012 Command line: BOOT_IMAGE=Arch_GitKernel ro root=803 ro root=/dev/sda3 init=/bin/systemd pcie_aspm=force
...
firewire_core: created device fw0: GUID 00241b00322a5501, S400 [drm] radeon defaulting to kernel modesetting.
[drm] radeon kernel modesetting enabled.
radeon 0000:01:00.0: power state changed by ACPI to D0
radeon 0000:01:00.0: power state changed by ACPI to D0
[drm] initializing kernel modesetting (RV620 0x1002:0x95C4 0x103C:0x3600). [drm] register mmio base: 0xD2300000
[drm] register mmio size: 65536
ATOM BIOS: M82
radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used)
radeon 0000:01:00.0: GTT: 512M 0x0000000020000000 - 0x000000003FFFFFFF [drm] Detected VRAM RAM=512M, BAR=256M
[drm] RAM width 64bits DDR
[TTM] Zone  kernel: Available graphics memory: 2023082 kiB.
[TTM] Initializing pool allocator.
[TTM] Initializing DMA pool allocator.
[drm] radeon: 512M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[drm] Driver supports precise vblank timestamp query.
radeon 0000:01:00.0: irq 46 for MSI/MSI-X
radeon 0000:01:00.0: radeon: using MSI.
[drm] radeon: irq initialized.
[drm] GART: num cpu pages 131072, num gpu pages 131072
[drm] radeon: ib pool ready.
[drm] Loading RV620 Microcode
usbcore: registered new interface driver usbfs
...
[drm] PCIE GART of 512M enabled (table at 0x0000000000040000). radeon 0000:01:00.0: WB enabled
[drm] fence driver on ring 0 use gpu addr 0x20000c00 and cpu addr 0xffff8801364bfc00
[drm] ring test on 0 succeeded in 1 usecs
[drm] ib test on ring 0 succeeded in 0 usecs
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   LVDS
[drm]   Encoders:
[drm]     LCD1: INTERNAL_KLDSCP_LVTMA
[drm] Connector 1:
[drm]   VGA
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c [drm]   Encoders:
[drm]     CRT1: INTERNAL_KLDSCP_DAC1
[drm] Connector 2:
[drm]   DIN
[drm]   Encoders:
[drm]     TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 3:
[drm]   HDMI-A
[drm]   HPD1
[drm]   DDC: 0x7e20 0x7e20 0x7e24 0x7e24 0x7e28 0x7e28 0x7e2c 0x7e2c [drm]   Encoders:
[drm]     DFP1: INTERNAL_UNIPHY
[drm] radeon: power management initialized

...
[drm] fb mappable at 0xC0142000
[drm] vram apper at 0xC0000000
[drm] size 4096000
[drm] fb depth is 24
[drm]    pitch is 5120
fbcon: radeondrmfb (fb0) is primary device
Feb  9 16:54:56 koni systemd-fsck[287]: /dev/sda5: clean, 1102549/17514496 files, 32142735/70035359 blocks (check in 2 mounts)
Feb  9 16:54:56 koni systemd-tmpfiles[298]: Two or more conflicting lines for /tmp configured, ignoring.
Console: switching to colour frame buffer device 160x50
fb0: radeondrmfb frame buffer device
drm: registered panic notifier
[drm] Initialized radeon 2.13.0 20080528 for 0000:01:00.0 on minor 0 snd_hda_intel 0000:01:00.1: irq 47 for MSI/MSI-X
HDMI status: Codec=0 Pin=3 Presence_Detect=0 ELD_Valid=0
input: HDA ATI HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:02.0/0000:01:00.1/sound/card1/input15 EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: commit=30

BUG: scheduling while atomic: kworker/1:3/119/0x00000003
Modules linked in: snd_hda_codec_hdmi uvcvideo videobuf2_vmalloc 

videobuf2_memops videobuf2_core videodev v4l2_compat_ioctl32 arc4 snd_hda_codec_idt ohci_hcd joydev snd_hda_intel ath5k snd_hda_codec ehci_hcd usbcore snd_hwdep snd_pcm mac80211 radeon ath snd_page_alloc snd_timer snd hp_wmi sdhci_pci sparse_keymap sp5100_tco i2c_piix4 soundcore cfg80211 sdhci wmi usb_common drm_kms_helper jmb38x_ms hp_accel psmouse r8169 ttm mmc_core thermal memstick rtc_cmos lis3lv02d evdev k10temp pcspkr input_polldev firewire_ohci mii serio_raw rfkill battery video ac button powernow_k8 mperf processor autofs4 sr_mod cdrom sd_mod pata_acpi ahci libahci pata_atiixp libata scsi_mod
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198

Call Trace:
[<ffffffff81440f6c>] __schedule_bug+0x5d/0x61
[<ffffffff81446dbc>] __schedule+0x84c/0x9c0
[<ffffffff81097b34>] ? check_preempt_curr+0x84/0xa0
[<ffffffff8109d519>] ? pull_task+0x49/0x60
[<ffffffff8144705a>] schedule+0x3a/0x50
[<ffffffff81444936>] schedule_timeout+0x166/0x380
[<ffffffff81445ab5>] ? __mutex_lock_slowpath+0x235/0x340
[<ffffffff81077fe0>] ? init_timer_deferrable_key+0x20/0x20
[<ffffffffa02a940a>] radeon_pm_set_clocks+0x4ca/0x690 [radeon]
[<ffffffff8108b010>] ? abort_exclusive_wait+0xb0/0xb0
[<ffffffffa02a9930>] radeon_dynpm_idle_work_handler+0x160/0x170 [radeon]
[<ffffffffa02a97d0>] ? radeon_acpi_event+0xc0/0xc0 [radeon]
[<ffffffff8108509b>] process_one_work+0x11b/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: scheduling while atomic: kworker/1:3/119/0x00000003
Modules linked in: snd_hda_codec_hdmi uvcvideo videobuf2_vmalloc 

videobuf2_memops videobuf2_core videodev v4l2_compat_ioctl32 arc4 snd_hda_codec_idt ohci_hcd joydev snd_hda_intel ath5k snd_hda_codec ehci_hcd usbcore snd_hwdep snd_pcm mac80211 radeon ath snd_page_alloc snd_timer snd hp_wmi sdhci_pci sparse_keymap sp5100_tco i2c_piix4 soundcore cfg80211 sdhci wmi usb_common drm_kms_helper jmb38x_ms hp_accel psmouse r8169 ttm mmc_core thermal memstick rtc_cmos lis3lv02d evdev k10temp pcspkr input_polldev firewire_ohci mii serio_raw rfkill battery video ac button powernow_k8 mperf processor autofs4 sr_mod cdrom sd_mod pata_acpi ahci libahci pata_atiixp libata scsi_mod
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198

Call Trace:
[<ffffffff81440f6c>] __schedule_bug+0x5d/0x61
[<ffffffff81446dbc>] __schedule+0x84c/0x9c0
[<ffffffff81097b34>] ? check_preempt_curr+0x84/0xa0
[<ffffffff8109d519>] ? pull_task+0x49/0x60
[<ffffffff81078ac3>] ? lock_timer_base.isra.33+0x33/0x70
[<ffffffff81078b91>] ? try_to_del_timer_sync+0x91/0x150
[<ffffffff8144705a>] schedule+0x3a/0x50
[<ffffffff81444936>] schedule_timeout+0x166/0x380
[<ffffffff81077fe0>] ? init_timer_deferrable_key+0x20/0x20
[<ffffffffa02a9521>] radeon_pm_set_clocks+0x5e1/0x690 [radeon]
[<ffffffff8108b010>] ? abort_exclusive_wait+0xb0/0xb0
[<ffffffffa02a9930>] radeon_dynpm_idle_work_handler+0x160/0x170 [radeon]
[<ffffffffa02a97d0>] ? radeon_acpi_event+0xc0/0xc0 [radeon]
[<ffffffff8108509b>] process_one_work+0x11b/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
last function: radeon_dynpm_idle_work_handler+0x0/0x170 [radeon]
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
Call Trace:
[<ffffffff810853c0>] process_one_work+0x440/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
last function: cfq_kick_queue+0x0/0x50
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
Call Trace:
[<ffffffff810853c0>] process_one_work+0x440/0x4d0
[<ffffffff81085a1d>] worker_thread+0x15d/0x340
[<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
[<ffffffff8108a77e>] kthread+0x8e/0xa0
[<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
[<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
[<ffffffff81449df0>] ? gs_change+0xb/0xb
BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
last function: do_dbs_timer+0x0/0x3d0

Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
...

These messages continued to scroll by until the machine hanged up. Does it look familiar to anybody? Anything to test or give more information about?

Mikko

author Reviewed-by Jerome Glisse
#2 lore raw

Hi again,

I bisected this problem to:

47492a23a128e953bd5087b1cac909cd8124ca5e is the first bad commit commit 47492a23a128e953bd5087b1cac909cd8124ca5e
Author: Christian König <[email protected]> Date:   Thu Oct 20 12:38:09 2011 +0200

    drm/radeon: add radeon_fence_count_emited function
    Split counting of emited fences out of power management into a seperate function.

:040000 040000 adbb5199d8ee03a75f65b9ddf6b1d398acfca4d9 67b8d0bfdd5507d82b0c8d8f500f32d140520f0d M    drivers

That patch (part of it below) moves code into a new function and perhaps changes locking a bit. Is the return in the middle ok? This laptop has two cpus and

CONFIG_TREE_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_PREEMPT_TRACER is not set

drivers/gpu/drm/radeon/radeon_fence.c +0 -0
@@ -368,6 +368,27 @@ void radeon_fence_process(struct radeon_device *rdev, int r

        }
 }

+int radeon_fence_count_emitted(struct radeon_device *rdev, int ring) +{
+       unsigned long irq_flags;
+       int not_processed = 0;
+
+       read_lock_irqsave(&rdev->fence_lock, irq_flags);
+       if (!rdev->fence_drv[ring].initialized)
+               return 0;
+
+       if (!list_empty(&rdev->fence_drv[ring].emitted)) { +               struct list_head *ptr;
+               list_for_each(ptr, &rdev->fence_drv[ring].emitted) { +                       /* count up to 3, that's enought info */ +                       if (++not_processed >= 3)
+                               break;
+               }
+       }
+       read_unlock_irqrestore(&rdev->fence_lock, irq_flags); +       return not_processed;
+}
+

Mikko

----- Original Message -----

Quoted 227 lines

From: Mikko Vinni
To: "[email protected]" <[email protected]>
Cc: airlied; alexander.deucher
Sent: Friday, February 10, 2012 10:06 AM
Subject: Re: scheduling while atomic on radeon rv620, kernel 3.30-rc3

Hi,

Testing a bit more. With the defaults:

$  cat /sys/class/drm/card0/device/power_profile
default
$  cat /sys/class/drm/card0/device/power_method
profile

the laptop boots and works fine. However, doing:

$ echo dynpm > /sys/class/drm/card0/device/power_method

leads to the scheduling while atomic bug.

Mikko

----- Original Message -----

Quoted 3 lines

From: Mikko Vinni:

testing 3.3.0-rc3 on an HP Pavilion dv5 (last tested kernel 3.2.5 works

fine)

Quoted 18 lines

and getting bugs apparently right after the radeon module is loaded.

Linux version 3.3.0-rc3-CUST (mikko@koni) (gcc version 4.6.2 20120120 (prerelease) (GCC) ) #198 SMP PREEMPT Thu Feb 9 09:36:43 EET 2012 Command line: BOOT_IMAGE=Arch_GitKernel ro root=803 ro root=/dev/sda3 init=/bin/systemd pcie_aspm=force
...
firewire_core: created device fw0: GUID 00241b00322a5501, S400 [drm] radeon defaulting to kernel modesetting.
[drm] radeon kernel modesetting enabled.
radeon 0000:01:00.0: power state changed by ACPI to D0
radeon 0000:01:00.0: power state changed by ACPI to D0
[drm] initializing kernel modesetting (RV620 0x1002:0x95C4 0x103C:0x3600). [drm] register mmio base: 0xD2300000
[drm] register mmio size: 65536
ATOM BIOS: M82
radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF

(512M

Quoted 47 lines

used)
radeon 0000:01:00.0: GTT: 512M 0x0000000020000000 - 0x000000003FFFFFFF [drm] Detected VRAM RAM=512M, BAR=256M
[drm] RAM width 64bits DDR
[TTM] Zone  kernel: Available graphics memory: 2023082 kiB. [TTM] Initializing pool allocator.
[TTM] Initializing DMA pool allocator.
[drm] radeon: 512M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] Supports vblank timestamp caching Rev 1 (10.10.2010). [drm] Driver supports precise vblank timestamp query. radeon 0000:01:00.0: irq 46 for MSI/MSI-X
radeon 0000:01:00.0: radeon: using MSI.
[drm] radeon: irq initialized.
[drm] GART: num cpu pages 131072, num gpu pages 131072 [drm] radeon: ib pool ready.
[drm] Loading RV620 Microcode
usbcore: registered new interface driver usbfs
...
[drm] PCIE GART of 512M enabled (table at 0x0000000000040000). radeon 0000:01:00.0: WB enabled
[drm] fence driver on ring 0 use gpu addr 0x20000c00 and cpu addr 0xffff8801364bfc00
[drm] ring test on 0 succeeded in 1 usecs
[drm] ib test on ring 0 succeeded in 0 usecs
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   LVDS
[drm]   Encoders:
[drm]     LCD1: INTERNAL_KLDSCP_LVTMA
[drm] Connector 1:
[drm]   VGA
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c [drm]   Encoders:
[drm]     CRT1: INTERNAL_KLDSCP_DAC1
[drm] Connector 2:
[drm]   DIN
[drm]   Encoders:
[drm]     TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 3:
[drm]   HDMI-A
[drm]   HPD1
[drm]   DDC: 0x7e20 0x7e20 0x7e24 0x7e24 0x7e28 0x7e28 0x7e2c 0x7e2c [drm]   Encoders:
[drm]     DFP1: INTERNAL_UNIPHY
[drm] radeon: power management initialized

Quoted 10 lines

...
[drm] fb mappable at 0xC0142000
[drm] vram apper at 0xC0000000
[drm] size 4096000
[drm] fb depth is 24
[drm]    pitch is 5120
fbcon: radeondrmfb (fb0) is primary device
Feb  9 16:54:56 koni systemd-fsck[287]: /dev/sda5: clean, 1102549/17514496 files, 32142735/70035359 blocks (check in 2 mounts)
Feb  9 16:54:56 koni systemd-tmpfiles[298]: Two or more conflicting lines

for

Quoted 10 lines

/tmp configured, ignoring.
Console: switching to colour frame buffer device 160x50
fb0: radeondrmfb frame buffer device
drm: registered panic notifier
[drm] Initialized radeon 2.13.0 20080528 for 0000:01:00.0 on minor 0 snd_hda_intel 0000:01:00.1: irq 47 for MSI/MSI-X
HDMI status: Codec=0 Pin=3 Presence_Detect=0 ELD_Valid=0
input: HDA ATI HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:02.0/0000:01:00.1/sound/card1/input15 EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: commit=30

Quoted 4 lines
 BUG: scheduling while atomic: kworker/1:3/119/0x00000003
 Modules linked in: snd_hda_codec_hdmi uvcvideo videobuf2_vmalloc 
 videobuf2_memops videobuf2_core videodev v4l2_compat_ioctl32 arc4 
 snd_hda_codec_idt ohci_hcd joydev snd_hda_intel ath5k snd_hda_codec 

ehci_hcd

Quoted 2 lines

usbcore snd_hwdep snd_pcm mac80211 radeon ath snd_page_alloc snd_timer snd hp_wmi sdhci_pci sparse_keymap sp5100_tco i2c_piix4 soundcore cfg80211

sdhci wmi

Quoted 1 line

usb_common drm_kms_helper jmb38x_ms hp_accel psmouse r8169 ttm mmc_core

thermal

Quoted 1 line

memstick rtc_cmos lis3lv02d evdev k10temp pcspkr input_polldev

firewire_ohci mii

Quoted 1 line

serio_raw rfkill battery video ac button powernow_k8 mperf processor

autofs4

Quoted 14 lines

sr_mod cdrom sd_mod pata_acpi ahci libahci pata_atiixp libata scsi_mod
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198

 Call Trace:
 [<ffffffff81440f6c>] __schedule_bug+0x5d/0x61
 [<ffffffff81446dbc>] __schedule+0x84c/0x9c0
 [<ffffffff81097b34>] ? check_preempt_curr+0x84/0xa0
 [<ffffffff8109d519>] ? pull_task+0x49/0x60
 [<ffffffff8144705a>] schedule+0x3a/0x50
 [<ffffffff81444936>] schedule_timeout+0x166/0x380
 [<ffffffff81445ab5>] ? __mutex_lock_slowpath+0x235/0x340
 [<ffffffff81077fe0>] ? init_timer_deferrable_key+0x20/0x20
 [<ffffffffa02a940a>] radeon_pm_set_clocks+0x4ca/0x690 [radeon]
 [<ffffffff8108b010>] ? abort_exclusive_wait+0xb0/0xb0
 [<ffffffffa02a9930>] radeon_dynpm_idle_work_handler+0x160/0x170 

[radeon]

Quoted 12 lines

[<ffffffffa02a97d0>] ? radeon_acpi_event+0xc0/0xc0 [radeon]

 [<ffffffff8108509b>] process_one_work+0x11b/0x4d0
 [<ffffffff81085a1d>] worker_thread+0x15d/0x340
 [<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
 [<ffffffff8108a77e>] kthread+0x8e/0xa0
 [<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
 [<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
 [<ffffffff81449df0>] ? gs_change+0xb/0xb
 BUG: scheduling while atomic: kworker/1:3/119/0x00000003
 Modules linked in: snd_hda_codec_hdmi uvcvideo videobuf2_vmalloc 
 videobuf2_memops videobuf2_core videodev v4l2_compat_ioctl32 arc4 
 snd_hda_codec_idt ohci_hcd joydev snd_hda_intel ath5k snd_hda_codec 

ehci_hcd

Quoted 2 lines

usbcore snd_hwdep snd_pcm mac80211 radeon ath snd_page_alloc snd_timer snd hp_wmi sdhci_pci sparse_keymap sp5100_tco i2c_piix4 soundcore cfg80211

sdhci wmi

Quoted 1 line

usb_common drm_kms_helper jmb38x_ms hp_accel psmouse r8169 ttm mmc_core

thermal

Quoted 1 line

memstick rtc_cmos lis3lv02d evdev k10temp pcspkr input_polldev

firewire_ohci mii

Quoted 1 line

serio_raw rfkill battery video ac button powernow_k8 mperf processor

autofs4

Quoted 15 lines

sr_mod cdrom sd_mod pata_acpi ahci libahci pata_atiixp libata scsi_mod
Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198

 Call Trace:
 [<ffffffff81440f6c>] __schedule_bug+0x5d/0x61
 [<ffffffff81446dbc>] __schedule+0x84c/0x9c0
 [<ffffffff81097b34>] ? check_preempt_curr+0x84/0xa0
 [<ffffffff8109d519>] ? pull_task+0x49/0x60
 [<ffffffff81078ac3>] ? lock_timer_base.isra.33+0x33/0x70
 [<ffffffff81078b91>] ? try_to_del_timer_sync+0x91/0x150
 [<ffffffff8144705a>] schedule+0x3a/0x50
 [<ffffffff81444936>] schedule_timeout+0x166/0x380
 [<ffffffff81077fe0>] ? init_timer_deferrable_key+0x20/0x20
 [<ffffffffa02a9521>] radeon_pm_set_clocks+0x5e1/0x690 [radeon]
 [<ffffffff8108b010>] ? abort_exclusive_wait+0xb0/0xb0
 [<ffffffffa02a9930>] radeon_dynpm_idle_work_handler+0x160/0x170 

[radeon]

Quoted 43 lines

[<ffffffffa02a97d0>] ? radeon_acpi_event+0xc0/0xc0 [radeon]

 [<ffffffff8108509b>] process_one_work+0x11b/0x4d0
 [<ffffffff81085a1d>] worker_thread+0x15d/0x340
 [<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
 [<ffffffff8108a77e>] kthread+0x8e/0xa0
 [<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
 [<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
 [<ffffffff81449df0>] ? gs_change+0xb/0xb
 BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
 last function: radeon_dynpm_idle_work_handler+0x0/0x170 [radeon]
 Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
 Call Trace:
 [<ffffffff810853c0>] process_one_work+0x440/0x4d0
 [<ffffffff81085a1d>] worker_thread+0x15d/0x340
 [<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
 [<ffffffff8108a77e>] kthread+0x8e/0xa0
 [<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
 [<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
 [<ffffffff81449df0>] ? gs_change+0xb/0xb
 BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
 last function: cfq_kick_queue+0x0/0x50
 Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
 Call Trace:
 [<ffffffff810853c0>] process_one_work+0x440/0x4d0
 [<ffffffff81085a1d>] worker_thread+0x15d/0x340
 [<ffffffff810858c0>] ? manage_workers.isra.27+0x220/0x220
 [<ffffffff8108a77e>] kthread+0x8e/0xa0
 [<ffffffff81449df4>] kernel_thread_helper+0x4/0x10
 [<ffffffff8108a6f0>] ? kthread_freezable_should_stop+0x60/0x60
 [<ffffffff81449df0>] ? gs_change+0xb/0xb
 BUG: workqueue leaked lock or atomic: kworker/1:3/0x00000002/119
 last function: do_dbs_timer+0x0/0x3d0
 Pid: 119, comm: kworker/1:3 Not tainted 3.3.0-rc3-CUST #198
 ...

These messages continued to scroll by until the machine hanged up. Does it look familiar to anybody? Anything to test or give more information about?

Mikko

maintainer
#3 lore raw
Quoted 18 lines · Mikko Vinni

Hi again,

I bisected this problem to:

47492a23a128e953bd5087b1cac909cd8124ca5e is the first bad commit commit 47492a23a128e953bd5087b1cac909cd8124ca5e
Author: Christian König <[email protected]> Date:   Thu Oct 20 12:38:09 2011 +0200

    drm/radeon: add radeon_fence_count_emited function

    Split counting of emited fences out of power
    management into a seperate function.

Quoted 6 lines

:040000 040000 adbb5199d8ee03a75f65b9ddf6b1d398acfca4d9 67b8d0bfdd5507d82b0c8d8f500f32d140520f0d M    drivers

That patch (part of it below) moves code into a new function and perhaps changes locking a bit. Is the return in the middle ok?

I've just posted a patch to fix that to dri-devel, can you check it fixes your issue?

Dave.

#4 lore raw
Quoted 5 lines

From Dave Airlie:

I've just posted a patch to fix that to dri-devel, can you check it fixes your issue?

"drm/radeon/kms: drop lock in return path of radeon_fence_count_emitted" fixes the problem. Tested on top of 47492a23a and 3.3.0-rc3+00188-g3ec1e88.

Thanks,

Mikko