Johannes Erdfelt wrote:
> 
> On Sat, May 06, 2000, Brad Hards <[EMAIL PROTECTED]> wrote:
> > Pavel Machek wrote:
> > > --- clean/drivers/usb/uhci.c    Thu Apr 27 10:05:49 2000
> > > +++ linux/drivers/usb/uhci.c    Fri May  5 12:21:58 2000
> > > @@ -2357,10 +2357,14 @@
> > >
> > >  static int handle_pm_event(struct pm_dev *dev, pm_request_t rqst, void *data)
> > >  {
> > > +       struct uhci *uhci = dev->data;
> > >         switch (rqst) {
> > >         case PM_SUSPEND:
> > > +               reset_hc(uhci);
> > >                 break;
> > >         case PM_RESUME:
> > > +               reset_hc(uhci);
> > > +               start_hc(uhci);
> > >                 break;
> > >         }
> > >         return 0;
> >
> > I don't doubt that this is better than the existing arrangement, but it
> > doesn't look complete.
> >
> > From my reading of the UHCI spec, I think that the following should
> > occur:
> >
> > On initialisation of the HC, we Set bit 1 in the USBINTR register.
> >
> > On getting an interrupt, we check the USBSTS register to see if bit 2 is
> > set, and if it is, we wake up the machine, then Clear bit 4 in the
> > USBSTS register.
> >
> > On getting PM_SUSPEND, we Clear bit 0 in the USBCMD register, then Set
> > bit 3 in the USBCMD register.
> >
> > On getting PM_RESUME, we Set bit 4 and Clear bit 3 in the USBCMD
> > register, wait 20ms, then Clear bit 4 in the USBCMD register. We might
> > need to Set bit 0 in the USBCMD register as well.
>
> I think you're confusing 2 things.
Always a possibility...
 
> There's remote wakeup from USB devices which requires HC support. I think
> that's what you're talking about.
Part of it (enabling interrupts and checking USBSTS bit 2 on interrupt)
is for the remote wakeup functionality.
 
> What the PM stuff in the kernel does is to handle power management for
> the Host Controller. It needs to be reset when full power is reapplied to
> the device. That's what this patch does.
I think that there is more too it than this, since it seems that such
things as suspend-to-RAM don't take all the power away (depending on APM
or ACPI implementation). It should be possible to suspend the USB bus
traffic (i.e. Global Suspend) without powering off the host controller.
If not, then how does IAPC work on a USB keyboard or mouse?
Now if the Host Controller is really getting powered off, why do we need
to:
                case PM_SUSPEND:
                      reset_hc(uhci);
                      break;
If it is going to be powered off, who cares about the state?

> This isn't to say what you're talking isn't necessary, but for right now
> since PM is in it's infancy under Linux, I think partial support is fine
> for 2.4 atleast.
I agree it is better, and I don't see it as a show-stopper for 2.4. I
just don't think it is as good as it could be. And I really do want my
laptop to be able to do resume (and remote wakeup, eventually) from a
global suspend (and maybe a selective suspend when there are user space
tools to control it) and I don't want to get devices randomly reassigned
when that happens.

Brad

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to