[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140728154814.GA9179@codeaurora.org>
Date: Mon, 28 Jul 2014 10:48:14 -0500
From: rkuo <rkuo@...eaurora.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Ley Foon Tan <lftan@...era.com>,
Linux-Arch <linux-arch@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Chung-Lin Tang <cltang@...esourcery.com>,
linux-hexagon@...r.kernel.org, Mark Salter <msalter@...hat.com>,
Aurelien Jacquiot <a-jacquiot@...com>,
linux-c6x-dev@...ux-c6x.org
Subject: Re: [PATCH v2 13/29] nios2: DMA mapping API
On Thu, Jul 24, 2014 at 02:05:16PM +0200, Arnd Bergmann wrote:
> > >> +void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
> > >> + size_t size, enum dma_data_direction direction)
> > >> +{
> > >> + BUG_ON(!valid_dma_direction(direction));
> > >> +
> > >> + __dma_sync(phys_to_virt(dma_handle), size, direction);
> > >> +}
> > >> +EXPORT_SYMBOL(dma_sync_single_for_cpu);
> > >> +
> > >> +void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
> > >> + size_t size, enum dma_data_direction direction)
> > >> +{
> > >> + BUG_ON(!valid_dma_direction(direction));
> > >> +
> > >> + __dma_sync(phys_to_virt(dma_handle), size, direction);
> > >> +}
> > >> +EXPORT_SYMBOL(dma_sync_single_for_device);
> > >
> > > More importantly: you do the same operation for both _for_cpu and _for_device.
> > > I assume your CPU can never do speculative cache prefetches, so it's not
> > > incorrect, but you do twice the number of invalidations and flushes that
> > > you need.
> > >
> > > Why would you do anything for _for_cpu here?
> > I am a bit confused for _for_cpu and _for_device here. I found some
> > architectures like c6x and hexagon have same operation for both
> > _for_cpu and _for_device as well.
>
> (adding their maintainers to cc)
>
> Yes, you are right, they seem to have the same bug and could see a noticeable
> DMA performance improvement if they change it as well.
>
Yep that's a bug. Thanks for pointing this out.
-Richard Kuo
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists