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

Bug#316848: kernel-source-2.6.8: "BIOS handoff failed" error loading ehci_hcd module on Asus P4P800 mainboard



On Mon, Jul 04, 2005 at 10:55:28AM +0200, Fabio Muzzi wrote:
> Package: kernel-source-2.6.8
> Version: 2.6.8-16
> Severity: normal
> 
> 
> I have compiled my  kernel from the Debian sources (2.6.8-16) and I havo
> found that on an Asus P4P800 mainboard (that worked with 2.4.26) when I
> do "modprobe usb-ehci" I get the following error in syslog:
> 
> casa kernel: ACPI: PCI interrupt 0000:00:1d.7[D] -> GSI 23 (level, low) -> IRQ 23
> casa kernel: ehci_hcd 0000:00:1d.7: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller
> casa kernel: ehci_hcd 0000:00:1d.7: BIOS handoff failed (104, 1010001)
> casa kernel: ehci_hcd 0000:00:1d.7: can't reset
> casa kernel: ehci_hcd 0000:00:1d.7: init 0000:00:1d.7 fail, -95
> casa kernel: ehci_hcd: probe of 0000:00:1d.7 failed with error -95
> 
> The module gets loaded but usb2 peripherals fail to work completely.
> 
> I have googled for some more info, and found that this is a known issue
> with kernel 2.6.8 and some BIOSes. 
> 
> Here is a link to a discussion about it:
> 
> http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/1336.html

Interesting, It seems like a fairly open problem.
I have rummaged around, and pulled two patches from upstream that
seem relevant. They are attached, if you feel so inclined,
please test them. They seem harmless enough but its obviously 
a touchy area of code, so I want to tread carfully before
making an update here.

The first patch is pretty old, and looke like it went into the tree
not to long after 2.6.8.1 was released last year. It is verbatim
from upstream. The second patch is much newer, I think it was applied
about a week ago and I don't think it was included in 2.6.12 (or
2.6.12.1 or 2.6.12.2). I had to do a bit of redifing of that patch,
and I also discarded the portions that did not seem to relate to
handoff. 

-- 
Horms
commit 794f5bfa77955c4455f6d72d8b0e2bee25f1ff0c
tree 7a9ea02e064ed7089e3a8666161aca060359c971
parent caf2857ac6e0ba2651e722f05d5f7d3ec8ef2615
author Christoph Hellwig <hch@lst.de> 1119036325 -0700
committer Linus Torvalds <torvalds@ppc970.osdl.org> 1119036860 -0700

[PATCH] PCI: don't override drv->shutdown unconditionally

There are many drivers that have been setting the generic driver
model level shutdown callback, and pci thus must not override it.

Without this patch we can have really bad data loss on various
raid controllers.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

I:100644 100644 fe98553c978f335dae47646cee5df32c8f69b42e f315df2005bca0ca85e4c2bfaa531641ba983933 M	drivers/pci/pci-driver.c

Key:
S: Skipped
I: Included Included verbatim
D: Deleted  Manually deleted by subsequent user edit
R: Revised  Manually revised by subsequent user edit

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -393,7 +393,10 @@ int pci_register_driver(struct pci_drive
 	drv->driver.bus = &pci_bus_type;
 	drv->driver.probe = pci_device_probe;
 	drv->driver.remove = pci_device_remove;
-	drv->driver.shutdown = pci_device_shutdown,
+	/* FIXME, once all of the existing PCI drivers have been fixed to set
+	 * the pci shutdown function, this test can go away. */
+	if (!drv->driver.shutdown)
+		drv->driver.shutdown = pci_device_shutdown,
 	drv->driver.owner = drv->owner;
 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
 	pci_init_dynids(&drv->dynids);
commit d49d431744007cec0ee1a3ade96f9e0f100c7907
tree 4ed2f01c98b8fdf0ecd7a92d61f7c1af8beb58a2
parent 9198769363d4dc1d63d49ecb2e2b189aceb42d94
author David Brownell <david-b@pacbell.net> 1115497310 -0700
committer Greg Kroah-Hartman <gregkh@suse.de> 1119908635 -0700

[PATCH] USB: misc ehci updates

Various minor EHCI updates

   * Dump some more info in the debug dumps, notably the product
     description (e.g. chip vendor), BIOS handhake flags, and
     debug port status (when it's not managed by the HCD).

   * Minor updates to the BIOS handoff code:  always flag the HCD
     as owned by Linux (in case BIOS doesn't grab it "early"),
     and on the buggy-BIOS path always match the "early handoff"
     code and forcibly disable SMI IRQs.

   * For the disabled 64bit DMA support, there's now a constant
     to use for the mask; use it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

D:100644 100644 2ff11d53567bcbfd0fdaf48de5dfc545d6d93eab 50cb01831075916c5f8e828f5e15f1ddd0df91df M	drivers/usb/host/ehci-dbg.c
R:100644 100644 527abc693b17841ade6acdf2a673ab5fc5b260e7 35248a37b7174ad807110fa74eef1382fe4c4f80 M	drivers/usb/host/ehci-hcd.c
D:100644 100644 d7b4f7939ded4d16989478ca58fa3edc573fb728 36cc1f2218d55d203434aafb0698773291b48e4b M	drivers/usb/host/ehci-hub.c
D:100644 100644 7df9b9af54f60205b09a6e490db182c33ef922ec 45d89a7083b13f4bfd30b319f438c2b996948260 M	drivers/usb/host/ehci-q.c

Key:
S: Skipped
I: Included Included verbatim
D: Deleted  Manually deleted by subsequent user edit
R: Revised  Manually revised by subsequent user edit

Only include bios_handoff change and rediff for 2.6.8 - Horms

--- a/drivers/usb/host/ehci-hcd.c	2005-07-04 20:49:26.000000000 +0900
+++ b/drivers/usb/host/ehci-hcd.c	2005-07-04 20:52:40.000000000 +0900
@@ -288,30 +288,32 @@
  */
 static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
 {
-	if (cap & (1 << 16)) {
-		int msec = 5000;
-		struct pci_dev *pdev = to_pci_dev(ehci->hcd.self.controller);
+struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
+	struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
 
-		/* request handoff to OS */
-		cap |= 1 << 24;
-		pci_write_config_dword(pdev, where, cap);
+	/* always say Linux will own the hardware */
+	pci_write_config_byte(pdev, where + 3, 1);
 
-		/* and wait a while for it to happen */
+	/* maybe wait a while for BIOS to respond */
+	if (cap & (1 << 16)) {
 		do {
 			msleep(10);
 			msec -= 10;
 			pci_read_config_dword(pdev, where, &cap);
 		} while ((cap & (1 << 16)) && msec);
 		if (cap & (1 << 16)) {
-			ehci_err (ehci, "BIOS handoff failed (%d, %04x)\n",
+			ehci_err(ehci, "BIOS handoff failed (%d, %04x)\n",
 				where, cap);
 			// some BIOS versions seem buggy...
 			// return 1;
 			ehci_warn (ehci, "continuing after BIOS bug...\n");
-			return 0;
-		} 
-		ehci_dbg (ehci, "BIOS handoff succeeded\n");
+			/* disable all SMIs, and clear "BIOS owns" flag */
+			pci_write_config_dword(pdev, where + 4, 0);
+			pci_write_config_byte(pdev, where + 2, 0);
+		} else
+			ehci_dbg(ehci, "BIOS handoff succeeded\n");
 	}
+
 	return 0;
 }
 

Reply to: