linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Biwen Li <biwen.li@nxp.com>
Cc: a.zummo@towertech.it, leoyang.li@nxp.com, broonie@kernel.org,
	nandor.han@vaisala.com, linux-rtc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [v5] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w
Date: Thu, 29 Aug 2019 23:05:54 +0200	[thread overview]
Message-ID: <20190829210554.GN21922@piout.net> (raw)
In-Reply-To: <20190829021418.4607-1-biwen.li@nxp.com>

On 29/08/2019 10:14:18+0800, Biwen Li wrote:
> Issue:
>     - # hwclock -w
>       hwclock: RTC_SET_TIME: Invalid argument
> 
> Why:
>     - Relative commit: 8b9f9d4dc511309918c4f6793bae7387c0c638af, this patch
>       will always check for unwritable registers, it will compare reg
>       with max_register in regmap_writeable.
> 
>     - The pcf85363/pcf85263 has the capability of address wrapping
>       which means if you access an address outside the allowed range
>       (0x00-0x2f) hardware actually wraps the access to a lower address.
>       The rtc-pcf85363 driver will use this feature to configure the time
>       and execute 2 actions in the same i2c write operation (stopping the
>       clock and configure the time). However the driver has also
>       configured the `regmap maxregister` protection mechanism that will
>       block accessing addresses outside valid range (0x00-0x2f).
> 
> How:
>     - Split of writing regs to two parts, first part writes control
>       registers about stop_enable and resets, second part writes
>       RTC time and date registers.
> 
> Signed-off-by: Biwen Li <biwen.li@nxp.com>
> ---
> Change in v5:
> 	- drop robust explanation
> 
> Change in v4:
> 	- use old scheme
> 	- replace link to lkml.org with commit
> 	- add proper explanation
> 
> Change in v3:
> 	- replace old scheme with new scheme:
> 	  increase max_register.
> 
> Change in v2:
> 	- add Why and How into commit message.
> 
>  drivers/rtc/rtc-pcf85363.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2019-08-29 21:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29  2:14 [v5] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w Biwen Li
2019-08-29  6:45 ` Nandor Han
2019-08-29 21:05 ` Alexandre Belloni [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=20190829210554.GN21922@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=biwen.li@nxp.com \
    --cc=broonie@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=nandor.han@vaisala.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).