public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Thinh.Nguyen@synopsys.com
Cc: gregkh@linuxfoundation.org, r-gunasekaran@ti.com, srk@ti.com,
	wcheng@codeaurora.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Roger Quadros <rogerq@kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH v2 1/2] usb: dwc3: gadget: Avoid controller stop in .suspend if !softconnect
Date: Tue,  2 May 2023 19:21:32 +0300	[thread overview]
Message-ID: <20230502162133.148821-2-rogerq@kernel.org> (raw)
In-Reply-To: <20230502162133.148821-1-rogerq@kernel.org>

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


  reply	other threads:[~2023-05-02 16:21 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 ` Roger Quadros [this message]
2023-05-02 21:17   ` [PATCH v2 1/2] usb: dwc3: gadget: Avoid controller stop in .suspend if !softconnect Thinh Nguyen
2023-05-03  9:28     ` Roger Quadros
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=20230502162133.148821-2-rogerq@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