From: Roger Quadros <rogerq@ti.com>
To: <mathias.nyman@intel.com>
Cc: <balbi@ti.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Roger Quadros <rogerq@ti.com>
Subject: [PATCH 4/5] usb: xhci: stop everything on the first call to xhci_stop
Date: Tue, 18 Aug 2015 13:39:13 +0300 [thread overview]
Message-ID: <1439894354-6160-5-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1439894354-6160-1-git-send-email-rogerq@ti.com>
xhci_stop will be called twice, once for the shared hcd
and again for the primary hcd.
We stop the XHCI controller in any case so clean up
everything on the first call else we can timeout
waiting for pending requests to complete.
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
drivers/usb/host/xhci.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index d5f44b1..9a7f12c 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -655,15 +655,6 @@ int xhci_run(struct usb_hcd *hcd)
}
EXPORT_SYMBOL_GPL(xhci_run);
-static void xhci_only_stop_hcd(struct usb_hcd *hcd)
-{
- struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-
- spin_lock_irq(&xhci->lock);
- xhci_halt(xhci);
- spin_unlock_irq(&xhci->lock);
-}
-
/*
* Stop xHCI driver.
*
@@ -678,15 +669,14 @@ void xhci_stop(struct usb_hcd *hcd)
u32 temp;
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
- mutex_lock(&xhci->mutex);
-
- if (!usb_hcd_is_primary_hcd(hcd)) {
- xhci_only_stop_hcd(xhci->shared_hcd);
- mutex_unlock(&xhci->mutex);
+ if (xhci->xhc_state & XHCI_STATE_HALTED)
return;
- }
+ mutex_lock(&xhci->mutex);
spin_lock_irq(&xhci->lock);
+ xhci->xhc_state |= XHCI_STATE_HALTED;
+ xhci->cmd_ring_state = CMD_RING_STATE_STOPPED;
+
/* Make sure the xHC is halted for a USB3 roothub
* (xhci_stop() could be called as part of failed init).
*/
--
2.1.4
next prev parent reply other threads:[~2015-08-18 10:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-18 10:39 [PATCH 0/5] usb: xhci: Fix breakage on dual-role case Roger Quadros
2015-08-18 10:39 ` [PATCH 1/5] usb: xhci: lock mutex on xhci_stop Roger Quadros
2015-08-18 11:39 ` Mathias Nyman
2015-08-18 10:39 ` [PATCH 2/5] usb: hcd: Initialize hcd->flags to 0 Roger Quadros
2015-08-18 10:39 ` [PATCH 3/5] usb: xhci: Clear XHCI_STATE_DYING on start Roger Quadros
2015-08-18 11:43 ` Mathias Nyman
2015-08-18 10:39 ` Roger Quadros [this message]
2015-08-18 12:14 ` [PATCH 4/5] usb: xhci: stop everything on the first call to xhci_stop Mathias Nyman
2015-08-20 6:42 ` Roger Quadros
2015-08-18 10:39 ` [PATCH 5/5] usb: xhci: exit early in xhci_setup_device() if we're halted or dying Roger Quadros
2015-08-18 12:17 ` Mathias Nyman
2015-08-20 7:09 ` [PATCH 0/5] usb: xhci: Fix breakage on dual-role case Roger Quadros
2015-08-27 11:18 ` Mathias Nyman
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=1439894354-6160-5-git-send-email-rogerq@ti.com \
--to=rogerq@ti.com \
--cc=balbi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.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
Powered by JetHome