Thread (20 messages) 20 messages, 5 authors, 2022-11-30

Re: [PATCH 7/9] Input: n64joy - Fix DMA buffer alignment.

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2022-11-28 18:20:21

On Sun, Nov 27, 2022 at 06:48:44PM +0200, Lauri Kasanen wrote:
On Sun, 27 Nov 2022 14:41:14 +0000
Jonathan Cameron [off-list ref] wrote:
quoted
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

The use of ____cacheline_aligned to ensure a buffer is DMA safe only
enforces the start of the buffer alignment. In this case, sufficient
alignment is already ensured by the use of kzalloc().
____cacheline_aligned does not ensure that no other members of the
structure are placed in the same cacheline after the end of the
buffer marked.  Thus to ensure a DMA safe buffer it must be at the end
of the structure.
This move is unnecessary, because the cacheline is 16 bytes and the
buffer is 64 bytes.
I think it is still worth moving it or alternatively adding a comment
why we believe the following member will not be sharing cacheline with
the buffer.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help