On Tuesday 01 Mar 2005 04:05, David Brownell wrote: > On Sunday 27 February 2005 10:58 am, Chris Clayton wrote: > > On Thursday 24 Feb 2005 22:15, David Brownell wrote: > > > > > > If you can find some approach that works reliably, I think the right way > > > to package it would be by defining a new quirk flag and kicking in the > > > logic that's needed on your chip. Then set that flag when the PCI probe > > > detects this particular PCI vendor/product and this revision (or older). > > > > > > That way if someone sticks a "modern" CardBus controller into that laptop, > > > this workaround would only apply to the built-in controller. > > > > > > > OK, here's what I've come up with. ohci-pci.c::ohci_pci_start() is the only > > place I can find where I can get access to both the pci_dev, to get at its > > vendor and device fields, and the usb_device, to get the chipset revision > > from ->descriptor.bcdDevice. Furthermore, ohci_run must have completed > > before ->descriptor.bcdDevice has been loaded with the chipset revision. > > Ignore the bcdDevice, it's not related to the hardware. > > For hardware specifics, you'd use the pci revision ... which > I see in 'lspci', but not obviously in the kernel pci_dev. > Hmm ... probably doesn't matter much, I don't think many people > have boards with "Compaq" OHCI; we asked a few years back and > nobody fessed up to having seen any at all! > OK, I've dropped the revision stuff. > > > I've tried it out on my laptop and I see the "enabled...quirk" message when > > it boots or I bounce the usb drivers, but not when I insert the cardbus USB2 > > adapter (which also has ohci). The usb system on the laptop appears still to > > be fully functional, but I'll give it a bit of stress testing this evening. > I did this, copying a kernel tarball to and from my laptop through the USB wireless adapter and it was flawless. I've done the same with this patch, and as one would expect, things are still working solidly.
> That's as it should be: only for that one PCI device. > Sorry, I wasn't very precise with my wording here - I intended to say that those were the expected results. :-) A new patch (still against 2.6.11-rc4) taking account of your comments follows. I've also amended the existing ohci_info() calls to ohci_dbg(), as recommended. In the hope that we have it nailed this time: Signed-off-by: Chris Clayton <[EMAIL PROTECTED]> diff -ur linux-2.6.11-rc4.orig/drivers/usb/host/ohci-pci.c linux-2.6.11-rc4/drivers/usb/host/ohci-pci.c --- linux-2.6.11-rc4.orig/drivers/usb/host/ohci-pci.c 2005-02-13 03:07:01.000000000 +0000 +++ linux-2.6.11-rc4/drivers/usb/host/ohci-pci.c 2005-03-01 22:01:41.000000000 +0000 @@ -54,7 +54,7 @@ if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x740c) { ohci->flags = OHCI_QUIRK_AMD756; - ohci_info (ohci, "AMD756 erratum 4 workaround\n"); + ohci_dbg (ohci, "AMD756 erratum 4 workaround\n"); // also somewhat erratum 10 (suspend/resume issues) } @@ -68,7 +68,7 @@ */ else if (pdev->vendor == PCI_VENDOR_ID_OPTI && pdev->device == 0xc861) { - ohci_info (ohci, + ohci_dbg (ohci, "WARNING: OPTi workarounds unavailable\n"); } @@ -84,9 +84,19 @@ if (b && b->device == PCI_DEVICE_ID_NS_87560_LIO && b->vendor == PCI_VENDOR_ID_NS) { ohci->flags |= OHCI_QUIRK_SUPERIO; - ohci_info (ohci, "Using NSC SuperIO setup\n"); + ohci_dbg (ohci, "Using NSC SuperIO setup\n"); } } + + /* Check for Compaq's ZFMicro chipset, which needs some short + * delays when urbs are unlinked in ochi-q.c::finish_unlinks() + */ + else if (pdev->vendor == PCI_VENDOR_ID_COMPAQ + && pdev->device == 0xa0f8) { + ohci->flags |= OHCI_QUIRK_ZFMICRO; + ohci_dbg (ohci, + "enabled Compaq ZFMicro chipset quirk\n"); + } } /* NOTE: there may have already been a first reset, to diff -ur linux-2.6.11-rc4.orig/drivers/usb/host/ohci-q.c linux-2.6.11-rc4/drivers/usb/host/ohci-q.c --- linux-2.6.11-rc4.orig/drivers/usb/host/ohci-q.c 2005-02-13 03:07:40.000000000 +0000 +++ linux-2.6.11-rc4/drivers/usb/host/ohci-q.c 2005-02-26 12:46:01.000000000 +0000 @@ -1018,6 +1018,8 @@ if (ohci->ed_controltail) { command |= OHCI_CLF; + if (ohci->flags & OHCI_QUIRK_ZFMICRO) + mdelay(1); if (!(ohci->hc_control & OHCI_CTRL_CLE)) { control |= OHCI_CTRL_CLE; ohci_writel (ohci, 0, @@ -1026,6 +1028,8 @@ } if (ohci->ed_bulktail) { command |= OHCI_BLF; + if (ohci->flags & OHCI_QUIRK_ZFMICRO) + mdelay(1); if (!(ohci->hc_control & OHCI_CTRL_BLE)) { control |= OHCI_CTRL_BLE; ohci_writel (ohci, 0, @@ -1036,12 +1040,17 @@ /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */ if (control) { ohci->hc_control |= control; + if (ohci->flags & OHCI_QUIRK_ZFMICRO) + mdelay(1); ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); } - if (command) + if (command) { + if (ohci->flags & OHCI_QUIRK_ZFMICRO) + mdelay(1); ohci_writel (ohci, command, &ohci->regs->cmdstatus); - } + } + } } diff -ur linux-2.6.11-rc4.orig/drivers/usb/host/ohci.h linux-2.6.11-rc4/drivers/usb/host/ohci.h --- linux-2.6.11-rc4.orig/drivers/usb/host/ohci.h 2005-02-13 03:07:50.000000000 +0000 +++ linux-2.6.11-rc4/drivers/usb/host/ohci.h 2005-02-26 12:46:01.000000000 +0000 @@ -396,6 +396,7 @@ #define OHCI_QUIRK_SUPERIO 0x02 /* natsemi */ #define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */ #define OHCI_BIG_ENDIAN 0x08 /* big endian HC */ +#define OHCI_QUIRK_ZFMICRO 0x10 /* Compaq ZFMicro chipset*/ // there are also chip quirks/bugs in init logic }; ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel