On Sat, 30 Jun 2007, Oliver Neukum wrote: > Am Samstag, 30. Juni 2007 schrieb Alan Stern: > > I don't know; it might be better to omit iso_fields and have a separate > > > > usb_alloc_iso_frames(struct urb *urb, unsigned num_frames, > > gfp_t mem_flags) > > > > routine. After all, lots of URBs aren't Iso. > > That seems incompatible with preallocating resources, if the HCD includes > an array of transfer descriptors in the private parts of its URBs.
True. > > Also, do you intend to set URB_FREE_BUFFER and allocate the transfer > > buffer if and only if max_length > 0? > > Without an explicit request? No. It's not entirely clear what you're trying to accomplish by doing this. First, notice that pre-allocation is useless with one-shot URBs, since the resources would be allocated anyway as soon as the URB is submitted. You gain an advantage only by avoiding having the resources deallocated when the URB completes, so that they can be reused when the URB is resubmitted. (Or possibly when a different URB is submitted for the same endpoint.) How will your changes affect deallocation? Notice also that the usb-storage doesn't reuse URBs for its large data transfers (ub might work differently; I don't know). Those are all done using one-shot URBs allocated by the scatter-gather library. Do you intend to change how that works? Another thing worth noticing is that with reusable URBs, at allocation time you might not know the transfer lengths you will need. Drivers would have to guess at the maximum requirement and then live with that guess. Finally, don't forget the advantages of avoiding preallocation and keeping resources in a pool, available for multiple uses. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel