Re: [PATCH] usbcore: refine warm reset logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2011-08-26 at 11:20 -0400, Alan Stern wrote:
> uOn Fri, 26 Aug 2011, Andiry Xu wrote:
> 
> > > What's wrong with running all the code above for a warm reset?
> > > 
> > 
> > The original warm reset code may reset a port with no connection and
> 
> That's strange.  What good does it do to reset a port with no 
> connection?
> 

After double check the device's behavior, I found that I must do so.
When plug in the buggy device (Kingston DT Ultimate), it reports
CONNECTION, ENABLE, and link state as Recovery. Then when usbcore
fetches port status, it reports link state as SS.Inactive with no
CONNECTION and ENABLE. So driver has to warm reset the port even with no
connection.

> > udev is NULL, so can not run the the code above. I may modify the code
> > to warm reset the port on connection only, but udev is still lacked, and
> > it's meaningless to re-set the udev speed as it's always superspeed.
> 
> If there's a connection, udev should always be present.  As for the 
> speed, okay, it will remain superspeed, but running the code won't 
> hurt.
> 
> > > >  			/* TRSTRCY = 10 ms; plus some extra */
> > > >  			msleep(10 + 40);
> > > >  			update_devnum(udev, 0);
> > > > +			hcd = bus_to_hcd(udev->bus);
> > > 
> > > Why was this line moved?
> > > 
> > 
> > Because hcd in only used in this if block, and if I don't move the line
> > here, it will show a compile warning like "variable hcd may be used
> > uninitialized".
> 
> If you move the initialization of hcd to here, then perhaps you can 
> also move the declaration into the "if" block.
> 

OK.

Thanks,
Andiry


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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux