Re: [PATCH 1/2] usb: core: unlink urbs from the tail of the endpoint's urb_list

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

 



On Fri, Jul 07, 2017 at 08:19:08PM -0400, Alan Stern wrote:
> On Fri, 7 Jul 2017, Bin Liu wrote:
> 
> > On Fri, Jul 07, 2017 at 11:56:53AM -0400, Alan Stern wrote:
> > > On Fri, 7 Jul 2017, Bin Liu wrote:
> > > 
> > > > While unlink an urb, if the urb has been programmed in the controller,
> > > > the controller driver might do some hw related actions to tear down the
> > > > urb.
> > > > 
> > > > Currently usb_hcd_flush_endpoint() passes each urb from the head of the
> > > > endpoint's urb_list to the controller driver, which could make the
> > > > controller driver think each urb has been programmed and take the
> > > > unnecessary actions for each urb.
> > > > 
> > > > This patch changes the behavior in usb_hcd_flush_endpoint() to pass the
> > > > urbs from the tail of the list, to avoid any unnecessary actions in an
> > > > controller driver.
> > > > 
> > > > Signed-off-by: Bin Liu <b-liu@xxxxxx>
> > > > ---
> > > >  drivers/usb/core/hcd.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> > > > index 5dea98358c05..6839c176c701 100644
> > > > --- a/drivers/usb/core/hcd.c
> > > > +++ b/drivers/usb/core/hcd.c
> > > > @@ -1878,7 +1878,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
> > > >  	/* No more submits can occur */
> > > >  	spin_lock_irq(&hcd_urb_list_lock);
> > > >  rescan:
> > > > -	list_for_each_entry (urb, &ep->urb_list, urb_list) {
> > > > +	list_for_each_entry_reverse (urb, &ep->urb_list, urb_list) {
> > > >  		int	is_in;
> > > >  
> > > >  		if (urb->unlinked)
> > > 
> > > Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> > > 
> > > But you might want to get rid of the extra space before the open paren 
> > > (what does checkpatch.pl say?).
> > 
> > Yes, it complains, but the whole file has this style, so I didn't change
> > it. But I can remove it if we want to gradually fix the coding style
> > problem.
> 
> That's how we have been handling these things in the USB subsystem.  
> Whenever code containing extra spaces gets changed, the new code leaves
> out the spaces.

Thanks Alan, I will remove the spaces when I am ready submitting those
patches for next -rc in a couple weeks if no other comments collected.

Regards,
-Bin.
--
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