[Bugme-new] [Bug 6661] New: usb ehci-hcd, ehci_intr() function is using same variable for different things, which make if-cases fail.

bugme-daemon at bugzilla.kernel.org bugme-daemon at bugzilla.kernel.org
Wed Jun 7 04:22:44 PDT 2006


http://bugzilla.kernel.org/show_bug.cgi?id=6661

           Summary: usb ehci-hcd, ehci_intr() function is using same
                    variable for different things, which make if-cases fail.
    Kernel Version: 2.6.15.4
            Status: NEW
          Severity: high
             Owner: greg at kroah.com
         Submitter: saxofon at musiker.nu


Most recent kernel where this bug did not occur:
Haven't seen such :-)

Distribution:
kernel.org

Hardware Environment:
Intel XScale ixp465 (for the bug it's more of interest that it is
a EHCI USB 2.0 controller)

Software Environment:
Linux kernel 2.6.15.4

Problem Description:

In ehci-hcd.c there is a existing, even checked latest available 2.6.16.20,
bug that can show up sometimes. Problem is that in the IRQ handler, the
controller status is accuired in the beginning and stored in a variable
called "status". This variable is later used for another controller status
accuiring on another register, then yet later used as if it was the
first variable.
Solution is as simple as using another variable for the second status
accuiring. A patch could be like:

@@ -633,10 +637,11 @@
                        writel (status | CMD_RUN, &ehci->regs->command);

                while (i--) {
-                       status = readl (&ehci->regs->port_status [i]);
-                       if (status & PORT_OWNER)
+                       int pstatus;
+                       pstatus = readl (&ehci->regs->port_status [i]);
+                       if (pstatus & PORT_OWNER)
                                continue;
-                       if (!(status & PORT_RESUME)
+                       if (!(pstatus & PORT_RESUME)
                                        || ehci->reset_done [i] != 0)
                                continue;

Steps to reproduce:
Bug is intermittent, one can see that code has been added trying to cope
with problem caused by using same variable for different things.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Bugme-new mailing list