Re: Question on HCD endpoint_reset() and MSD/UB driver

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

 



On Tue, 9 Jun 2009, Sarah Sharp wrote:

> On Tue, Apr 28, 2009 at 11:45:23AM +0100, David Vrabel wrote:
> > Sarah Sharp wrote:
> > > Allow device drivers to submit URBs to bulk endpoints on devices under an
> > > xHCI host controller.  Share code between the control and bulk enqueueing
> > > functions when it makes sense.
> > > 
> > > To get the best performance out of bulk transfers, SuperSpeed devices must
> > > have the bMaxBurst size copied from their endpoint companion controller
> > > into the xHCI device context.  This allows the host controller to "burst"
> > > up to 16 packets before it has to wait for the device to acknowledge the
> > > first packet.
> > 
> > Your usb_hcd may need to provide a endpoint_reset method to reset the
> > sequence number.  usb_hcd_reset_endpoint() is called after a
> > ClearFeature(Halt) etc.
> 
> Can the endpoint_reset method be called in interrupt context?  I need to
> issue a command to the xHCI host controller hardware and wait on that
> command to complete before a driver can successfully submit new URBs for
> that endpoint.

This should have been documented better.  It was my understanding that
the endpoint_reset method is _never_ called in interrupt context.  Now 
I have to go back and recheck one of my EHCI patches...  :-)

> There are a couple different entry points to the HCD endpoint_reset()
> function.

Not really.  The only entry point is in usb_hcd_reset_endpoint(), which
is called only from usb_reset_endpoint().  But _that_ function is
called from the various places you note.

>  One is in message.c, but that has a note that the function
> can't be called in interrupt context.  It's obvious after a quick read
> that two other entry points (drivers/isdn/hisax/st5481_usb.c's
> usb_ctrl_complete() and usbfs' proc_resetep()) aren't called in
> interrupt context.

In fact hisax/st5481_usb's usb_ctrl_complete() usually runs in
interrupt context and _always_ runs with interrupts disabled.

> That leaves the last entry points in the MSD driver and the UB driver.
> I'm not sure whether these functions can be called in interrupt context
> or not:
>  - drivers/usb/storage/transport.c usb_stor_clear_halt()

Always in process context.

>  - drivers/block/ub.c ub_scsi_urb_compl()
> 
> David and Pete, can you help me figure this out?

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