linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Minas Harutyunyan <hminas@synopsys.com>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH] usb: dwc2: Revert "usb: dwc2: Disable all EP's on disconnect"
Date: Thu, 6 Dec 2018 16:07:14 +0100	[thread overview]
Message-ID: <5abb1e89-bf49-6c08-742a-a782111b41dc@samsung.com> (raw)
In-Reply-To: <20181206145218.GQ3073@unbuntlaptop>

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


      reply	other threads:[~2018-12-06 15:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181121154518eucas1p2cc7ffd4d071ff420c747e1d0c387ee5d@eucas1p2.samsung.com>
2018-11-21 15:45 ` [PATCH] usb: dwc2: Revert "usb: dwc2: Disable all EP's on disconnect" Marek Szyprowski
2018-11-22  6:53   ` Minas Harutyunyan
2018-11-23  9:49     ` Marek Szyprowski
2018-11-23 14:43     ` Dan Carpenter
2018-12-04 12:34       ` Minas Harutyunyan
2018-12-04 13:29         ` Dan Carpenter
2018-12-05 12:52           ` Minas Harutyunyan
2018-12-07 10:15             ` Dan Carpenter
2018-12-07 11:20               ` Minas Harutyunyan
2018-12-07 14:13                 ` Minas Harutyunyan
2018-12-07 14:40                   ` Dan Carpenter
2018-12-06 15:03         ` Marek Szyprowski
2018-12-07  9:06           ` Minas Harutyunyan
2018-12-07  9:50             ` Felipe Balbi
2018-12-07  9:58             ` Minas Harutyunyan
2018-12-07 10:11               ` Felipe Balbi
2018-12-06 23:09         ` Maynard CABIENTE
2018-12-07  9:06           ` Minas Harutyunyan
2018-12-06 14:52   ` Dan Carpenter
2018-12-06 15:07     ` Marek Szyprowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5abb1e89-bf49-6c08-742a-a782111b41dc@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hminas@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).