linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linux-usb@vger.kernel.org
Cc: balbi@kernel.org, "Alan Stern" <stern@rowland.harvard.edu>,
	"EJ Hsu" <ejh@nvidia.com>,
	"Thinh Nguyen" <Thinh.Nguyen@synopsys.com>,
	"WK Tsai" <wtsai@nvidia.com>,
	"Michał Nazarewicz" <mina86@mina86.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>
Subject: [PATCH v2 1/2] usb: gadget: composite: Clear "suspended" on reset/disconnect
Date: Sat,  6 Jul 2019 10:41:34 +1000	[thread overview]
Message-ID: <20190706004135.14955-1-benh@kernel.crashing.org> (raw)

In some cases, one can get out of suspend with a reset or
a disconnect followed by a reconnect. Previously we would
leave a stale suspended flag set.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/usb/gadget/composite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index b8a15840b4ff..dfcabadeed01 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1976,6 +1976,7 @@ void composite_disconnect(struct usb_gadget *gadget)
 	 * disconnect callbacks?
 	 */
 	spin_lock_irqsave(&cdev->lock, flags);
+	cdev->suspended = 0;
 	if (cdev->config)
 		reset_config(cdev);
 	if (cdev->driver->disconnect)
-- 
2.17.1


             reply	other threads:[~2019-07-06  0:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06  0:41 Benjamin Herrenschmidt [this message]
2019-07-06  0:41 ` [PATCH v2 2/2] usb: gadget: mass_storage: Fix races between fsg_disable and fsg_set_alt Benjamin Herrenschmidt

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=20190706004135.14955-1-benh@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=ejh@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mina86@mina86.com \
    --cc=stern@rowland.harvard.edu \
    --cc=wtsai@nvidia.com \
    /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).