public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM926ejs: Add routines to invalidate D-Cache
Date: Mon, 08 Aug 2011 19:56:46 +0200	[thread overview]
Message-ID: <4E40235E.5030401@aribaud.net> (raw)
In-Reply-To: <201108081934.50668.marek.vasut@gmail.com>

Le 08/08/2011 19:34, Marek Vasut a ?crit :

>> Thinking more about the degenerate case -- why not round *up* the start
>> address, and round *down* the stop address, that is, *reduce* the area
>> to the aligned portion rather than *expand* it into the unknown? That
>> would make data in "partially owned" cache lines safe from unwanted
>> invalidation. OTOH, it would not completely invalidate the caller's
>> data, but at least the malfunction would appear in the faulty calling
>> code, not elsewhere.
>
> That'd introduce even stranger behaviour and it'd be even more sickening to
> debug

I tend to agree neither on the "stranger" part, nor on the "sickening". 
Can you develop your viewpoint? For your reference, here is mine:

As for "stranger": for me, an unexpected value (either a modification or 
an absence thereof) in a variable that no code is using right now, that 
is stranger than an unexpected value in a DMA buffer we just happen to 
have recently invalidated.

As for "sickening": for me, when a bug occurs, one of the requisites is 
to look up the console output, where a message about an unaligned cache 
invalidate address will stand out and quite quickly point at the root 
cause for that weird DMA buffer content problem -- OTOH, with "expanded" 
invalidates, the DMA buffer is OK so one might disregard the warning and 
not link it far later with that weird problem where an obscure global 
variable couldn't keep its value.

I do understand though that I dismissed flush-in-invalidate with an 
argument of "does what it says on the tin", and that one could say my 
proposal makes the function do less of what it says on the tin; my point 
was about the nature of the action, not its extent.

IOW, the sticker on the tin also says "use only with cacheline-aligned 
start and stop", so fair's fair: if you pass unaligned ranges, don't 
expect the invalidate to extend beyond the aligned part.

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-08-08 17:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  3:20 [U-Boot] [PATCH] ARM926ejs: Add routines to invalidate D-Cache Hong Xu
2011-08-08  8:01 ` Albert ARIBAUD
2011-08-08  8:58   ` Hong Xu
2011-08-08 17:34   ` Marek Vasut
2011-08-08 17:56     ` Albert ARIBAUD [this message]
2011-08-09  1:57     ` Hong Xu
2011-08-09 19:55       ` Marek Vasut
2011-08-10  1:45         ` Hong Xu
2011-08-10  2:46           ` Marek Vasut
2011-08-09 11:05     ` Aneesh V
  -- strict thread matches above, loose matches on Subject: below --
2011-08-04  3:45 Hong Xu
2011-08-04  7:11 ` Albert ARIBAUD

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=4E40235E.5030401@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.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