MLK-17261-1 usb: cdns3: gadget: fix the spinlock recursion problem when detach cable
authorPeter Chen <peter.chen@nxp.com>
Thu, 21 Dec 2017 01:05:45 +0000 (09:05 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:52:01 +0000 (14:52 -0500)
commit903ae6416934c14b06e674a4d890079aca4b2f40
tree9d7594a999c2eb80b536045b45b612f3ce3337f2
parent03383618b3d923f596600792234f0b325a9ec73f
MLK-17261-1 usb: cdns3: gadget: fix the spinlock recursion problem when detach cable

The __cdns3_gadget_stop holds spinlock before calling
usb_ss->gadget_driver->disconnect which calls ep_disable,
and ep_disable tries to hold spinlock too.

To fix it, let spinlock only protect the variable and register access.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/cdns3/gadget.c