Linux Hexagon architecture development
 help / color / mirror / Atom feed
From: rkuo <rkuo@codeaurora.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ley Foon Tan <lftan@altera.com>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	Chung-Lin Tang <cltang@codesourcery.com>,
	linux-hexagon@vger.kernel.org, Mark Salter <msalter@redhat.com>,
	Aurelien Jacquiot <a-jacquiot@ti.com>,
	linux-c6x-dev@linux-c6x.org
Subject: Re: [PATCH v2 13/29] nios2: DMA mapping API
Date: Mon, 28 Jul 2014 10:48:14 -0500	[thread overview]
Message-ID: <20140728154814.GA9179@codeaurora.org> (raw)
In-Reply-To: <5059148.8xZUvoce2l@wuerfel>

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

  reply	other threads:[~2014-07-28 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1405413956-2772-1-git-send-email-lftan@altera.com>
     [not found] ` <4843763.ps2D25LEeM@wuerfel>
     [not found]   ` <CAFiDJ582FiLAS=B13O3PV_d-FkR31j=5bN_LcXBSWkrGsHK_Gw@mail.gmail.com>
2014-07-24 12:05     ` [PATCH v2 13/29] nios2: DMA mapping API Arnd Bergmann
2014-07-28 15:48       ` rkuo [this message]
2014-07-30  3:42       ` Ley Foon Tan

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=20140728154814.GA9179@codeaurora.org \
    --to=rkuo@codeaurora.org \
    --cc=a-jacquiot@ti.com \
    --cc=arnd@arndb.de \
    --cc=cltang@codesourcery.com \
    --cc=lftan@altera.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msalter@redhat.com \
    /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