diff options
author | Pawel Laszczak <pawell@cadence.com> | 2019-09-26 03:58:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-04 05:02:58 -0400 |
commit | 9816144313d33974bbd4599d4e8e554c11cae27e (patch) | |
tree | a90e2a87e7d7c3a6d1d6f8a9540ce906b284003a /drivers/usb/cdns3/ep0.c | |
parent | 5f318dad72d227438f4da4c57afb2dfbd9dacddb (diff) |
usb: cdns3: Fix sheduling with locks held.
Patch fix issue in cdns3_ep0_feature_handle_device function.
The function usleep_range can't be used there because this function is
called with locks held and IRQs disabled in
cdns3_device_thread_irq_handler().
To resolve this issue patch replaces usleep_range with mdelay.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/1569484721-4424-1-git-send-email-pawell@cadence.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/cdns3/ep0.c')
-rw-r--r-- | drivers/usb/cdns3/ep0.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c index 44f652e8b5a2..0445da0a5a0c 100644 --- a/drivers/usb/cdns3/ep0.c +++ b/drivers/usb/cdns3/ep0.c | |||
@@ -332,7 +332,7 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev, | |||
332 | * for sending status stage. | 332 | * for sending status stage. |
333 | * This time should be less then 3ms. | 333 | * This time should be less then 3ms. |
334 | */ | 334 | */ |
335 | usleep_range(1000, 2000); | 335 | mdelay(1); |
336 | cdns3_set_register_bit(&priv_dev->regs->usb_cmd, | 336 | cdns3_set_register_bit(&priv_dev->regs->usb_cmd, |
337 | USB_CMD_STMODE | | 337 | USB_CMD_STMODE | |
338 | USB_STS_TMODE_SEL(tmode - 1)); | 338 | USB_STS_TMODE_SEL(tmode - 1)); |