mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugo Villeneuve <hugo@hugovil.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Jan Kundrát" <jan.kundrat@cesnet.cz>,
	"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
	linux-serial@vger.kernel.org,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: max310x: work around regmap->regcache data corruption
Date: Mon, 4 Dec 2023 15:02:24 -0500	[thread overview]
Message-ID: <20231204150224.add8b07a59bf737edb0b5c1c@hugovil.com> (raw)
In-Reply-To: <f6e93e9c-1c7a-424e-afe0-425b24b99e5c@sirena.org.uk>

On Mon, 4 Dec 2023 19:48:05 +0000
Mark Brown <broonie@kernel.org> wrote:

> On Mon, Dec 04, 2023 at 02:41:36PM -0500, Hugo Villeneuve wrote:
> 
> > But that is not was my question was about. Here a pseudo code
> > example to select "page" 1:
> 
> > 1. save original value of LCR register.
> > 2. write 0xBF to LCR register
> > 3. access desired register in page 1
> > 4. restore original LCR value saved in step 1
> 
> > How do you do that with regmap range?
> 
> Are you saying that the selector has other, non-selector functions?

Yes! There is no bit or bit range in that register that is used to
select a praticular set of registers or "page". It is only when
writing the special magic value of $BF that the IC switches to "page"
1. And if the value is NOT $BF, then it switches back to "page" 0.

When I told you if you could point to other IC/drivers that had the
same configuration, I tough you were aware of this. That explains some
of the confusion.

> This is truly innovative hardware,...

Well, I would not say innovative, but more "crappy" hardware design :)

> ...generally the selector is just a 
> bitfield that you write paging values to.

This is also what I am accustomed to normally.

>  You'd need to extend the core
> so that it knows about this quirk, right now that's not possible and
> we'll just leave the window pointing at whatever was last accessed.

Ok. I am not sure that adding support for it would make sense, since I
do not know of other ICs that could reuse this very specific and
particular method for switching "paged" registers.

Thank you,
Hugo Villeneuve

  reply	other threads:[~2023-12-04 20:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 14:51 Jan Kundrát
2023-12-01 16:14 ` Andy Shevchenko
2023-12-01 16:23   ` Mark Brown
2023-12-01 16:21 ` Mark Brown
2023-12-01 17:02   ` Andy Shevchenko
2023-12-02 10:29     ` Jan Kundrát
2023-12-01 18:27 ` Hugo Villeneuve
2023-12-01 18:34   ` Mark Brown
2023-12-01 21:38     ` Hugo Villeneuve
2023-12-01 21:41       ` Mark Brown
2023-12-01 22:16         ` Hugo Villeneuve
2023-12-04 16:29           ` Hugo Villeneuve
2023-12-04 16:35             ` Mark Brown
2023-12-04 17:01               ` Hugo Villeneuve
2023-12-04 17:19                 ` Mark Brown
2023-12-04 18:59                   ` Hugo Villeneuve
2023-12-04 19:16                     ` Mark Brown
2023-12-04 19:41                       ` Hugo Villeneuve
2023-12-04 19:48                         ` Mark Brown
2023-12-04 20:02                           ` Hugo Villeneuve [this message]
2023-12-04 22:09                             ` Mark Brown
2023-12-05 15:52     ` Hugo Villeneuve
2023-12-05 16:00       ` Mark Brown
2023-12-01 21:40   ` Hugo Villeneuve

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=20231204150224.add8b07a59bf737edb0b5c1c@hugovil.com \
    --to=hugo@hugovil.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=cosmin.tanislav@analog.com \
    --cc=jan.kundrat@cesnet.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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®