On Tuesday 19 September 2006 3:43 am, Jiri Kosina wrote: > (by the way, EHCI and OHCI seem to have broken (read: missing) locking > when accessing the hcd->state. Should I fix it by per-hcd spinlock, or > does the patch already exist somewhere?)
They should only ever access it while holding their internal spinlocks; which are held during most driver operations, easy to miss. And except for hardware faults, the HCD state changes only when usbcore pushes an HCD through driver model state transitions like probe(), suspend(), and their inverses. I see some dodgey code in the OHCI IRQ handler, but even that shouldn't make trouble. Admittedly the usbcore access to that field is a bit problematic, since it doesn't handle the hardware faulting cases very cleanly. For those cases, other problems are more severe ... like basic cleanup of all the pending transactions, and removal of the usb devices, didn't work the last time I tripped over such cases. Eventually we want hcd->state to vanish, but until it does it sure seems like a problem if usbcore can't rely on all HCDs to treat it the same. - Dave ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel