Re: [v5] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-29 Thread Alexandre Belloni
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

Re: [v5] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-28 Thread Nandor Han
On 8/29/19 5:14 AM, 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 regma

[v5] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-28 Thread Biwen Li
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 h

RE: [EXT] Re: [v4] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-27 Thread Biwen Li
> > On 8/27/19 7:37 AM, Biwen Li wrote: > > - In drivers/rtc/rtc-pcf85363.c, CTRL_STOP_EN is 0x2e, but DT_100THS > >is 0, max_regiter is 0x2f, then reg will be equal to 0x30, > >'0x30 < 0x2f' is false,so regmap_writeable will return false. > > > > - The pcf85363/pcf85263 has

Re: [v4] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-27 Thread Nandor Han
On 8/27/19 7:37 AM, Biwen Li wrote: - In drivers/rtc/rtc-pcf85363.c, CTRL_STOP_EN is 0x2e, but DT_100THS is 0, max_regiter is 0x2f, then reg will be equal to 0x30, '0x30 < 0x2f' is false,so regmap_writeable will return false. - The pcf85363/pcf85263 has the capability of add

[v4] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-26 Thread Biwen Li
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. - In drivers/rtc/rtc-pcf8

RE: [EXT] Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-26 Thread Biwen Li
> > Hi, > > On 26/08/2019 09:49:49+, Biwen Li wrote: > > > > > > On 8/26/19 7:29 AM, Biwen Li wrote: > > > >> > > > >> On 8/16/19 10:40 PM, Li Yang wrote: > > > >>> On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni > > > >>> wrote: > > > > > > On 16/08/2019 10:50:49-0500, Li Yang

Re: [EXT] Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-26 Thread Alexandre Belloni
Hi, On 26/08/2019 09:49:49+, Biwen Li wrote: > > > > On 8/26/19 7:29 AM, Biwen Li wrote: > > >> > > >> On 8/16/19 10:40 PM, Li Yang wrote: > > >>> On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni > > >>> wrote: > > > > On 16/08/2019 10:50:49-0500, Li Yang wrote: > > > On Fri,

RE: [EXT] Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-26 Thread Biwen Li
> > On 8/26/19 7:29 AM, Biwen Li wrote: > >> > >> On 8/16/19 10:40 PM, Li Yang wrote: > >>> On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni > >>> wrote: > > On 16/08/2019 10:50:49-0500, Li Yang wrote: > > On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni > > wrote: > >>

Re: [EXT] Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-26 Thread Nandor Han
On 8/26/19 7:29 AM, Biwen Li wrote: On 8/16/19 10:40 PM, Li Yang wrote: On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni wrote: On 16/08/2019 10:50:49-0500, Li Yang wrote: On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni wrote: On 16/08/2019 10:46:36+0800, Biwen Li wrote: Issue:

[v3] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-25 Thread Biwen Li
Issue: - hwclock -w hwclock: RTC_SET_TIME: Invalid argument Why: - Relative patch: https://lkml.org/lkml/2019/4/3/55 , this patch will always check for unwritable registers, it will compare reg with max_register in regmap_writeable. - In drivers/rtc/rtc-pcf85363.c, CT

RE: [EXT] Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-25 Thread Biwen Li
> > On 8/16/19 10:40 PM, Li Yang wrote: > > On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni > > wrote: > >> > >> On 16/08/2019 10:50:49-0500, Li Yang wrote: > >>> On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni > >>> wrote: > > On 16/08/2019 10:46:36+0800, Biwen Li wrote: > >

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-21 Thread Mark Brown
On Wed, Aug 21, 2019 at 01:38:56PM +0200, Alexandre Belloni wrote: > On 21/08/2019 12:30:29+0100, Mark Brown wrote: > > What's the mechanism here? It's a very strange thing to require. > The clock control is on the first register, then you have sec, min, > hour, day, mon, year. > To be able to

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-21 Thread Alexandre Belloni
On 21/08/2019 12:30:29+0100, Mark Brown wrote: > On Wed, Aug 21, 2019 at 01:24:13PM +0200, Alexandre Belloni wrote: > > On 21/08/2019 12:21:42+0100, Mark Brown wrote: > > > On Tue, Aug 20, 2019 at 01:33:14PM -0500, Li Yang wrote: > > > > > violation check of regmap rejects such access. According

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-21 Thread Mark Brown
On Wed, Aug 21, 2019 at 01:24:13PM +0200, Alexandre Belloni wrote: > On 21/08/2019 12:21:42+0100, Mark Brown wrote: > > On Tue, Aug 20, 2019 at 01:33:14PM -0500, Li Yang wrote: > > > violation check of regmap rejects such access. According to > > > Alexcandre, the address wrapping is essential to

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-21 Thread Alexandre Belloni
On 21/08/2019 12:21:42+0100, Mark Brown wrote: > On Tue, Aug 20, 2019 at 01:33:14PM -0500, Li Yang wrote: > > > Some of the RTC hardware has the capability of address wrapping which > > means if you access a continuous address range across a certain > > boundary(could be the boundary of a regmap r

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-21 Thread Mark Brown
On Tue, Aug 20, 2019 at 01:33:14PM -0500, Li Yang wrote: > Some of the RTC hardware has the capability of address wrapping which > means if you access a continuous address range across a certain > boundary(could be the boundary of a regmap region) the hardware > actually wrap the access to a lower

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-20 Thread Nandor Han
On 8/16/19 10:40 PM, Li Yang wrote: On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni wrote: On 16/08/2019 10:50:49-0500, Li Yang wrote: On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni wrote: On 16/08/2019 10:46:36+0800, Biwen Li wrote: Issue: - # hwclock -w hwclock: RTC_SE

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-20 Thread Li Yang
On Tue, Aug 20, 2019 at 1:24 PM Mark Brown wrote: > > On Fri, Aug 16, 2019 at 02:40:47PM -0500, Li Yang wrote: > > On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni > > > > Most of the i2c RTCs do address wrapping which is sometimes the only way > > > to properly set the time. > > > Adding Mark a

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-20 Thread Mark Brown
On Fri, Aug 16, 2019 at 02:40:47PM -0500, Li Yang wrote: > On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni > > Most of the i2c RTCs do address wrapping which is sometimes the only way > > to properly set the time. > Adding Mark and Nandor to the loop. Is there a specific question or something

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-16 Thread Li Yang
On Fri, Aug 16, 2019 at 11:30 AM Alexandre Belloni wrote: > > On 16/08/2019 10:50:49-0500, Li Yang wrote: > > On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni > > wrote: > > > > > > On 16/08/2019 10:46:36+0800, Biwen Li wrote: > > > > Issue: > > > > - # hwclock -w > > > > hwclock: RTC_

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-16 Thread Alexandre Belloni
On 16/08/2019 10:50:49-0500, Li Yang wrote: > On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni > wrote: > > > > On 16/08/2019 10:46:36+0800, Biwen Li wrote: > > > Issue: > > > - # hwclock -w > > > hwclock: RTC_SET_TIME: Invalid argument > > > > > > Why: > > > - Relative patch: https

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-16 Thread Li Yang
On Fri, Aug 16, 2019 at 3:05 AM Alexandre Belloni wrote: > > On 16/08/2019 10:46:36+0800, Biwen Li wrote: > > Issue: > > - # hwclock -w > > hwclock: RTC_SET_TIME: Invalid argument > > > > Why: > > - Relative patch: https://lkml.org/lkml/2019/4/3/55 , this patch > > will always

Re: [v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-16 Thread Alexandre Belloni
On 16/08/2019 10:46:36+0800, Biwen Li wrote: > Issue: > - # hwclock -w > hwclock: RTC_SET_TIME: Invalid argument > > Why: > - Relative patch: https://lkml.org/lkml/2019/4/3/55 , this patch > will always check for unwritable registers, it will compare reg > with max_regist

[v2] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-15 Thread Biwen Li
Issue: - # hwclock -w hwclock: RTC_SET_TIME: Invalid argument Why: - Relative patch: https://lkml.org/lkml/2019/4/3/55 , this patch will always check for unwritable registers, it will compare reg with max_register in regmap_writeable. - In drivers/rtc/rtc-pcf85363.c,

RE: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-15 Thread Biwen Li
> > > > Subject: rtc: pcf85363/pcf85263: fix error that failed to run > > > > hwclock -w > > > > > > > > Issue: > > > > # hwclock -w > > > > hwclock: RTC_SET_TIME: Invalid argument > > > > > >

RE: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-15 Thread Leo Li
or that failed to run hwclock -w > > > > Subject: rtc: pcf85363/pcf85263: fix error that failed to run > > > hwclock -w > > > > > > Issue: > > > # hwclock -w > > > hwclock: RTC_SET_TIME: Invalid argument > > > > > > Th

RE: [EXT] Re: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-14 Thread Biwen Li
> Caution: EXT Email > > Hi, > > On 14/08/2019 17:32:49+0800, Biwen Li wrote: > > Issue: > > # hwclock -w > > hwclock: RTC_SET_TIME: Invalid argument > > > > The patch fixes error when run command hwclock -w with rtc > > pcf85363/pcf85263 > > > > Could you describe a bit more the issue a

RE: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-14 Thread Biwen Li
> > Subject: rtc: pcf85363/pcf85263: fix error that failed to run hwclock > > -w > > > > Issue: > > # hwclock -w > > hwclock: RTC_SET_TIME: Invalid argument > > > > The patch fixes error when run command hwclock -w with rtc > > pcf85

RE: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-14 Thread Leo Li
> -Original Message- > From: Biwen Li > Sent: Wednesday, August 14, 2019 4:33 AM > To: a.zu...@towertech.it; alexandre.bell...@bootlin.com; Leo Li > > Cc: linux-...@vger.kernel.org; linux-kernel@vger.kernel.org; Biwen Li > > Subject: rtc: pcf85363/pcf85263:

Re: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-14 Thread Alexandre Belloni
Hi, On 14/08/2019 17:32:49+0800, Biwen Li wrote: > Issue: > # hwclock -w > hwclock: RTC_SET_TIME: Invalid argument > > The patch fixes error when run command hwclock -w > with rtc pcf85363/pcf85263 > Could you describe a bit more the issue and what causes it? IIRC I wrote that code and

rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w

2019-08-14 Thread Biwen Li
Issue: # hwclock -w hwclock: RTC_SET_TIME: Invalid argument The patch fixes error when run command hwclock -w with rtc pcf85363/pcf85263 Signed-off-by: Biwen Li --- drivers/rtc/rtc-pcf85363.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-pcf85