Re: [PATCH v5 3/5] USB: EHCI: improve ehci_endpoint_disable

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

 



On Thu, 25 Jul 2013, Greg Kroah-Hartman wrote:

> On Wed, Jul 03, 2013 at 10:53:09PM +0800, Ming Lei wrote:
> > The patch does the below improvement:
> > 
> > - think QH_STATE_COMPLETING as unlinking state since all URBs on the
> > endpoint should be in unlinking or unlinked when doing endpoint_disable()
> > 
> > - add "WARN_ON(!list_empty(&qh->qtd_list));" if qh->qh_state is
> > QH_STATE_LINKED because there shouldn't be any active transfer in qh
> 
> If this can "never" happen, why spit a nasty message out to the error
> log?  What can a user do with this?

In this context, "never" means the only way it can happen is if there's
a serious bug in the way usbcore handles altsetting and config changes.  
That code is sufficiently complicated that a little extra error
checking won't hurt, IMO.

If it ever happens, a user could post the log message on the mailing 
list, giving us a chance to find and fix the bug.

> I really don't like adding stuff like this to the kernel if at all
> possible.

Up to you.  Still, I think bringing situations like this to people's 
attention is a large part of what WARN_ON is intended for.

Alan Stern

--
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