From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 15 Jul 2012 10:07:05 +0200 Subject: [U-Boot] [PATCH 2/2] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment In-Reply-To: References: <1341716895-31089-1-git-send-email-marex@denx.de> <1341716895-31089-2-git-send-email-marex@denx.de> Message-ID: <201207151007.06108.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ilya Yanok, > Hi, > > On Sun, Jul 8, 2012 at 7:08 AM, Marek Vasut wrote: > > @@ -207,8 +210,8 @@ static int > > > > ehci_submit_async(struct usb_device *dev, unsigned long pipe, void > > > > *buffer, > > > > int length, struct devrequest *req) > > > > { > > > > - static struct QH qh __attribute__((aligned(32))); > > - static struct qTD qtd[3] __attribute__((aligned (32))); > > + ALLOC_CACHE_ALIGN_BUFFER(struct QH, qh, 1); > > Somehow this doesn't work being allocated on stack... I assumed that this > was declared as static just to use __attribute__((aligned))... Not really ... but then, we have indeed a problem here. It was probably declared static to preserve the contents of these variables across the the calls of this function. Sigh, the USB code is really bloody :-/ Ilya, can you try pulling these out of the function? > but it seems > that current code doesn't like qh address being changed (I'm getting "Timed > out on TD" messages). Any ideas? Changing it to DEFINE_... seems to help > but it looks like hiding another bug. > > Regards, Ilya. Best regards, Marek Vasut