lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] usb: dwc2: Revert "usb: dwc2: Disable all EP's on disconnect"
From
Date
Hi Dan,

On 2018-12-06 15:52, Dan Carpenter wrote:
> Hi Marek,
>
> I'm surprised you don't get deadlocks when you apply this patch.

Why should I get it? It is just a revert to the state before applying
the mentioned incorrect patch.

> On Wed, Nov 21, 2018 at 04:45:04PM +0100, Marek Szyprowski wrote:
>
>> @@ -4020,9 +4008,7 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
>>
>> epctrl_reg = dir_in ? DIEPCTL(index) : DOEPCTL(index);
>>
>> - locked = spin_is_locked(&hsotg->lock);
>> - if (!locked)
>> - spin_lock_irqsave(&hsotg->lock, flags);
>> + spin_lock_irqsave(&hsotg->lock, flags);
>>
> One of the callers is already holding the hsotg->log. The
> spin_is_locked() test would avoid the deadlock.

Before that broken patch, there was no call to any function which takes
spinlock again, so no deadlock.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

\
 
 \ /
  Last update: 2018-12-06 16:08    [W:0.112 / U:9.568 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site