]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
xilinx-usbps: Initialize ehci hcd before using it
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 6 Dec 2012 11:52:14 +0000 (12:52 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 6 Dec 2012 15:12:58 +0000 (16:12 +0100)
commit850056dcff8bd6020d5843a56e5cc74c63864be5
treeb0d6a8da162dad6d850175b78c8088401123e752
parent78d0400dc658e0be4e18746d1462959329b4ce96
xilinx-usbps: Initialize ehci hcd before using it

In ehci_xusbps_setup ehci_halt is called before ehci_init. This means that the
initial ehci_halt call is working on a not completely initialized ehci hcd
struct, which might cause undefined behavior. So make sure to call ehci_init
before calling ehci_halt.

This fixes also the following lockdep warning:

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
[<c001355c>] (unwind_backtrace+0x0/0xe0) from [<c005c6c0>] (__lock_acquire+0x1ac/0x19c0)
[<c005c6c0>] (__lock_acquire+0x1ac/0x19c0) from [<c005e394>] (lock_acquire+0x60/0x74)
[<c005e394>] (lock_acquire+0x60/0x74) from [<c034843c>] (_raw_spin_lock_irq+0x50/0x60)
[<c034843c>] (_raw_spin_lock_irq+0x50/0x60) from [<c02202e8>] (ehci_halt+0x14/0xd8)
[<c02202e8>] (ehci_halt+0x14/0xd8) from [<c022532c>] (ehci_xusbps_setup+0x58/0x41c)
[<c022532c>] (ehci_xusbps_setup+0x58/0x41c) from [<c020f828>] (usb_add_hcd+0x194/0x5c0)
[<c020f828>] (usb_add_hcd+0x194/0x5c0) from [<c0223e28>] (ehci_xusbps_drv_probe+0x158/0x1e0)
[<c0223e28>] (ehci_xusbps_drv_probe+0x158/0x1e0) from [<c01c84dc>] (platform_drv_probe+0x14/0x18)
...

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
drivers/usb/host/ehci-xilinx-usbps.c