mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: regcache_sync() errors for read-only registers cache
Date: Tue, 03 Mar 2015 23:00:03 +0100	[thread overview]
Message-ID: <s5hpp8p7ndo.wl-tiwai@suse.de> (raw)
In-Reply-To: <20150303200426.GF21293@sirena.org.uk>

At Tue, 3 Mar 2015 20:04:26 +0000,
Mark Brown wrote:
> 
> On Tue, Mar 03, 2015 at 04:33:21PM +0100, Takashi Iwai wrote:
> > Mark Brown wrote:
> 
> > > Why should adding something to the defaults hurt performance (it should
> > > just be a one time cost to insert the default which we've got a
> > > reasonable chance of making back later)?  I guess if there's a lot of
> > > these registers it'll add up but they're pretty rare, usually it's a few
> > > ID and revision registers and anything else is volatile so wouldn't get
> > > cached at all.
> 
> > I caught this bug because of the currently developed HD-audio regmap
> > support that has lots of read-only stuff (mostly for parameters, dozen
> > of such per each widget node).  Registers range of 32bit wide and
> > there are no static default values that can be stored in a flat
> > table.  Nasty, eh?  I'll be glad if any better workaround is present
> > in regmap.
> 
> Well, if they're quick to read marking them as volatile to avoid the
> cache would be the obvious thing, or not caring about writeability.

Reading is much slower than writing due to sync.

> You can also specify num_reg_defaults_raw with no defaults table and
> it'll read the hardware in one fell swoop, though that would need some
> improvement for sparse registers and probably won't do the right thing
> for the other registers either (it's a bit specialist for PMICs).

For HD-audio, we can't read the whole verbs beforehand because we
don't know exactly which verbs will be used until the whole parsing is
done and the state changes.  So, the best option is just caching the
read-only parameters.

> > I can resend the patch if you prefer, of course, if the original patch
> > is OK.  Just let me know.
> 
> Yes, please resend - I'd guess you want to fix the block case too?

OK, will resend later together with the block raw fix.


Takashi

      reply	other threads:[~2015-03-03 22:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 12:59 Takashi Iwai
2015-03-02 18:24 ` Mark Brown
2015-03-02 19:15   ` Takashi Iwai
2015-03-03  9:09     ` Mark Brown
2015-03-03  9:22       ` Takashi Iwai
2015-03-03 14:54         ` Mark Brown
2015-03-03 15:33           ` Takashi Iwai
2015-03-03 20:04             ` Mark Brown
2015-03-03 22:00               ` Takashi Iwai [this message]

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=s5hpp8p7ndo.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®