From ed3b31fc67770406d9a76f80c2c4dcd161df9c4f Mon Sep 17 00:00:00 2001 From: Ariff Abdullah Date: Mon, 16 Jan 2006 19:23:59 +0000 Subject: [PATCH] ehci_pci.c: ATI EHCI controllers exhibit simmilar stall issues and require this dropped interrupts workaround. Be verbose about it. ehci.c: ehcivar.h: Slight change in comments to note about issues surrounding both VIA and ATI EHCI controllers. Approved by: iedowse --- sys/dev/usb/ehci.c | 10 +++++----- sys/dev/usb/ehci_pci.c | 14 +++++++++++++- sys/dev/usb/ehcivar.h | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 5324c5e01422..a66ac97992ab 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -2710,11 +2710,11 @@ ehci_timeout_task(void *addr) } /* - * Some EHCI chips from VIA seem to trigger interrupts before writing back the - * qTD status, or miss signalling occasionally under heavy load. If the host - * machine is too fast, we we can miss transaction completion - when we scan - * the active list the transaction still seems to be active. This generally - * exhibits itself as a umass stall that never recovers. + * Some EHCI chips from VIA / ATI seem to trigger interrupts before writing + * back the qTD status, or miss signalling occasionally under heavy load. + * If the host machine is too fast, we can miss transaction completion - when + * we scan the active list the transaction still seems to be active. This + * generally exhibits itself as a umass stall that never recovers. * * We work around this behaviour by setting up this callback after any softintr * that completes with transactions still pending, giving us another chance to diff --git a/sys/dev/usb/ehci_pci.c b/sys/dev/usb/ehci_pci.c index b03d94cd90e6..204fad084514 100644 --- a/sys/dev/usb/ehci_pci.c +++ b/sys/dev/usb/ehci_pci.c @@ -335,6 +335,9 @@ ehci_pci_attach(device_t self) case PCI_EHCI_VENDORID_APPLE: sprintf(sc->sc_vendor, "Apple"); break; + case PCI_EHCI_VENDORID_ATI: + sprintf(sc->sc_vendor, "ATI"); + break; case PCI_EHCI_VENDORID_CMDTECH: sprintf(sc->sc_vendor, "CMDTECH"); break; @@ -374,8 +377,17 @@ ehci_pci_attach(device_t self) } /* Enable workaround for dropped interrupts as required */ - if (pci_get_vendor(self) == PCI_EHCI_VENDORID_VIA) + switch (pci_get_vendor(self)) { + case PCI_EHCI_VENDORID_ATI: + case PCI_EHCI_VENDORID_VIA: sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG; + if (bootverbose) + device_printf(self, + "Dropped interrupts workaround enabled\n"); + break; + default: + break; + } /* * Find companion controllers. According to the spec they always diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h index e1b852d00344..fb66ae7d5ed3 100644 --- a/sys/dev/usb/ehcivar.h +++ b/sys/dev/usb/ehcivar.h @@ -94,7 +94,7 @@ struct ehci_soft_islot { #define EHCI_COMPANION_MAX 8 #define EHCI_SCFLG_DONEINIT 0x0001 /* ehci_init() has been called. */ -#define EHCI_SCFLG_LOSTINTRBUG 0x0002 /* workaround for VIA chipsets */ +#define EHCI_SCFLG_LOSTINTRBUG 0x0002 /* workaround for VIA / ATI chipsets */ typedef struct ehci_softc { struct usbd_bus sc_bus; /* base device */