Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2009 18:38:26 +0100
From:      "lementec fabien" <fabien.lementec@gmail.com>
To:        freebsd-usb@freebsd.org
Subject:   [ prevent ehci_takecontroller from looping at infinite ]
Message-ID:  <e6d291490901120938ya302a34ue68bf381069ed220@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

Hi,

On an Acer Aspire 5500, freebsd is hanging in
usb/ehci_pci in the ehci_takecontroller function.
The device pci conf space reads invalid values
0xffffffff, making the function looping at infinite,
thus never entering ehci_init.

I dont know if the problem does not come from
earlier, but I did the following patch:

--- orig/sys/dev/usb/ehci_pci.c	2009-01-11 06:14:12.000000000 +0100
+++ new/sys/dev/usb/ehci_pci.c	2009-01-11 06:15:14.000000000 +0100
@@ -549,6 +549,10 @@

 	cparams = EREAD4(sc, EHCI_HCCPARAMS);

+	/* prevent from looping ad infinite. ehci_init will fail. */
+	if (cparams == 0xffffffff)
+	  return ;
+
 	/* Synchronise with the BIOS if it owns the controller. */
 	for (eecp = EHCI_HCC_EECP(cparams); eecp != 0;
 	    eecp = EHCI_EECP_NEXT(eec)) {
@@ -584,6 +588,9 @@
 	int eecp;

 	cparams = EREAD4(sc, EHCI_HCCPARAMS);
+	if (cparams == 0xffffffff)
+	  return ;
+
 	for (eecp = EHCI_HCC_EECP(cparams); eecp >= 0x40;
 	    eecp = EHCI_EECP_NEXT(eec)) {
 		eec = pci_read_config(self, eecp, 4);

I hop it helps,

Fabien.


-- 
"What I cannot create I dont understand"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e6d291490901120938ya302a34ue68bf381069ed220>