Re: [PATCH] ehci: Param to skip BIOS handoff negotiation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/09/2011 09:24 AM, Greg KH wrote:
> At worse
> case, could we trigger off of known DMI strings for the broken machines?

This works.  Does it look like something you would take?

It's probably best to wait a day though: I'm waiting for feedback from WeTab users (same hardware, slightly different
BIOS) to see if they're affected and what their DMI values are.

Andy

>From 2bad65bc37d4a027ba1df961926dfb09e465f0b5 Mon Sep 17 00:00:00 2001
From: Andy Ross <andy.ross@xxxxxxxxxxxxx>
Date: Mon, 9 May 2011 11:39:17 -0700
Subject: [PATCH] ehci: Fix boot hang in BIOS handoff on ExoPC

The Pegatron Lucid tablets sporadically hang for 90+ seconds on boot
trying to do the EHCI BIOS handoff.  Skip negotiation for those
devices and force the handoff.

Signed-off-by: Andy Ross <andy.ross@xxxxxxxxxxxxx>
---
 drivers/usb/host/pci-quirks.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 4c502c8..d7ada08 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/acpi.h>
+#include <linux/dmi.h>
 #include "pci-quirks.h"
 #include "xhci-ext-caps.h"

@@ -222,6 +223,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
 	u8	offset, cap_length;
 	int	count = 256/4;
 	int	tried_handoff = 0;
+	int     force_handoff = 0;

 	if (!mmio_resource_enabled(pdev, 0))
 		return;
@@ -233,6 +235,12 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
 	cap_length = readb(base);
 	op_reg_base = base + cap_length;

+	/* The Pegatron Lucid (ExoPC) tablet sporadically waits for 90
+	 * seconds trying the handoff.  Skip it. */
+	if (!strcmp(dmi_get_system_info(DMI_BOARD_NAME), "EXOPG06411") &&
+	    !strcmp(dmi_get_system_info(DMI_BIOS_VERSION), "Lucid-CE-133"))
+		force_handoff = 1;
+
 	/* EHCI 0.96 and later may have "extended capabilities"
 	 * spec section 5.1 explains the bios handoff, e.g. for
 	 * booting from USB disk or using a usb keyboard
@@ -270,14 +278,17 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
 				 * set for any other reason than forcing a BIOS
 				 * handoff..
 				 */
-				pci_write_config_byte(pdev, offset + 3, 1);
+				if (!force_handoff)
+					pci_write_config_byte(pdev,
+							      offset + 3, 1);
 			}

 			/* if boot firmware now owns EHCI, spin till
 			 * it hands it over.
 			 */
 			msec = 1000;
-			while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) {
+			while (!force_handoff &&
+			       (cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) {
 				tried_handoff = 1;
 				msleep(10);
 				msec -= 10;
@@ -288,8 +299,10 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
 				/* well, possibly buggy BIOS... try to shut
 				 * it down, and hope nothing goes too wrong
 				 */
-				dev_warn(&pdev->dev, "EHCI: BIOS handoff failed"
-						" (BIOS bug?) %08x\n", cap);
+				if (!force_handoff)
+					dev_warn(&pdev->dev,
+						 "EHCI: BIOS handoff failed"
+						 " (BIOS bug?) %08x\n", cap);
 				pci_write_config_byte(pdev, offset + 2, 0);
 			}

-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux