読者です 読者をやめる 読者になる 読者になる

これの流れ。 sleeping function called from invalid context at drivers/base/power/runtime.c:785

kernel linux

tumblrから移動
こういう流れか。__run_timers()がinline展開されるからrun_timer_softirq()の0x14bバイト目が分かり辛かったけど。

run_timer_softirq()  
  --> __run_timers() 
    --> call_timer_fn() 
      --> rts51x_suspend_timer_fn() 
        --> usb_autopm_put_interface() 
          --> pm_runtime_put_sync() 
              --> __pm_runtime_idle() 
                --> __might_sleep()

↓のトレース

[   84.266842] BUG: sleeping function called from invalid context at drivers/bas
e/power/runtime.c:785
[   84.266850] in_atomic(): 1, irqs_disabled(): 0, pid: 77, name: kmemleak
[   84.266855] 2 locks held by kmemleak/77:
[   84.266858]  #0:  (scan_mutex){......}, at: [] kmemleak_sca
n_thread+0x61/0xaa
[   84.266873]  #1:  (&chip->rts51x_suspend_timer){......}, at: [] run_timer_softirq+0x14b/0x2e6
[   84.266887] Pid: 77, comm: kmemleak Not tainted 3.2.0test #25
[   84.266890] Call Trace:
[   84.266893]    [] __might_sleep+0xf6/0xfb
[   84.266906]  [] __pm_runtime_idle+0x3c/0x95
[   84.266914]  [] usb_autopm_put_interface+0x3a/0x3e
[   84.266923]  [] rts51x_suspend_timer_fn+0x62/0x64 [ums_real
tek]
[   84.266929]  [] run_timer_softirq+0x1d4/0x2e6