On Tue, 6 Jan 2004, Oliver Neukum wrote:

> > +   /* Scatter-gather buffers (all but the last) must have a length
> > +    * divisible by the bulk maxpacket size.  Otherwise a data packet
> > +    * would end up being short, causing a premature end to the data
> > +    * transfer.  Since high-speed bulk pipes have a maxpacket size
> > +    * of 512, we'll use that as the scsi device queue's DMA alignment
> > +    * mask.  Guaranteeing proper alignment of the first buffer will
> > +    * have the desired effect because, except at the beginning and
> > +    * the end, scatter-gather buffers follow page boundaries. */
> > +   blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
> 
> What about the cacheline of the last buffer? It seems to me that we have
> to worry about DMA coherency.

We don't have to worry about that, at least not here in the low-level
driver.  These buffers are passed from user processes.  Suppose a process
wants to write an amount that's smaller than a cacheline.  But that small
amount might be stored in part of a buffer that does end on a cacheline
boundary -- there's no way for the driver to know.  Ultimately the user
process must be responsible for insuring that DMA coherency is maintained.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to