Hi David,
On Wed, May 13, 2020 at 12:10 PM David Laight David.Laight@aculab.com wrote:
From: Geert Uytterhoeven
Sent: 13 May 2020 10:49
...
I don't want to apply this to older kernels as it could cause extra memory usage for no good reason. I have no idea why a non ARC system would want it :(
I think the reference to ARC is a red herring. The real issue is that buffers used for DMA may not have the required alignment, which is not limited to ARC systems.
Note that I'm also not super happy with the extra memory usage. But devm_*() conveniences come with their penalties...
Interesting thought. Could the devm 'header' be put right at the end of the kmalloc() buffer?
Then the driver would be given aligned address.
Yes, if the header is extended to contain the real start address of the allocated block.
Gr{oetje,eeting}s,
Geert