From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 22 Oct 2012 15:59:43 -0600 Subject: [U-Boot] [PATCH 1/2] USB: make usb_kbd obey USB DMA alignment requirements In-Reply-To: <1350941971-10282-1-git-send-email-amartin@nvidia.com> References: <1350941971-10282-1-git-send-email-amartin@nvidia.com> Message-ID: <5085C1CF.4000805@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/22/2012 03:39 PM, Allen Martin wrote: > Change usb_kbd driver to obey alignment requirements for USB DMA on > the buffer used for data transfer. This is necessary for > architectures that enable dcache and enable USB DMA. > diff --git a/common/usb_kbd.c b/common/usb_kbd.c > struct usb_kbd_pdata { > + uint8_t new[8]; > + uint8_t old[8]; > + > uint32_t repeat_delay; > > uint32_t usb_in_pointer; > uint32_t usb_out_pointer; > uint8_t usb_kbd_buffer[USB_KBD_BUFFER_LEN]; > > - uint8_t new[8]; > - uint8_t old[8]; > - > uint8_t flags; > -}; > +} __aligned(USB_DMA_MINALIGN); Surely you need to edit the malloc() call in usb_kbd_probe() instead of adding __aligned to the type; does the alignment on the type really get propagated into malloc(), or as custom code at the call-site somehow?