public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 3/8] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment
Date: Sun, 15 Jul 2012 19:12:33 +0200	[thread overview]
Message-ID: <201207151912.34183.marex@denx.de> (raw)
In-Reply-To: <CAA3CPjVa+gitHqHeLVJiUuAZwzx_6Vrn=0LQ9nEnc6RxwCw4Dg@mail.gmail.com>

Dear Ilya Yanok,

> Dear Marek,
> 
> On Sun, Jul 15, 2012 at 6:59 PM, Marek Vasut <marex@denx.de> wrote:
> > > index 04300be..59039f4 100644
> > > --- a/drivers/usb/host/ehci-hcd.c
> > > +++ b/drivers/usb/host/ehci-hcd.c
> > > @@ -34,7 +34,10 @@ struct ehci_hccr *hccr;    /* R/O registers, not
> > > need
> > 
> > for
> > 
> > > volatile */ volatile struct ehci_hcor *hcor;
> > > 
> > >  static uint16_t portreset;
> > > 
> > > -static struct QH qh_list __attribute__((aligned(32)));
> > > +DEFINE_ALIGN_BUFFER(struct QH, qh_list, 1, USB_DMA_MINALIGN);
> > > +
> > > +#define ALIGN_END_ADDR(type, ptr, size)                      \
> > > +     ((uint32_t)(ptr) + roundup((size) * sizeof(type),
> > 
> > USB_DMA_MINALIGN))
> > 
> > >  static struct descriptor {
> > >  
> > >       struct usb_hub_descriptor hub;
> > > 
> > > @@ -207,8 +210,9 @@ 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)));
> > > +     /* for some reason this doesn't work with non-static qh */
> > > +     DEFINE_ALIGN_BUFFER(struct QH, qh, 1, USB_DMA_MINALIGN);
> > > 
> > > diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> > 
> > For some reason this doesn't work, but for obvious reason this is NAK.
> > The rest
> > is OK, but this is not. Let's investigate.
> 
> But this was static since the initial EHCI support introduction... the
> patch just preserves the previous behavior.
> I agree we need to find the reason it doesn't work with on-stack qh and fix
> it but it's another problem, not the one these series try to address.

But this is like covering bugs ... the rest of the patches are OK, it's just 
this little detail that annoys me.

> > > +     ALLOC_ALIGN_BUFFER(struct qTD, qtd, 3, USB_DMA_MINALIGN);
> > > 
> > >       int qtd_counter = 0;
> > >       
> > >       volatile struct qTD *vtd;
> > 
> > [...]
> > 
> > I'll poke into this hopefully later today, but if you can try finding
> > something
> > until then, that'd be great :)
> 
> Sorry, I've already lost too much time with this and I won't return to this
> in the near future.

Dunno how much this might motivate you, but this is about my thought now:

http://farm8.staticflickr.com/7138/7456661744_331a4f3535.jpg

I'll try taking over from here though. Thanks for the set and for all your 
investment into this!

> Regards, Ilya.

Best regards,
Marek Vasut

  reply	other threads:[~2012-07-15 17:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-15 14:43 [U-Boot] [PATCH V2 0/8] Fixes to EHCI cache handling & smsc95xx Ilya Yanok
2012-07-15 14:43 ` [U-Boot] [PATCH V2 1/8] ehci-omap: Do not call dcache_off from omap_ehci_hcd_init Ilya Yanok
2012-07-15 14:43 ` [U-Boot] [PATCH V2 2/8] common.h: Introduce DEFINE_CACHE_ALIGN_BUFFER Ilya Yanok
2012-07-15 14:43 ` [U-Boot] [PATCH V2 3/8] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment Ilya Yanok
2012-07-15 14:59   ` Marek Vasut
2012-07-15 15:51     ` Ilya Yanok
2012-07-15 17:12       ` Marek Vasut [this message]
2012-07-16  8:09         ` Ilya Yanok
2012-07-16  8:12           ` [U-Boot] [PATCH] ehci-hcd: program asynclistaddr before every transfer Ilya Yanok
2012-07-16  8:14           ` [U-Boot] [PATCH V2a 3/8] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment Ilya Yanok
2012-07-16 10:47           ` [U-Boot] [PATCH V2 " Marek Vasut
2012-07-17 17:58             ` Ilya Yanok
2012-07-18 12:52           ` Marek Vasut
2012-07-15 14:43 ` [U-Boot] [PATCH V2 4/8] ehci-hcd: fix external buffer cache handling Ilya Yanok
2012-07-16  0:29   ` Marek Vasut
2012-07-15 14:43 ` [U-Boot] [PATCH V2 5/8] usb: pass cache-aligned buffer to usb_get_descriptor() Ilya Yanok
2012-07-15 14:43 ` [U-Boot] [PATCH V2 6/8] usb: check return value of submit_{control, bulk}_msg Ilya Yanok
2012-07-15 14:43 ` [U-Boot] [PATCH V2 7/8] ehci-hcd: change debug() to printf() in case of errors Ilya Yanok
2012-07-15 14:43 ` [U-Boot] [PATCH V2 8/8] smsc95xx: align buffers to cache line size Ilya Yanok

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=201207151912.34183.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