public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"r-gunasekaran@ti.com" <r-gunasekaran@ti.com>,
	"srk@ti.com" <srk@ti.com>,
	"wcheng@codeaurora.org" <wcheng@codeaurora.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] usb: dwc3: gadget: Avoid controller stop in .suspend if !softconnect
Date: Wed, 3 May 2023 12:28:35 +0300	[thread overview]
Message-ID: <0cf14563-d536-c384-e8e0-2e3fe2e9e877@kernel.org> (raw)
In-Reply-To: <20230502211749.jbo45lgccs346mjf@synopsys.com>



On 03/05/2023 00:17, Thinh Nguyen wrote:
> On Tue, May 02, 2023, Roger Quadros wrote:
>> If softconnect is not set it means the controller has not started,
>> so no point in stopping it in dwc3_gadget_suspend()
>>
>> Cc: stable@vger.kernel.org # 5.16
>> Fixes: 8217f07a5023 ("usb: dwc3: gadget: Avoid starting DWC3 gadget during UDC unbind")
> 
> If the reason for this patch is as mentioned in the commit message, then
> I don't think this is a fix patch that needs to be backported to stable.
> The reason why we needed to check both dwc->gadget_driver and
> dwc->softconnect is because of a potential race between resume and
> unbind. Would there be a similar case in dwc_gadget_suspend where a
> potential race may occur? If not, I don't think we need this patch.

OK. I agree.

> 
> Thanks,
> Thinh
> 
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>> ---
>>  drivers/usb/dwc3/gadget.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> index c0ca4d12f95d..b5170374cd18 100644
>> --- a/drivers/usb/dwc3/gadget.c
>> +++ b/drivers/usb/dwc3/gadget.c
>> @@ -4656,7 +4656,7 @@ int dwc3_gadget_suspend(struct dwc3 *dwc)
>>  {
>>  	unsigned long flags;
>>  
>> -	if (!dwc->gadget_driver)
>> +	if (!dwc->gadget_driver || !dwc->softconnect)
>>  		return 0;
>>  
>>  	dwc3_gadget_run_stop(dwc, false);
>> -- 
>> 2.34.1

cheers,
-roger

  reply	other threads:[~2023-05-03  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 16:21 [PATCH v2 0/2] usb: dwc3: gadget: Improve dwc3_gadget_suspend/resume Roger Quadros
2023-05-02 16:21 ` [PATCH v2 1/2] usb: dwc3: gadget: Avoid controller stop in .suspend if !softconnect Roger Quadros
2023-05-02 21:17   ` Thinh Nguyen
2023-05-03  9:28     ` Roger Quadros [this message]
2023-05-02 16:21 ` [PATCH v2 2/2] usb: dwc3: gadget: Improve dwc3_gadget_suspend() and dwc3_gadget_resume() Roger Quadros
2023-05-02 21:18   ` Thinh Nguyen
2023-05-03  9:30     ` Roger Quadros

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=0cf14563-d536-c384-e8e0-2e3fe2e9e877@kernel.org \
    --to=rogerq@kernel.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=r-gunasekaran@ti.com \
    --cc=srk@ti.com \
    --cc=stable@vger.kernel.org \
    --cc=wcheng@codeaurora.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