Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: USB troubles with SB600/SB700 chipsets



> On Fri, Jun 12, 2009 at 12:27:49AM +0200, Bernd Ernesti wrote:
> > +   /* Handle quirks */
> > +   switch (quirk) {
> > +   case EHCI_PCI_QUIRK_AMD_SB600:
> > +           ehci_apply_amd_quirks(sc);
> > +   case EHCI_PCI_QUIRK_AMD_SB700:
> > +           if (pci_find_device(NULL, ehci_sb700_match))
> > +                   ehci_apply_amd_quirks(sc);
> > +   }
> > +
> 
> You may need a break in there somewhere.
> 
> > +static int
> > +ehci_apply_amd_quirks(struct ehci_pci_softc *sc)
> > +{
> > +   uint32_t value;
> > + 
> > +   aprint_normal_dev(sc->sc.sc_dev,
> > +       "applying AMD SB600/SB700 USB freeze workaround\n");
> > +   value = pci_conf_read(sc->sc_pc, sc->sc_tag, 0x50);
> > +   value |= (1U << 27);
> > +   pci_conf_write(sc->sc_pc, sc->sc_tag, 0x50, value);
> 
> Even magic numbers can be named. :-)
> 
> #define EHCI_SBx00_WORKAROUND_REG     0x50
> #define EHCI_SBx00_WORKAROUND_ENABLE  __BIT(27)
> 
> > +enum ehci_pci_quirk_flags
> > +ehci_pci_lookup_quirkdata(pci_vendor_id_t vendor, pci_product_id_t
> product)
> > +{
> > +   int i;
> > +
> > +   for (i = 0; i < (sizeof ehci_pci_quirks / sizeof ehci_pci_quirks[0]);
> > +       i++)
> 
> I suggest __arraycount(ehci_pci_quirks).
> 
> Dave

I tested this patch with Davids improvement suggestions on
a SB600 chipset and a USB 2.0 disk drive with its own
power cable.
The USB 2.0 disk drive attaches as sd0 at umass0.

For comparison, I also tested w/o this patch.

W/o this patch:

The first time after boot it works.
On re-plugging the disk, I get
"uhub5: device problem, disable port X" messages.
I have to turn off and on the disk before every re-plugging.

With this patch:
I can re-plug the disk as often as I want
and don't have to turn off and on the disk.

Christoph


Home | Main Index | Thread Index | Old Index