All of lore.kernel.org
 help / color / mirror / Atom feed
From: daniel@caiaq.de (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: Using of cached values
Date: Sat, 20 Mar 2010 10:44:25 +0100	[thread overview]
Message-ID: <20100320094425.GB30801@buzzloop.caiaq.de> (raw)
In-Reply-To: <2703439e1003200222y16147d81x27b0a8bcc804c338@mail.gmail.com>

On Sat, Mar 20, 2010 at 06:22:43PM +0900, Mogambo Park wrote:
>   I wants to know - How safe to read register values one time in a structure
> and use value from there, assume no write is performed on the
> register? I see many
> files in sound/soc/codec/ do that.

Why shouldn't that be safe? Do you expect your cache to get lost?

> is it becos sometime the register may return not accurate value on
> busy bus by h/w mistake?
> OR I should always read from register even if his value is not
> expected to change?

If the register content does not change, you can use a cached value.
That can be a lot faster and less power-consuming than going over the
bus and reading from the device. Depending on the bus in use and how
often you do that of course.

Daniel

  reply	other threads:[~2010-03-20  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-20  9:22 Using of cached values Mogambo Park
2010-03-20  9:44 ` Daniel Mack [this message]
2010-03-22  0:58 ` Haojian Zhuang

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=20100320094425.GB30801@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=linux-arm-kernel@lists.infradead.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 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.