summaryrefslogtreecommitdiff
path: root/tools/arch/x86/lib
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-02-04 00:44:36 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-02-04 00:44:36 +0100
commita9306a63631493afc75893a4ac405d4e1cbae6aa (patch)
tree84ad2b2df537b05b0142591c5d016ff0c7262b6e /tools/arch/x86/lib
parent566cf877a1fcb6d6dc0126b076aad062054c2637 (diff)
PM / runtime: Avoid false-positive warnings from might_sleep_if()
The might_sleep_if() assertions in __pm_runtime_idle(), __pm_runtime_suspend() and __pm_runtime_resume() may generate false-positive warnings in some situations. For example, that happens if a nested pm_runtime_get_sync()/pm_runtime_put() pair is executed with disabled interrupts within an outer pm_runtime_get_sync()/pm_runtime_put() section for the same device. [Generally, pm_runtime_get_sync() may sleep, so it should not be called with disabled interrupts, but in this particular case the previous pm_runtime_get_sync() guarantees that the device will not be suspended, so the inner pm_runtime_get_sync() will return immediately after incrementing the device's usage counter.] That started to happen in the i915 driver in 4.10-rc, leading to the following splat: BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1032 in_atomic(): 1, irqs_disabled(): 0, pid: 1500, name: Xorg 1 lock held by Xorg/1500: #0: (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0680c13>] i915_mutex_lock_interruptible+0x43/0x140 [i915] CPU: 0 PID: 1500 Comm: Xorg Not tainted Call Trace: dump_stack+0x85/0xc2 ___might_sleep+0x196/0x260 __might_sleep+0x53/0xb0 __pm_runtime_resume+0x7a/0x90 intel_runtime_pm_get+0x25/0x90 [i915] aliasing_gtt_bind_vma+0xaa/0xf0 [i915] i915_vma_bind+0xaf/0x1e0 [i915] i915_gem_execbuffer_relocate_entry+0x513/0x6f0 [i915] i915_gem_execbuffer_relocate_vma.isra.34+0x188/0x250 [i915] ? trace_hardirqs_on+0xd/0x10 ? i915_gem_execbuffer_reserve_vma.isra.31+0x152/0x1f0 [i915] ? i915_gem_execbuffer_reserve.isra.32+0x372/0x3a0 [i915] i915_gem_do_execbuffer.isra.38+0xa70/0x1a40 [i915] ? __might_fault+0x4e/0xb0 i915_gem_execbuffer2+0xc5/0x260 [i915] ? __might_fault+0x4e/0xb0 drm_ioctl+0x206/0x450 [drm] ? i915_gem_execbuffer+0x340/0x340 [i915] ? __fget+0x5/0x200 do_vfs_ioctl+0x91/0x6f0 ? __fget+0x111/0x200 ? __fget+0x5/0x200 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x23/0xc6 even though the code triggering it is correct. Unfortunately, the might_sleep_if() assertions in question are too coarse-grained to cover such cases correctly, so make them a bit less sensitive in order to avoid the false-positives. Reported-and-tested-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/arch/x86/lib')
0 files changed, 0 insertions, 0 deletions
cb3157f828fcaadd259613f59db3c6d1c'>xfs_bit.c2838logplain -rw-r--r--xfs_bit.h2205logplain -rw-r--r--xfs_bmap.c188347logplain -rw-r--r--xfs_bmap.h9626logplain -rw-r--r--xfs_bmap_btree.c23607logplain -rw-r--r--xfs_bmap_btree.h5127logplain -rw-r--r--xfs_btree.c130616logplain -rw-r--r--xfs_btree.h15991logplain -rw-r--r--xfs_cksum.h2349logplain -rw-r--r--xfs_da_btree.c71812logplain -rw-r--r--xfs_da_btree.h8410logplain -rw-r--r--xfs_da_format.c24460logplain -rw-r--r--xfs_da_format.h29695logplain -rw-r--r--xfs_defer.c16992logplain -rw-r--r--xfs_defer.h3850logplain -rw-r--r--xfs_dir2.c18156logplain -rw-r--r--xfs_dir2.h10424logplain -rw-r--r--xfs_dir2_block.c35982logplain -rw-r--r--xfs_dir2_data.c31525logplain -rw-r--r--xfs_dir2_leaf.c51028logplain -rw-r--r--xfs_dir2_node.c63425logplain -rw-r--r--xfs_dir2_priv.h5939logplain -rw-r--r--xfs_dir2_sf.c33900logplain -rw-r--r--xfs_dquot_buf.c8406logplain -rw-r--r--xfs_format.h58687logplain -rw-r--r--xfs_fs.h20625logplain -rw-r--r--xfs_ialloc.c73827logplain -rw-r--r--xfs_ialloc.h5579logplain -rw-r--r--xfs_ialloc_btree.c12518logplain -rw-r--r--xfs_ialloc_btree.h2360logplain -rw-r--r--xfs_inode_buf.c17330logplain -rw-r--r--xfs_inode_buf.h3394logplain -rw-r--r--xfs_inode_fork.c59640logplain -rw-r--r--xfs_inode_fork.h7557logplain -rw-r--r--xfs_log_format.h30192logplain -rw-r--r--xfs_log_recover.h2045logplain -rw-r--r--xfs_log_rlimit.c4786logplain -rw-r--r--xfs_quota_defs.h6595logplain -rw-r--r--xfs_refcount.c47285logplain -rw-r--r--xfs_refcount.h2666logplain