diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-06-02 06:49:45 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-06-06 06:04:03 +0200 |
commit | 8fa4338acca96cbc231e4125229632e879476464 (patch) | |
tree | f6efdd42b4cbdfd5825b0b2d1b1d110a88b66db0 /drivers/gpu | |
parent | drm/nouveau: replace multiple open-coded runpm support checks with function (diff) | |
download | linux-8fa4338acca96cbc231e4125229632e879476464.tar.xz linux-8fa4338acca96cbc231e4125229632e879476464.zip |
drm/nouveau: enable autosuspend only when it'll actually be used
This prevents a deadlock that somehow results from the suspend() ->
forbid() -> resume() callchain.
[ 125.266960] [drm] Initialized nouveau 1.3.1 20120801 for 0000:02:00.0 on minor 1
[ 370.120872] INFO: task kworker/4:1:77 blocked for more than 120 seconds.
[ 370.120920] Tainted: G O 4.12.0-rc3 #20
[ 370.120947] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 370.120982] kworker/4:1 D13808 77 2 0x00000000
[ 370.120998] Workqueue: pm pm_runtime_work
[ 370.121004] Call Trace:
[ 370.121018] __schedule+0x2bf/0xb40
[ 370.121025] ? mark_held_locks+0x5f/0x90
[ 370.121038] schedule+0x3d/0x90
[ 370.121044] rpm_resume+0x107/0x870
[ 370.121052] ? finish_wait+0x90/0x90
[ 370.121065] ? pci_pm_runtime_resume+0xa0/0xa0
[ 370.121070] pm_runtime_forbid+0x4c/0x60
[ 370.121129] nouveau_pmops_runtime_suspend+0xaf/0xc0 [nouveau]
[ 370.121139] pci_pm_runtime_suspend+0x5f/0x170
[ 370.121147] ? pci_pm_runtime_resume+0xa0/0xa0
[ 370.121152] __rpm_callback+0xb9/0x1e0
[ 370.121159] ? pci_pm_runtime_resume+0xa0/0xa0
[ 370.121166] rpm_callback+0x24/0x80
[ 370.121171] ? pci_pm_runtime_resume+0xa0/0xa0
[ 370.121176] rpm_suspend+0x138/0x6e0
[ 370.121192] pm_runtime_work+0x7b/0xc0
[ 370.121199] process_one_work+0x253/0x6a0
[ 370.121216] worker_thread+0x4d/0x3b0
[ 370.121229] kthread+0x133/0x150
[ 370.121234] ? process_one_work+0x6a0/0x6a0
[ 370.121238] ? kthread_create_on_node+0x70/0x70
[ 370.121246] ret_from_fork+0x2a/0x40
[ 370.121283]
Showing all locks held in the system:
[ 370.121291] 2 locks held by kworker/4:1/77:
[ 370.121298] #0: ("pm"){.+.+.+}, at: [<ffffffffac0d3530>] process_one_work+0x1d0/0x6a0
[ 370.121315] #1: ((&dev->power.work)){+.+.+.}, at: [<ffffffffac0d3530>] process_one_work+0x1d0/0x6a0
[ 370.121330] 1 lock held by khungtaskd/81:
[ 370.121333] #0: (tasklist_lock){.+.+..}, at: [<ffffffffac10fc8d>] debug_show_all_locks+0x3d/0x1a0
[ 370.121355] 1 lock held by dmesg/1639:
[ 370.121358] #0: (&user->lock){+.+.+.}, at: [<ffffffffac124b6d>] devkmsg_read+0x4d/0x360
[ 370.121377] =============================================
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 210910712606..15a13d09d431 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -495,7 +495,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) nouveau_fbcon_init(dev); nouveau_led_init(dev); - if (nouveau_runtime_pm != 0) { + if (nouveau_pmops_runtime()) { pm_runtime_use_autosuspend(dev->dev); pm_runtime_set_autosuspend_delay(dev->dev, 5000); pm_runtime_set_active(dev->dev); @@ -527,7 +527,7 @@ nouveau_drm_unload(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); - if (nouveau_runtime_pm != 0) { + if (nouveau_pmops_runtime()) { pm_runtime_get_sync(dev->dev); pm_runtime_forbid(dev->dev); } |