From: x0082077@ti.com (Maulik)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb: musb: host: Issue a memory barrier before staring the DMA
Date: Thu, 5 Aug 2010 18:24:31 +0530 [thread overview]
Message-ID: <001201cb349d$5bb96e60$808918ac@apr.dhcp.ti.com> (raw)
In-Reply-To: <4C5AB13F.8060706@ru.mvista.com>
> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov at mvista.com]
> Sent: Thursday, August 05, 2010 6:11 PM
> To: Santosh Shilimkar
> Cc: linux-usb at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> Maulik Mankad; Russell King; Felipe Balbi
> Subject: Re: [PATCH] usb: musb: host: Issue a memory barrier before
> staring the DMA
>
> Hello.
>
> Santosh Shilimkar wrote:
>
> > This patch fixes the issue which was observed while transfering
> > a large file ( > 20MB) over USB (OMAP MUSB controller acts as USB host)
> > to an attached USB thumb drive.
>
> > It was found that CDB field of CBW packet was set to 0x0. This was
> > due to missing a barrier before DMA engine starts transfer.
> > This buffer is allocated using dma_alloc_coherent which gives
> > non-cacheble but bufferable memory and hence needed a write
> > memory barrier to flush the write buffer.
>
> > More info on this thread is here:
> > http://www.spinics.net/lists/linux-omap/msg33987.html
>
> > Signed-off-by: Maulik Mankad <x0082077@ti.com>
> > Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> > Cc: Felipe Balbi <felipebalbi@users.sourceforge.net>
> > ---
> > drivers/usb/musb/musb_host.c | 6 ++++++
> > 1 files changed, 6 insertions(+), 0 deletions(-)
>
> > Index: omap4_integration/drivers/usb/musb/musb_host.c
> > ===================================================================
> > --- omap4_integration.orig/drivers/usb/musb/musb_host.c
> > +++ omap4_integration/drivers/usb/musb/musb_host.c
> > @@ -628,6 +628,11 @@ static bool musb_tx_dma_program(struct d
> > u8 mode;
> >
> > #ifdef CONFIG_USB_INVENTRA_DMA
> > + /*
> > + * Ensure the data reaches to main memory before starting
> > + * DMA transfer
> > + */
> > + wmb();
>
> Are you sure this is only needed for Inventra DMA?
Yes. This is seen only on SMP system such as OMAP4 which uses Inventra DMA.
We did not see the issue when SMP is disabled.
Regards,
Maulik
next prev parent reply other threads:[~2010-08-05 12:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 9:53 [PATCH] usb: musb: host: Issue a memory barrier before staring the DMA Santosh Shilimkar
2010-08-05 12:40 ` Sergei Shtylyov
2010-08-05 12:54 ` Maulik [this message]
2010-08-05 13:12 ` Russell King - ARM Linux
2010-08-05 13:27 ` Shilimkar, Santosh
2010-08-05 15:03 ` Alan Stern
2010-08-05 15:10 ` Shilimkar, Santosh
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='001201cb349d$5bb96e60$808918ac@apr.dhcp.ti.com' \
--to=x0082077@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).