From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment
Date: Sun, 15 Jul 2012 11:42:21 +0200 [thread overview]
Message-ID: <201207151142.21287.marex@denx.de> (raw)
In-Reply-To: <CAA3CPjW9cDG-sOgkmLMT8vwpePBZz5VJRt6bd0qkTtvKmL2Krw@mail.gmail.com>
Dear Ilya Yanok,
> Dear Marek,
>
> On Sun, Jul 15, 2012 at 12:07 PM, Marek Vasut <marex@denx.de> 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 :-/
>
> Hm.. no, I don't think it's about contents... Look, there are memset()
> calls straight in the beginning of the function. It looks like it's about
> qh address: I tried debugging it a bit and it seems to work until qh has
> the same address and break when the address eventually changes.
I see, stupid me. So it's only the address? And I take it the controller doesn't
use those after it leaves the function, right (maybe that might be it) ?
> > Ilya, can you try pulling these out of the function?
>
> I can but what for? Are there any differences (except for scope) declaring
> statics inside or outside function? As I said declaring qh static (with
> DEFINE_CACHE_ALIGN_BUFFER) works but...
>
> Regards, Ilya.
Best regards,
Marek Vasut
next prev parent reply other threads:[~2012-07-15 9:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-08 3:08 [U-Boot] [PATCH 1/2] common.h: Introduce DEFINE_CACHE_ALIGN_BUFFER Marek Vasut
2012-07-08 3:08 ` [U-Boot] [PATCH 2/2] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment Marek Vasut
2012-07-08 10:04 ` Ilya Yanok
2012-07-08 18:51 ` Marek Vasut
2012-07-08 20:52 ` Tom Rini
2012-07-08 21:36 ` Marek Vasut
2012-07-09 18:37 ` Ilya Yanok
2012-07-10 1:55 ` Marek Vasut
2012-07-14 22:11 ` Ilya Yanok
2012-07-14 22:08 ` Ilya Yanok
2012-07-15 8:07 ` Marek Vasut
2012-07-15 8:55 ` Ilya Yanok
2012-07-15 9:42 ` Marek Vasut [this message]
2012-07-08 12:23 ` [U-Boot] [PATCH 1/2] common.h: Introduce DEFINE_CACHE_ALIGN_BUFFER Ilya Yanok
2012-07-08 18:55 ` Marek Vasut
2012-07-20 4:01 ` Mike Frysinger
2012-07-20 11:31 ` Marek Vasut
2012-07-20 21:47 ` Mike Frysinger
2012-07-20 21:50 ` Tom Rini
2012-07-21 17:22 ` Mike Frysinger
2012-07-23 15:24 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201207151142.21287.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox