Linux USB
 help / color / mirror / Atom feed
* [PATCH -next] usb: cdns3: Fix sheduling with locks held.
@ 2019-09-26  6:19 Pawel Laszczak
  2019-09-26  6:33 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Pawel Laszczak @ 2019-09-26  6:19 UTC (permalink / raw)
  To: gregkh, linux-usb, felipe.balbi; +Cc: dan.carpenter, Pawel Laszczak

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(-)

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));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] usb: cdns3: Fix sheduling with locks held.
  2019-09-26  6:19 Pawel Laszczak
@ 2019-09-26  6:33 ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2019-09-26  6:33 UTC (permalink / raw)
  To: Pawel Laszczak; +Cc: linux-usb, felipe.balbi, dan.carpenter

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH -next] usb: cdns3: Fix sheduling with locks held.
@ 2019-09-26  7:00 Pawel Laszczak
  2019-09-26  7:23 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Pawel Laszczak @ 2019-09-26  7:00 UTC (permalink / raw)
  To: gregkh, linux-usb, felipe.balbi; +Cc: dan.carpenter, Pawel Laszczak

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")
---
 drivers/usb/cdns3/ep0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
--
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] usb: cdns3: Fix sheduling with locks held.
  2019-09-26  7:00 [PATCH -next] usb: cdns3: Fix sheduling with locks held Pawel Laszczak
@ 2019-09-26  7:23 ` Greg KH
  2019-09-26  7:28   ` Pawel Laszczak
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-09-26  7:23 UTC (permalink / raw)
  To: Pawel Laszczak; +Cc: linux-usb, felipe.balbi, dan.carpenter

On Thu, Sep 26, 2019 at 08:00:30AM +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.
> 
> 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")
> ---
>  drivers/usb/cdns3/ep0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Is this v2 of the patch?

If so, it needs to be said so in the subject line, and below the ---
line describe what changed from the previous one.

That should all be described in the kernel documentation, right?

v3 please?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH -next] usb: cdns3: Fix sheduling with locks held.
  2019-09-26  7:23 ` Greg KH
@ 2019-09-26  7:28   ` Pawel Laszczak
  0 siblings, 0 replies; 5+ messages in thread
From: Pawel Laszczak @ 2019-09-26  7:28 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-usb@vger.kernel.org, felipe.balbi@linux.intel.com,
	dan.carpenter@oracle.com

Hi, 
>
>
>On Thu, Sep 26, 2019 at 08:00:30AM +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.
>>
>> 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")
>> ---
>>  drivers/usb/cdns3/ep0.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>Is this v2 of the patch?

Really. It's the same patch as  previous one. I added only 
Reported-by and Fixes. 

Ok I will prepare the next one :(. 

>If so, it needs to be said so in the subject line, and below the ---
>line describe what changed from the previous one.
>
>That should all be described in the kernel documentation, right?
>
>v3 please?
>
>thanks,
>
>greg k-h

Thenks,
Pawell

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-26  7:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-26  7:00 [PATCH -next] usb: cdns3: Fix sheduling with locks held Pawel Laszczak
2019-09-26  7:23 ` Greg KH
2019-09-26  7:28   ` Pawel Laszczak
  -- strict thread matches above, loose matches on Subject: below --
2019-09-26  6:19 Pawel Laszczak
2019-09-26  6:33 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox