Re: ohci: USB devices only detected at boot time
Raphael Assenat <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Alan Stern wrote: > On Thu, 15 Feb 2007, Raphael Assenat wrote: > > >>>Okay. This says that RHSC works correctly while the controller is >>>running, but it doesn't work when the controller is suspended. >> >>hmm. So that's a bug in the chip? Would preventing this specific >>controller from being suspended be an acceptable solution? What are >>the implication of not suspending the controller when all the ports >>are free? >> >>lspci entry for this controller: >>0000:00:01.4 0c03: 1283:8152 (rev 07) >> >> >> >>>Post a copy of the contents of /sys/class/usb_host/usb_host2/registers >>>while no devices are plugged in, and then again after you plug in a device >>>and nothing happens. >> >>Here. Apparently nothing changes... >> ** removed register dumps ** > > > Wow, that's really buggy! Not only is there no interrupt request, the > port status shows that the chip doesn't even know you plugged in the > device. > > Clearly the chip's wakeup function is completely broken. The only way you > can get it to work is to prevent the controller from ever being suspended. > You can do that putting these lines in a system startup file: > > echo disabled >/sys/bus/usb/devices/usb2/power/wakeup > echo -n 0 >/sys/bus/usb/devices/usb2/power/state > > Note that you will need to keep the CONFIG_PM_SYSFS_DEPRECATED option for > that second line to work properly. That would certainly work, but I dont like much the idea of relying on a deprecated option. Wont it disappear in the future? How about adding an OHCI_QUIRK_NO_RH_SUSPEND flag in struct ohci_hcd and using it to disable suspend for this chip? The flag can be set automatically in ohci-pci.c. The only thing I'm not sure about is the appropriate place to handle this flag in ohci-hub.c.... A patch that does this is attached to this email. Please comment. Best regards, -- Raphael Assenat 8D Technologies Inc. ------------------------------------------------------------------------- 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 _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
ohci-it8152-nosuspend.diff
(text/plain, 1.6 KB)
Disabled root hub suspend for the buggy it8152 ohci controller. Signed-off-by: Raphael Assenat <[email protected]> --- linux-2.6.20/drivers/usb/host/ohci-pci.c 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20-8d/drivers/usb/host/ohci-pci.c 2007-02-19 11:32:45.000000000 -0500 @@ -94,6 +94,13 @@ "enabled Compaq ZFMicro chipset quirk\n"); } + else if (pdev->vendor == PCI_VENDOR_ID_ITE + && pdev->device == 0x8152) { + ohci->flags |= OHCI_QUIRK_NO_RH_SUSPEND; + ohci_dbg (ohci, + "workaround: disabling root hub suspend for ITE8152\n"); + } + /* RWC may not be set for add-in PCI cards, since boot * firmware probably ignored them. This transfers PCI * PM wakeup capabilities (once the PCI layer is fixed). --- linux-2.6.20/drivers/usb/host/ohci.h 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20-8d/drivers/usb/host/ohci.h 2007-02-19 11:39:07.000000000 -0500 @@ -396,6 +396,7 @@ #define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */ #define OHCI_BIG_ENDIAN 0x08 /* big endian HC */ #define OHCI_QUIRK_ZFMICRO 0x10 /* Compaq ZFMicro chipset*/ +#define OHCI_QUIRK_NO_RH_SUSPEND 0x20 // there are also chip quirks/bugs in init logic }; --- linux-2.6.20/drivers/usb/host/ohci-hub.c 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20-8d/drivers/usb/host/ohci-hub.c 2007-02-19 11:33:19.000000000 -0500 @@ -350,7 +350,8 @@ /* if no devices have been attached for one second, autostop */ } else { - if (changed || any_connected) { + if (changed || any_connected || + ohci->flags & OHCI_QUIRK_NO_RH_SUSPEND) { ohci->autostop = 0; ohci->next_statechange = jiffies + STATECHANGE_DELAY;