Messages in this thread | ![/](/images/icornerl.gif) | | Date | Mon, 22 Sep 2003 09:04:57 -0700 | From | David Brownell <> | Subject | Re: PATCH (as112) Re: USB APM suspend |
| |
Alan Stern wrote: > On Sun, 21 Sep 2003, David Brownell wrote: > >>>Why was this routine called twice? (Don't be fooled by the timestamps; I >>>think the "suspend D4 --> D3" message was created during the suspend but >>>not read by syslogd until after the resume.) >> >>That's happened for as long as I remember (2.4 also). >>Still seems buglike to me, maybe 2.6 will finally squish it... > > > Well, the code path is easy enough to find. If you look at suspend() in > arch/i386/kernel/apm.c, you'll see calls to pm_send_all() and > device_suspend(). They both end up filtering down to the USB HC drivers. > The bad one is pm_send_all(); it comes too soon.
Rather, "it comes at all". Call device_{suspend,resume} should suffice. It shouldn't pm_send_all() -- either of the two calls. (The 2.4 bug is necessarily a different issue.)
Does it work if you remove those calls?
> By the way, David, apparently core/hcd-pci.c wants the HC drivers to set > the hcd state to USB_STATE_SUSPENDED, but a simple grep shows that neither > the EHCI nor the OHCI driver does so. That certainly looks like an > oversight, though I'm not sure in which source file.
And what's odd is that it was working before, too! I'll have a look, next I get a chance. It's good to know that APM is almost behaving again.
> Meanwhile, here's a simple patch to improve logging during suspend and > resume. Greg, if David approves please apply it.
Reads OK to me -- go for it!
- Dave
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |