Problem with non aligned DMA in usbnet on ARM
From: Matthieu CASTET <hidden>
Date: 2010-08-12 17:08:57
Also in:
netdev
Martin Fuzzey a ?crit :
quoted
We don't want to add support for this to DMA bounce. DMA bounce is already a pain in the backside and causes its own set of problems - please let it die a long slow but quite death. If you want to see the kind of pain dmabounce causes, look at this long standing and as yet unsolved bug: http://bugzilla.kernel.org/show_bug.cgi?id=7760Well I don't know the dmabounce code but why is using it likely to cause OOM problems (at least why more so than copying the buffer in the HCD or the usb core). In both cases there will be two copies of the buffer in memory which could I agree be a problem in memory constrained systems. But if we _do_ want to accept unaligned buffers from usb drivers I can't see a way round that.
memmove is our friend : the buffer allocated in usbnet got an offset. All you have to do it remove this offset and memmove the data. That what I did [1], and why it is better to do it in usb driver. Matthieu [1] http://article.gmane.org/gmane.linux.usb.general/28700 -------------- next part -------------- A non-text attachment was scrubbed... Name: gadget-align.diff Type: text/x-diff Size: 2251 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100812/7bf8e096/attachment.bin>