Alan Stern writes:

> The following patch addresses the problem the Paul raised, concerning 
> whether the root hub status irq timer should be allowed to run during a 
> suspend.
> 
> I'm not sure that this does exactly what you would like.  My reasoning is
> that the timer should run as long as the URB is linked.  Just as with
> non-root hubs, if you want the periodic interrogations to stop during a
> suspend then the URB should be unlinked.  So I moved the check for whether
> the HC is running to the place where the timer is first started when the
> URB is submitted, instead of checking whenever the timer expires.

Sorry I didn't get back to you earlier about this one.

Unfortunately this patch doesn't work for me.  With this patch (which
is now in Linus' tree), my powerbook laptop will hang during the
suspend process and not actually go to sleep.  It hangs sometime
during the mdelay(500) at line 157 of drivers/usb/host/ochi-pci.c
while it is trying to suspend the second of the two OHCI controllers
on the machine.

I am currently using the patch below, which works fine.  This is
against Linus' current BK tree.  I think it basically achieves the
same effect as your patch but in a slightly different way.

Comments?

Paul.

diff -urN linux-2.5/drivers/usb/core/hcd.c pmac-2.5/drivers/usb/core/hcd.c
--- linux-2.5/drivers/usb/core/hcd.c    2003-06-19 13:04:20.000000000 +1000
+++ pmac-2.5/drivers/usb/core/hcd.c     2003-06-24 22:46:49.000000000 +1000
@@ -459,8 +459,7 @@
        /* rh_timer protected by hcd_data_lock */
        if (hcd->rh_timer.data
                        || urb->status != -EINPROGRESS
-                       || urb->transfer_buffer_length < len
-                       || !HCD_IS_RUNNING (hcd->state)) {
+                       || urb->transfer_buffer_length < len) {
                dev_dbg (hcd->controller,
                                "not queuing rh status urb, stat %d\n",
                                urb->status);
@@ -490,10 +489,17 @@
        local_irq_save (flags);
        spin_lock (&urb->lock);
 
-       /* do nothing if the urb's been unlinked */
+       /* do nothing if the hc is gone or the urb's been unlinked */
        if (!urb->dev
                        || urb->status != -EINPROGRESS
-                       || (hcd = urb->dev->bus->hcpriv) == 0) {
+                       || (hcd = urb->dev->bus->hcpriv) == 0
+                       || !HCD_IS_RUNNING (hcd->state)) {
+               /* If the HCD is suspended, come back and try again later */
+               if (HCD_IS_SUSPENDED (hcd->state)) {
+                       spin_lock (&hcd_data_lock);
+                       mod_timer (&hcd->rh_timer, jiffies + HZ/4);
+                       spin_unlock (&hcd_data_lock);
+               }
                spin_unlock (&urb->lock);
                local_irq_restore (flags);
                return;


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to