From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 23 Oct 2012 10:31:27 -0600 Subject: [U-Boot] [PATCH v2 1/3] USB: make usb_kbd obey USB DMA alignment requirements In-Reply-To: <201210230926.31221.marex@denx.de> References: <1350971254-11412-1-git-send-email-amartin@nvidia.com> <201210230926.31221.marex@denx.de> Message-ID: <5086C65F.6050305@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/23/2012 01:26 AM, Marek Vasut wrote: > Dear Allen Martin, > >> 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. >> @@ -426,7 +426,7 @@ static int usb_kbd_probe(struct usb_device *dev, >> unsigned int ifnum) >> >> USB_KBD_PRINTF("USB KBD: found set protocol...\n"); >> >> - data = malloc(sizeof(struct usb_kbd_pdata)); >> + data = memalign(USB_DMA_MINALIGN, sizeof(struct usb_kbd_pdata)); > > Don't we have ALLOC_CACHE_ALIGN_BUFFER and such stuff in include/common.h for > this purpose ? That's for stack-based data structures, whereas this data structure sticks around for more than the duration of this function.