From: Greg KH To: torvalds@transmeta.com Cc: linux-usb-devel@lists.sourceforge.net Subject: [PATCH 02 of 11] USB ehci driver update Hi, Here's a patch against 2.5.3-pre1 that provides the following changes to the ehci driver: - fixes the root hub handoff of slow devices to companion controllers. - cleaned up control/bulk queuing The patch was written by David Brownell. thanks, greg k-h diff -Nru a/drivers/usb/hcd/ehci-hcd.c b/drivers/usb/hcd/ehci-hcd.c --- a/drivers/usb/hcd/ehci-hcd.c Wed Jan 16 09:57:45 2002 +++ b/drivers/usb/hcd/ehci-hcd.c Wed Jan 16 09:57:45 2002 @@ -70,9 +70,15 @@ * Brad Hards * Rory Bolt * ... + * + * HISTORY: + * 2002-01-14 Minor cleanup; version synch. + * 2002-01-08 Fix roothub handoff of FS/LS to companion controllers. + * 2002-01-04 Control/Bulk queuing behaves. + * 2001-12-12 Initial patch version for Linux 2.5.1 kernel. */ -#define DRIVER_VERSION "$Revision: 0.25 $" +#define DRIVER_VERSION "$Revision: 0.26 $" #define DRIVER_AUTHOR "David Brownell" #define DRIVER_DESC "USB 2.0 'Enhanced' Host Controller (EHCI) Driver" @@ -97,9 +103,6 @@ static int log2_irq_thresh = 0; // 0 to 6 MODULE_PARM (log2_irq_thresh, "i"); MODULE_PARM_DESC (log2_irq_thresh, "log2 IRQ latency, 1-64 microframes"); - -/* Some A steppings of the NEC controller need soft retries */ -//#define EHCI_SOFT_RETRIES 5 /* after CERR-induced fault */ #define INTR_MASK (STS_IAA | STS_FATAL | STS_ERR | STS_INT) diff -Nru a/drivers/usb/hcd/ehci-hub.c b/drivers/usb/hcd/ehci-hub.c --- a/drivers/usb/hcd/ehci-hub.c Wed Jan 16 09:57:45 2002 +++ b/drivers/usb/hcd/ehci-hub.c Wed Jan 16 09:57:45 2002 @@ -82,11 +82,12 @@ for (i = 0; i < ports; i++) { temp = readl (&ehci->regs->port_status [i]); if (temp & PORT_OWNER) { - // get disconnected ports back if no companion driver - if (temp & PORT_CONNECT) - continue; - temp &= ~(PORT_OWNER|PORT_CSC); - writel (temp, &ehci->regs->port_status [i]); + /* don't report this in GetPortStatus */ + if (temp & PORT_CSC) { + temp &= ~PORT_CSC; + writel (temp, &ehci->regs->port_status [i]); + } + continue; } if (!(temp & PORT_CONNECT)) ehci->reset_done [i] = 0; diff -Nru a/drivers/usb/hcd/ehci-q.c b/drivers/usb/hcd/ehci-q.c --- a/drivers/usb/hcd/ehci-q.c Wed Jan 16 09:57:46 2002 +++ b/drivers/usb/hcd/ehci-q.c Wed Jan 16 09:57:46 2002 @@ -883,11 +883,10 @@ /* can't get here without STS_ASS set */ if (ehci->hcd.state != USB_STATE_HALT) { if (cmd & CMD_PSE) - writel (cmd & __constant_cpu_to_le32 (~CMD_ASE), - &ehci->regs->command); + writel (cmd & ~CMD_ASE, &ehci->regs->command); else { ehci_ready (ehci); - while (!(readl (&ehci->regs->status) & STS_ASS)) + while (readl (&ehci->regs->status) & STS_ASS) udelay (100); } } diff -Nru a/drivers/usb/hcd/ehci-sched.c b/drivers/usb/hcd/ehci-sched.c --- a/drivers/usb/hcd/ehci-sched.c Wed Jan 16 09:57:47 2002 +++ b/drivers/usb/hcd/ehci-sched.c Wed Jan 16 09:57:47 2002 @@ -381,7 +381,7 @@ vdbg ("qh %p usecs %d period %d starting frame %d.%d", qh, qh->usecs, period, frame, uframe); do { - if (unlikely ((long)ehci->pshadow [frame].ptr)) { + if (unlikely (ehci->pshadow [frame].ptr != 0)) { // FIXME -- just link to the end, before any qh with a shorter period, // AND handle it already being (implicitly) linked into this frame BUG ();