Re: [PATCH 1/9 v7] xHCI: handle_tx_event() refactor: finish_td

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

 



On Thu, 8 Jul 2010, Sarah Sharp wrote:

> One small thing I noticed is that this changes what the xHCI driver does
> with urb->status.  I think that the host driver isn't supposed to
> directly set urb->status.  I think the host driver is only supposed to pass the
> status to usb_hcd_giveback_urb().

That's right.  As far as the HCD is concerned, urb->status doesn't 
exist.  In fact at one point we were considering removing it, but it 
turned out to be used by too many drivers.

> The problem is that drivers aren't supposed to look at urb->status
> until their completion function is called, but I think some of them
> still might.  So if the URB generates multiple events, the driver might
> see the change of status for the first event and deallocate the URB
> before the xHCI host has a chance to deal with the second event.  I
> think it's best to let the USB core handle setting urb->status.
> 
> I did a quick grep for "urb->status", and none of the major hosts (EHCI,
> UHCI, OHCI) directly set urb->status.  There are a few embedded ones
> (fhci, imx21, isp1362, isp1760, & oxu210hp), but I have no idea if
> they're doing the correct thing.

They aren't.  I removed all the usages of urb->status in the HCDs at
the time of the changeover, but some new ones may have been added since 
then.

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