RE: gadget framework data alignment

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

 



Alan Stern wrote:
> On Tue, 15 Dec 2009, Matthieu CASTET wrote:
> 
> > Hi,
> > 
> > 
> > I am wondering about using dma with gadget.
> > 
> > From what I understand gadget function can put anything in req->buf.
> > That is the case for u_ether that puts skb->data.
> > 
> > But if the driver wants to do dma they need a buffer aligned on a cache
> > boundary (to clean/invalidate/flush buffer).
> > 
> > Who should do the job ?
> > - Gadget function should provide "provide DMA-safe buffers" like in spi
> > subsystem ?
> > - Driver need to copy the data in a safe buffer.
> 
> Buffers should be allocated by calling kmalloc() or equivalent 
> functions.  These routines always return addresses that are 
> cacheline-aligned on architectures which require it.
> 

For g_ether, the buffers are allocated using kmalloc(), but the
networking code seems to move the data in the buffer out by 2
bytes, and passes this unaligned address down to the gadget driver.

The MUSB controller in the beagleboard could handle these unaligned
DMA address, but looks like newer MUSB controllers don't seem to
like this.

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