On Sun, Oct 27, 2002, Duncan Sands <[EMAIL PROTECTED]> wrote:
> On Sunday 27 October 2002 00:45, Alan Cox wrote:
> > On Sat, 2002-10-26 at 00:06, Duncan Sands wrote:
> > > + status = inw(io_addr + USBCMD);
> > > + outw(status & ~USBCMD_RS, io_addr + USBCMD);
> > > +
> > > + /* Wait for the current transaction to finish */
> > > + status = inw(io_addr + USBSTS);
> > > + while (!(status & USBSTS_HCH))
> > > +         status = inw(io_addr + USBSTS);
> > > +
> > >   outw(USBCMD_EGSM, io_addr + USBCMD);
> >
> > These loops need timeouts. Suppose I unplugged the USB controller on my
> > cardbus at that moment ?
> 
> Then the system will go down!  A devil tempts me to point out that it would 
> have gone down before this patch as well - look in wakeup_hc a few lines
> below... But you are right of course - I will put in a timeout and, sigh,
> I will audit uhci.c and put in timeouts everywhere else as well.

I'd be very surprised to see a UHCI cardbus card in the first place, but
it's possible and not very good behaviour so it should be fixed :)

FWIW, I think the reason that things worked before this part of the
patch atleast, is because when we set EGSM, we also clear RS at the same
time and it just happens to work on the two common UHCI controllers.

But it's not per the spec exactly and should probably do something like
your patch.

JE



-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to