ChangeSet 1.1318.4.9, 2003/06/17 10:56:44-07:00, david-b@pacbell.net [PATCH] USB: ehci-hcd micro-patch This is a handful of one-liners, significantly: - don't disable "park" feature (faster). - cut'n'paste should have morphed "||" to "&&" - initialize qh as "live" (as now expected) The "&&" was the most troublesome bug. It could make all kinds of things misbehave, not just those vt6202 issues some folks report. The interesting bit about the "park" feature (NForce2 has it, maybe a few others) is that it made one disk run 18% faster (according to hdparm). drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci-q.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c --- a/drivers/usb/host/ehci-hcd.c Wed Jun 18 11:14:58 2003 +++ b/drivers/usb/host/ehci-hcd.c Wed Jun 18 11:14:58 2003 @@ -431,7 +431,7 @@ pci_set_mwi (ehci->hcd.pdev); /* clear interrupt enables, set irq latency */ - temp = readl (&ehci->regs->command) & 0xff; + temp = readl (&ehci->regs->command) & 0x0fff; if (log2_irq_thresh < 0 || log2_irq_thresh > 6) log2_irq_thresh = 0; temp |= 1 << (16 + log2_irq_thresh); diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c --- a/drivers/usb/host/ehci-q.c Wed Jun 18 11:14:58 2003 +++ b/drivers/usb/host/ehci-q.c Wed Jun 18 11:14:58 2003 @@ -293,7 +293,7 @@ /* stop scanning when we reach qtds the hc is using */ } else if (likely (!stopped - || HCD_IS_RUNNING (ehci->hcd.state))) { + && HCD_IS_RUNNING (ehci->hcd.state))) { break; } else { @@ -690,12 +690,11 @@ /* NOTE: if (PIPE_INTERRUPT) { scheduler sets s-mask } */ - /* init as halted, toggle clear, advance to dummy */ + /* init as live, toggle clear, advance to dummy */ qh->qh_state = QH_STATE_IDLE; qh->hw_info1 = cpu_to_le32 (info1); qh->hw_info2 = cpu_to_le32 (info2); qh_update (ehci, qh, qh->dummy); - qh->hw_token = cpu_to_le32 (QTD_STS_HALT); usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1); return qh; }