]> git.baikalelectronics.ru Git - kernel.git/commit
usb: r8a66597-hcd: Fix up spinlock recursion in root hub polling.
authorPaul Mundt <lethal@linux-sh.org>
Thu, 4 Feb 2010 06:58:28 +0000 (06:58 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 5 Feb 2010 02:53:28 +0000 (11:53 +0900)
commit5e207a21e6e05a12d1ee5d7e438a0300f80aa2cb
treefc1e5338940c4562d6b0e9df9e1a5525407b95c3
parent9eba1b00c111365788b1ee540c8534fbe7d4b35d
usb: r8a66597-hcd: Fix up spinlock recursion in root hub polling.

The current root hub polling code exhibits a spinlock recursion on the
private controller lock. r8a66597_root_hub_control() is called from
r8a66597_timer() which grabs the lock and disables IRQs. The following
chain emerges:

  r8a66597_timer() <-- lock taken
    r8a66597_root_hub_control()
      r8a66597_check_syssts()
        usb_hcd_poll_rh_status() <-- acquires the same lock
/* insert death here */

The entire chain requires IRQs to be disabled, so we just unlock and
relock around the call to usb_hcd_poll_rh_status() while leaving the
IRQ state unchanged.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
drivers/usb/host/r8a66597-hcd.c