mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: olh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: consistent_sync_for_cpu() and friends on ppc32
Date: Mon, 15 Mar 2004 16:49:17 -0800	[thread overview]
Message-ID: <20040315164917.6a85966b.davem@redhat.com> (raw)
In-Reply-To: <1079396621.1967.196.camel@gaston>

On Tue, 16 Mar 2004 11:23:42 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> BTW, I missed your explanation in the first place, but why wouldn't
> the "direction" field be enough ? I'm not sure if I need a different
> implementation here...

Direction says something different.  It says which direction the DMA
goes, whilst these interfaces say who wishes to have ownership of the
buffer now.

Consider this example, and how one might implement this on a system with
cpu caches which are not coherent with main memory nor devices.

1) User prepares buffer X with data.
2) pci_map_single(X, TO_DEVICE)
3) Device does DMA, interrupts cpu.
4) pci_dma_sync_single_for_cpu(X)
5) Write new contents.
6) pci_dma_sync_single_for_device(X)
7) Device does DMA again, interrupts cpu.
8) ...

Step 2 would writeback flush the cpu cache, step 4 would be a NOP,
step 6 would writeback flush the cpu cache.

The direction does not provide enough information to do these operations
with the right amount of information.

  reply	other threads:[~2004-03-16  0:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 20:16 Olaf Hering
2004-03-15 20:36 ` David S. Miller
2004-03-15 21:59   ` Benjamin Herrenschmidt
2004-03-16  0:23   ` Benjamin Herrenschmidt
2004-03-16  0:49     ` David S. Miller [this message]
2004-03-16  1:36       ` Benjamin Herrenschmidt
2004-03-16 18:46         ` David S. Miller
2004-03-16 21:54           ` Benjamin Herrenschmidt

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=20040315164917.6a85966b.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olh@suse.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

all inboxes | Powered by JetHome®