stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>,
	Jim Dickerson <jim.dickerson@hpe.com>, <stable@vger.kernel.org>,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 3/8] usb: pci-quirks.c: Corrected timeout values used in handshake
Date: Mon, 18 Sep 2017 17:39:14 +0300	[thread overview]
Message-ID: <1505745559-749-4-git-send-email-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <1505745559-749-1-git-send-email-mathias.nyman@linux.intel.com>

From: Jim Dickerson <jim.dickerson@hpe.com>

Servers were emitting failed handoff messages but were not
waiting the full 1 second as designated in section 4.22.1 of
the eXtensible Host Controller Interface specifications. The
handshake was using wrong units so calls were made with milliseconds
not microseconds. Comments referenced 5 seconds not 1 second as
in specs.

The wrong units were also corrected in a second handshake call.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jim Dickerson <jim.dickerson@hpe.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/pci-quirks.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 658d9d1..e02dbb1 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1022,7 +1022,7 @@ void usb_disable_xhci_ports(struct pci_dev *xhci_pdev)
  *
  * Takes care of the handoff between the Pre-OS (i.e. BIOS) and the OS.
  * It signals to the BIOS that the OS wants control of the host controller,
- * and then waits 5 seconds for the BIOS to hand over control.
+ * and then waits 1 second for the BIOS to hand over control.
  * If we timeout, assume the BIOS is broken and take control anyway.
  */
 static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
@@ -1069,9 +1069,9 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 	if (val & XHCI_HC_BIOS_OWNED) {
 		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
 
-		/* Wait for 5 seconds with 10 microsecond polling interval */
+		/* Wait for 1 second with 10 microsecond polling interval */
 		timeout = handshake(base + ext_cap_offset, XHCI_HC_BIOS_OWNED,
-				0, 5000, 10);
+				0, 1000000, 10);
 
 		/* Assume a buggy BIOS and take HC ownership anyway */
 		if (timeout) {
@@ -1100,7 +1100,7 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 	 * operational or runtime registers.  Wait 5 seconds and no more.
 	 */
 	timeout = handshake(op_reg_base + XHCI_STS_OFFSET, XHCI_STS_CNR, 0,
-			5000, 10);
+			5000000, 10);
 	/* Assume a buggy HC and start HC initialization anyway */
 	if (timeout) {
 		val = readl(op_reg_base + XHCI_STS_OFFSET);
-- 
1.9.1

  parent reply	other threads:[~2017-09-18 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1505745559-749-1-git-send-email-mathias.nyman@linux.intel.com>
2017-09-18 14:39 ` [PATCH 1/8] usb: xhci: Free the right ring in xhci_add_endpoint() Mathias Nyman
2017-09-18 14:39 ` [PATCH 2/8] xhci: fix finding correct bus_state structure for USB 3.1 hosts Mathias Nyman
2017-09-18 14:39 ` Mathias Nyman [this message]
2017-09-18 14:39 ` [PATCH 4/8] xhci: fix wrong endpoint ESIT value shown in tracing Mathias Nyman
2017-09-18 14:39 ` [PATCH 5/8] usb: host: xhci-plat: allow sysdev to inherit from ACPI Mathias Nyman
2017-09-18 14:39 ` [PATCH 6/8] xhci: Fix sleeping with spin_lock_irq() held in ASmedia 1042A workaround Mathias Nyman
2017-09-18 14:39 ` [PATCH 7/8] xhci: set missing SuperSpeedPlus Link Protocol bit in roothub descriptor Mathias Nyman
2017-09-18 18:38   ` Sergei Shtylyov
2017-09-18 14:39 ` [PATCH 8/8] Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts" 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=1505745559-749-4-git-send-email-mathias.nyman@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jim.dickerson@hpe.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@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).