Re: Test Patch: 2.5.69 Interrupt Latency

From: Paul Fulghum (paulkf@microgate.com)
Date: Thu May 15 2003 - 16:30:05 EST


On Thu, 2003-05-15 at 16:13, Alan Stern wrote:
> My intention was to avoid resuming if the resume-detect bit is set only
> on ports in an over-current condition, since that is the case mentioned in
> the erratum. Of course, this isn't as failsafe as your suggestion. Which
> do you think would work better?

This should be caught on the suspend side so
that you can still service the ports that do not
have the over current condition.

A single port in OC makes resume unreliable,
so the only thing to do is not suspend.

The following worked for me:

static int suspend_allowed(struct uhci_hcd *uhci)
{
        unsigned int io_addr = uhci->io_addr;
        int i;

        if (!uhci->hcd.pdev ||
            (uhci->hcd.pdev->vendor != PCI_VENDOR_ID_INTEL) ||
            (uhci->hcd.pdev->device != PCI_DEVICE_ID_INTEL_82371AB_2))
                return 1;

        /* This is a 82371AB/EB/MB USB controller which has a bug that
         * causes false resume indications if any port has an
         * over current condition. If we do a global suspend then
         * the controller thrashes back and forth between suspend and wakeup.
         *
         * Some motherboards using the 82371AB/EB/MB (but not the USB portion)
         * appear to hardwire the over current inputs active to disable
         * the USB ports..
         */

        /* check for over current condition on all ports */
        for (i = 0; i < uhci->rh_numports; i++) {
                if (inw(io_addr + USBPORTSC1 + i * 2) & 0x0400)
                        return 0;
        }

        return 1;
}

static void suspend_hc(struct uhci_hcd *uhci)
{
        unsigned int io_addr = uhci->io_addr;

        if (!suspend_allowed(uhci))
                return;

-- 
Paul Fulghum, paulkf@microgate.com
Microgate Corporation, http://www.microgate.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:58 EST