All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Mark Brown <broonie@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>, Lee Jones <lee.jones@linaro.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>
Subject: Re: [PATCH v2 2/2] mfd: axp20x: Fix AXP806 access errors on cold boot
Date: Tue, 3 Jan 2017 11:54:08 +0800	[thread overview]
Message-ID: <CAGb2v64U1adw6Y8Sq6Ysi5VQicGY=TWCNvbydcqKAPjXXG4uxg@mail.gmail.com> (raw)
In-Reply-To: <20161214174053.qsm6umlgtdivevwt@sirena.org.uk>

On Thu, Dec 15, 2016 at 1:40 AM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Dec 14, 2016 at 09:52:31PM +0800, Chen-Yu Tsai wrote:
>
>> What this patch does is make sure the registers match, to guarantee
>> access, and then reinitialize the regmap cache to get rid of any
>> stale data.
>
> So what you're saying is that previous writes may have been ignored?

Sorry for the late reply.

Yes, any previous reads and writes may have been ignored. I'm not sure
if regmap cache prefetches any registers. Last I checked it didn't.

>> > If the chip has been reset then you'd want to reset the cache too.  I've
>> > no idea if that's needed here or not though, it depends what happens to
>> > the global state of the chip when this reconfiguration happens.
>
>> It is not a reset in the general sense. I suppose a better way would
>> be to do an explicit write to the register first, then initialize
>> the regmap. I'd have to export the write function from the RSB bus
>> driver first though.
>
> Surely just doing a write immediately after initializing the regmap
> would have the same effect?  That'd ensure that the hardware has the
> desired value before there are any other writes.  But I might be missing
> something here.

So I just tested this. Dropping both the regcache_sync_region() and
regmap_reinit_cache() is ok.

I'll send a revised patch.

ChenYu

WARNING: multiple messages have this Message-ID (diff)
From: wens@csie.org (Chen-Yu Tsai)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] mfd: axp20x: Fix AXP806 access errors on cold boot
Date: Tue, 3 Jan 2017 11:54:08 +0800	[thread overview]
Message-ID: <CAGb2v64U1adw6Y8Sq6Ysi5VQicGY=TWCNvbydcqKAPjXXG4uxg@mail.gmail.com> (raw)
In-Reply-To: <20161214174053.qsm6umlgtdivevwt@sirena.org.uk>

On Thu, Dec 15, 2016 at 1:40 AM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Dec 14, 2016 at 09:52:31PM +0800, Chen-Yu Tsai wrote:
>
>> What this patch does is make sure the registers match, to guarantee
>> access, and then reinitialize the regmap cache to get rid of any
>> stale data.
>
> So what you're saying is that previous writes may have been ignored?

Sorry for the late reply.

Yes, any previous reads and writes may have been ignored. I'm not sure
if regmap cache prefetches any registers. Last I checked it didn't.

>> > If the chip has been reset then you'd want to reset the cache too.  I've
>> > no idea if that's needed here or not though, it depends what happens to
>> > the global state of the chip when this reconfiguration happens.
>
>> It is not a reset in the general sense. I suppose a better way would
>> be to do an explicit write to the register first, then initialize
>> the regmap. I'd have to export the write function from the RSB bus
>> driver first though.
>
> Surely just doing a write immediately after initializing the regmap
> would have the same effect?  That'd ensure that the hardware has the
> desired value before there are any other writes.  But I might be missing
> something here.

So I just tested this. Dropping both the regcache_sync_region() and
regmap_reinit_cache() is ok.

I'll send a revised patch.

ChenYu

  reply	other threads:[~2017-01-03  3:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  3:16 [PATCH v2 0/2] mfd: axp20x: Fix AXP806 access errors on cold boot Chen-Yu Tsai
2016-11-23  3:16 ` Chen-Yu Tsai
2016-11-23  3:16 ` [PATCH v2 1/2] mfd: axp20x: Add address extension registers for AXP806 regmap Chen-Yu Tsai
2016-11-23  3:16   ` Chen-Yu Tsai
2016-12-09 11:05   ` Lee Jones
2016-12-09 11:05     ` Lee Jones
2016-11-23  3:16 ` [PATCH v2 2/2] mfd: axp20x: Fix AXP806 access errors on cold boot Chen-Yu Tsai
2016-11-23  3:16   ` Chen-Yu Tsai
2016-12-09 11:20   ` Lee Jones
2016-12-09 11:20     ` Lee Jones
2016-12-13 16:47     ` Mark Brown
2016-12-13 16:47       ` Mark Brown
2016-12-14 13:52       ` Chen-Yu Tsai
2016-12-14 13:52         ` Chen-Yu Tsai
2016-12-14 17:40         ` Mark Brown
2016-12-14 17:40           ` Mark Brown
2017-01-03  3:54           ` Chen-Yu Tsai [this message]
2017-01-03  3:54             ` Chen-Yu Tsai

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='CAGb2v64U1adw6Y8Sq6Ysi5VQicGY=TWCNvbydcqKAPjXXG4uxg@mail.gmail.com' \
    --to=wens@csie.org \
    --cc=broonie@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    /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.