From: Paul Mackerras <paulus@samba.org>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: [PATCH] USB root hub polling and suspend
Date: Wed, 7 Aug 2002 08:51:14 +1000 (EST) [thread overview]
Message-ID: <15696.21218.406438.634687@argo.ozlabs.ibm.com> (raw)
Currently with 2.5, when I suspend and resume my powerbook, I find
that the USB subsystem no longer sees root hub events, i.e. it doesn't
notice when I plug in a new USB device (it doesn't notice when I
unplug a device either but of course the driver for the device sees
that it is no longer responding).
It turns out that what happens is that the root hub timer goes off
after the OHCI driver has done its suspend stuff. The timer routine
sees that the HCD is not running at the moment and doesn't schedule
another timeout. Hence the series of timeouts stops.
The patch below fixes the problem for me. Comments welcome.
Paul.
diff -urN linuxppc-2.5/drivers/usb/core/hcd.c pmac-2.5/drivers/usb/core/hcd.c
--- linuxppc-2.5/drivers/usb/core/hcd.c Sun Jul 21 12:58:49 2002
+++ pmac-2.5/drivers/usb/core/hcd.c Tue Jul 23 22:21:25 2002
@@ -454,7 +454,6 @@
/* rh_timer protected by hcd_data_lock */
if (timer_pending (&hcd->rh_timer)
|| urb->status != -EINPROGRESS
- || !HCD_IS_RUNNING (hcd->state)
|| urb->transfer_buffer_length < len) {
dbg ("not queuing status urb, stat %d", urb->status);
return -EINVAL;
@@ -508,8 +507,12 @@
BUG ();
}
spin_unlock_irqrestore (&hcd_data_lock, flags);
- } else
+ } else {
spin_unlock_irqrestore (&urb->lock, flags);
+ spin_lock_irqsave (&hcd_data_lock, flags);
+ rh_status_urb (hcd, urb);
+ spin_unlock_irqrestore (&hcd_data_lock, flags);
+ }
} else {
/* this urb's been unlinked */
urb->hcpriv = 0;
next reply other threads:[~2002-08-06 22:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-06 22:51 Paul Mackerras [this message]
2002-08-07 4:43 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15696.21218.406438.634687@argo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®