public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>, alsa-devel@alsa-project.org
Subject: Re: snd soc spi read/write
Date: Fri, 5 Aug 2011 07:27:02 +0100	[thread overview]
Message-ID: <20110805062702.GA20809@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <s5hbow4peuh.wl%tiwai@suse.de>

On Fri, Aug 05, 2011 at 08:11:34AM +0200, Takashi Iwai wrote:

> The problem is that the current cache code doesn't take care of
> special register-index values like 16_8 case.  In 16-8 case, usually
> only the lower 8 bit indicates the real register index while the upper
> 8 bit is some (usually constant) control bits.  Thus, it worked well
> in the former version by masking with 0xff.

Oh, gods.  If that's what the code is supposed to be doing then clearly
these aren't 16x8 registers at all and it's another case like the step
size stuff where someone's done something cute but fragile and in this
case they didn't even bother to put in a comment so it just looks like
an obvious bug.  We do actually have at least one device with genuine
16x8 registers but fortunately the driver for that never tried to cache
and it's I2C only anyway.

> A quick fix would to introduce again the 0xff masking.  Of course,

I'm more inclined to say that we just don't cache for devices trying to
do this until we've got a sensible model for them, there's probably some
other code that's going to be confused by this in there.

> this isn't a right thing, but would be enough for the current code,
> as regmap will replace in future anyway.

At the minute regmap has no concept of such devices, but at the minute
it's I/O only and so it's not such an issue.  My first instinct is just
to treat these devices as having a sparse register map so probably an
rbtree cache would do the right thing.

      parent reply	other threads:[~2011-08-05  6:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 10:24 snd soc spi read/write Scott Jiang
2011-08-04 10:35 ` Mark Brown
2011-08-05  2:24   ` Scott Jiang
2011-08-05  5:42     ` Mark Brown
2011-08-05  6:26       ` Scott Jiang
2011-08-05  6:34         ` Mark Brown
     [not found]           ` <CAHG8p1BBza_M_Cgrq2O2U+Xc-=rPHeNBKMD_KwfZsLX5Npz9jA@mail.gmail.com>
     [not found]             ` <20110805072908.GA28149@opensource.wolfsonmicro.com>
2011-08-05  8:00               ` Scott Jiang
2011-08-05  8:30                 ` Mark Brown
2011-08-09  3:41                   ` Scott Jiang
2011-08-09 16:04                     ` Mark Brown
2011-08-10 11:54                       ` Takashi Iwai
2011-08-10 14:55                         ` Mark Brown
2011-08-10 15:00                           ` Takashi Iwai
2011-08-10 15:03                             ` Mark Brown
2011-08-10 15:15                               ` Takashi Iwai
2011-08-10 15:34                                 ` Mark Brown
2011-08-10 16:02                                   ` Takashi Iwai
2011-08-11  3:17                                     ` Mark Brown
2011-08-10 21:31                                   ` Lars-Peter Clausen
2011-08-11  0:33                                     ` Mark Brown
2011-08-11  1:50                                       ` Lars-Peter Clausen
2011-08-11  2:46                                         ` Mark Brown
2011-08-11  3:09                                           ` Lars-Peter Clausen
2011-08-11  5:32                                             ` Mark Brown
2011-08-11  6:41                                               ` Lars-Peter Clausen
2011-08-17  9:16                                               ` Dimitris Papastamos
2011-08-05  6:11     ` Takashi Iwai
2011-08-05  6:21       ` Takashi Iwai
2011-08-05  6:27       ` Mark Brown [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=20110805062702.GA20809@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=scott.jiang.linux@gmail.com \
    --cc=tiwai@suse.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