From: Michal Simek <michal.simek@petalogix.com>
To: Eli Billauer <eli@billauer.co.il>
Cc: LKML <linux-kernel@vger.kernel.org>, monstr@monstr.eu
Subject: Re: [PATCH] arch/microblaze: Added sync method support for DMA and made refinements
Date: Fri, 09 Sep 2011 11:16:57 +0200 [thread overview]
Message-ID: <4E69D989.20807@petalogix.com> (raw)
In-Reply-To: <4E60F270.4020208@billauer.co.il>
Eli Billauer wrote:
> Michal Simek wrote:
>
>>
>> DMA_TO_DEVICE is fine - data has to be flushed.
>>
>> For DMA_FROM_DEVICE you expect that allocated space will contains data
>> from device.
>> Which means if you flush them, they will be rewritten by DMA in the
>> next step.
>> Which means that IMHO you can invalidate them which is faster than
>> flushing.
> The flushing is only necessary when a certain memory region is written
> to, not flushed, and then allocated for DMA from device. This is not
> what drivers usually do, but it's nevertheless legal to do so. Maybe it
> can also happen as a result of memory being freed but not flushed, and
> then allocated as a DMA buffer. So this flushing prevents, at most, an
> extremely rare problem. I don't expect to see something go wrong right
> away in the lack of this flush.
I prefer to fix the real problems. If you can't see any real problem,
please do not fix theoretical one. I am open to accept your comments
that it is safer to use flush. Look at my second email and add it to 3rd patch.
>
> In light of this, I can't see why flushing would be slower than
> invalidation, if the cache lines aren't expected to be dirty except for
> very rare conditions.
If they are not dirty, flushing/invalidation time should be the same.
But if they are, invalidation is faster.
>
> As for invalidation of a dirty cache line: Looking at the Microblaze
> reference manual's description of the wdc instruction, I'm under the
> impression that each cache line has two flags: Valid and Dirty, as they
> appear in the pseudocode. I'm not on the clear about what happens if a
> dirty cache line is invalidated. It would make sense to clear both
> flags. It also makes sense to write the data back to the RAM in this
> case. But I really don't know what's actually implemented.
AFAIK if a dirty cache line is invalidated data is just removed from flash
and there is not and you do invalidation - CPU using cache lines(on BE) and writing
data to memory. There could be a lot of stall cycles.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
next prev parent reply other threads:[~2011-09-09 9:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 9:31 [PATCH] arch/microblaze: Added sync method support for DMA and made refinements Eli Billauer
2011-09-02 12:32 ` Michal Simek
2011-09-02 15:12 ` Eli Billauer
2011-09-09 9:16 ` Michal Simek [this message]
2011-09-02 15:15 ` [PATCH] Added sync method support for DMA and made refinements (Take II) Eli Billauer
2011-09-09 9:19 ` Michal Simek
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=4E69D989.20807@petalogix.com \
--to=michal.simek@petalogix.com \
--cc=eli@billauer.co.il \
--cc=linux-kernel@vger.kernel.org \
--cc=monstr@monstr.eu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.