diff mbox series

[-next] usb: cdns3: Fix sheduling with locks held.

Message ID 1569478767-19889-1-git-send-email-pawell@cadence.com (mailing list archive)
State Superseded
Headers show
Series [-next] usb: cdns3: Fix sheduling with locks held. | expand

Commit Message

Pawel Laszczak Sept. 26, 2019, 6:19 a.m. UTC
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.

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
---
 drivers/usb/cdns3/ep0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg KH Sept. 26, 2019, 6:33 a.m. UTC | #1
On Thu, Sep 26, 2019 at 07:19:27AM +0100, Pawel Laszczak wrote:
> 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.
> 
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>

What commit does this fix?  Did someone report it?  If so, please
properly credit them here.

thanks,

greg k-h
diff mbox series

Patch

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,
 			 * for sending status stage.
 			 * This time should be less then 3ms.
 			 */
-			usleep_range(1000, 2000);
+			mdelay(1);
 			cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
 					       USB_CMD_STMODE |
 					       USB_STS_TMODE_SEL(tmode - 1));