On Tue, Mar 26, 2013 at 05:58:37PM +0100, Michael Grzeschik wrote:
> The udc uses an shared dma memory space between hard and software. This
> memory layout is described in ci13xxx_qh and ci13xxx_td which are marked
> with the attribute ((packed)).
> 
> The compiler currently does not know about the alignment of the memory
> layout, and will create strb and ldrb operations.
> 
> The Datasheet of the synopsys core describes, that some operations on
> the mapped memory need to be atomic double word operations. I.e. the
> next pointer addressing in the qhead, as otherwise the hardware could
> read wrong data and totally stuck.
> 
> This patch adds the attribute ((aligned(4))) to the structures to tell
> the compiler to use 32bit operations. It also adds an wmb() for the
> prepared TD data before it gets enqueued into the qhead.
> 
> Signed-off-by: Michael Grzeschik <m.grzesc...@pengutronix.de>

Cc stable ?

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to