On Wed, Dec 05, 2012 at 12:19:34PM -0500, Alan Stern wrote:
> On Tue, 4 Dec 2012, Sarah Sharp wrote:
> > @@ -2534,6 +2534,10 @@ static int hub_port_wait_reset(struct usb_hub *hub, 
> > int port1,
> >             if (ret < 0)
> >                     return ret;
> >  
> > +           /* The port state is unknown until the reset completes. */
> > +           if ((portstatus & USB_PORT_STAT_RESET))
> > +                   goto delay;
> > +
> >             /*
> >              * Some buggy devices require a warm reset to be issued even
> >              * when the port appears not to be connected.
> > @@ -2601,6 +2605,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, 
> > int port1,
> >                             return 0;
> >             }
> >  
> > +delay:
> >             /* switch to the long delay after two short delay failures */
> >             if (delay_time >= 2 * HUB_SHORT_RESET_TIME)
> >                     delay = HUB_LONG_RESET_TIME;
> 
> At some point this entire loop should be turned inside out.  The
> outline should be:
> 
>       for (delay_time = 0; ...) {
>               msleep(delay);
> 
>               ret = hub_port_status(...);
>               if (reset finished)
>                       break;
> 
>               adjust the delay time
>       }
> 
>       Do all the stuff involving the various status bits...
> 
> Maybe you'd prefer to make this change after some of the other patches 
> in this series.  That would be fine, so long as it does eventually get 
> made.

Ok, I'll refactor this in the patches that aren't bound for stable.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to