Re: [PATCH 1/2] usb: make urb scatter-gather support more generic

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

 



On Mon, Aug 24, 2009 at 06:26:26PM +0100, David Vrabel wrote:
> Sarah Sharp wrote:
> > On Mon, Aug 24, 2009 at 03:54:16PM +0000, David Vrabel wrote:
> >> The WHCI HCD will also support urbs with scatter-gather lists.  Add a
> >> usb_bus field to indicated how many sg list elements are supported by
> >> the HCD.  Use this to decide whether to pass the scatter-list to the HCD
> >> or not.
> >>
> >> Always use scatter-gather urbs where possible, regardless of the
> >> endpoint type.  If the scatter-gather list doesn't have suitably sized
> >> elements for a particular endpoint type then splitting it up into
> >> separate urbs won't help.
> > 
> > Does this mean control URBs may have a scatter gather list?  The xHCI
> > driver can't currently handle that.
> 
> Control transfers with sg lists is not something that would work with
> ehci, ohci or uhci either as the single transfer would be turned into
> several independent control transfers.

Ah, so usb_sg_init() should never be called for a control transfer?

> >> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> >> index 592fe7e..bbc3934 100644
> >> --- a/drivers/usb/host/xhci-pci.c
> >> +++ b/drivers/usb/host/xhci-pci.c
> >> @@ -50,6 +50,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
> >>  	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
> >>  	int			retval;
> >>  
> >> +	hcd->self.sg_tablesize = 2048;
> >> +
> > 
> > Please set this to (TRBS_PER_SEGMENT - 1).  It's not a very big number
> > (currently 63).  I haven't added dynamic transfer ring resizing yet, so
> > there's only 63 TRBs to map to sg list entries.
> 
> Will do.
> 
> I've not looked at the xhci spec but rather than dynamically resizing
> the transfer ring, can you reuse entries in it as they are consumed?
> This would be analogous to what the whci-hcd driver does.

Yes, the xHCI driver can reuse entries in the transfer ring as the
hardware completes the transfers.  I would only need dynamic ring
resizing if pending transfers were taking up the ring, or if a driver
tried to enqueue a very large sglist.

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