public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: "haavard.skinnemoen@atmel.com" <haavard.skinnemoen@atmel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hskinnemoen@atmel.com" <hskinnemoen@atmel.com>,
	"Sosnowski, Maciej" <maciej.sosnowski@intel.com>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>
Subject: Re: [PATCH] dmatest: flush and invalidate destination buffer before DMA
Date: Mon, 05 Jan 2009 18:29:56 -0700	[thread overview]
Message-ID: <4962B414.8010601@intel.com> (raw)
In-Reply-To: <20090106.101425.109407744.nemoto@toshiba-tops.co.jp>

Atsushi Nemoto wrote:
> On Mon, 5 Jan 2009 11:31:57 -0700, "Dan Williams" <dan.j.williams@intel.com> wrote:
> Yes, MIPS and ARM do different thing on partial cache line.  But I
> suppose this belongs to "implementation dependent" area of DMA API so
> users of the API should not depend on it.  (Well, maybe I'm biased to
> MIPS ;-))
> 
> In general, drivers must not put normal data and DMA buffer on same
> cacheline anyway to avoid unexpected writeback and data loss.  So this
> ambiguity is not a problem.  IMHO writeback of the partial line for
> DMA_FROM_DEVICE just _hides_ abusing of the DMA API and potential data
> loss.

Hmm... one implementation does the right thing in all cases.  The other 
silently allows data corruption unless each callsite that accidentally 
or purposely passes cacheline-unaligned buffers adds extra maintenance 
code.  Which implementation are you biased towards now? :-).

--
Dan


  reply	other threads:[~2009-01-06  1:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-26 15:31 [PATCH] dmatest: flush and invalidate destination buffer before DMA Atsushi Nemoto
2008-12-27 10:10 ` Haavard Skinnemoen
2008-12-28 17:53   ` Atsushi Nemoto
2009-01-05 18:31     ` Dan Williams
2009-01-06  1:14       ` Atsushi Nemoto
2009-01-06  1:29         ` Dan Williams [this message]
2009-01-06  2:06           ` Atsushi Nemoto
2009-01-08  4:43       ` Atsushi Nemoto
2009-01-08  8:36         ` Haavard Skinnemoen
2009-01-08 17:20           ` Dan Williams
2009-01-09  8:30             ` Atsushi Nemoto
2009-01-10  0:39               ` Dan Williams
2009-01-09 11:19           ` Ralf Baechle
2009-01-09 22:27             ` Russell King
2009-01-11 18:44               ` Ralf Baechle

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=4962B414.8010601@intel.com \
    --to=dan.j.williams@intel.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.sosnowski@intel.com \
    --cc=ralf@linux-mips.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