]> git.baikalelectronics.ru Git - kernel.git/commit
usb: cdns3: gadget: own the lock wrongly at the suspend routine
authorPeter Chen <peter.chen@nxp.com>
Thu, 29 Oct 2020 09:55:18 +0000 (17:55 +0800)
committerPeter Chen <peter.chen@nxp.com>
Fri, 30 Oct 2020 03:40:54 +0000 (11:40 +0800)
commit368409493813fc15a7f05a05edb99b206484b1d0
tree0628c1b77c99d7aa5c3eb7b0930994e93eda3424
parent4e9dd3ae3322aa3db7dadd2b7a37d70cdbf0178a
usb: cdns3: gadget: own the lock wrongly at the suspend routine

When the system goes to suspend, if the controller is at device mode with
cable connecting to host, the call stack is: cdns3_suspend->
cdns3_gadget_suspend -> cdns3_disconnect_gadget, after cdns3_disconnect_gadget
is called, it owns lock wrongly, it causes the system being deadlock after
resume due to at cdns3_device_thread_irq_handler, it tries to get the lock,
but can't get it forever.

To fix it, we delete the unlock-lock operations at cdns3_disconnect_gadget,
and do it at the caller.

Fixes: ce9fc55d5345 ("usb: cdns3: add runtime PM support")
Acked-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/cdns3/gadget.c