Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning
@ 2020-05-08  5:49 Biwen Li
  2020-05-08  5:49 ` [PATCH 2/3] dts: ppc: t4240rdb: " Biwen Li
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Biwen Li @ 2020-05-08  5:49 UTC (permalink / raw)
  To: leoyang.li, robh+dt, mpe, benh, a.zummo, alexandre.belloni
  Cc: devicetree, linuxppc-dev, linux-kernel, linux-rtc, Biwen Li

From: Biwen Li <biwen.li@nxp.com>

Add uie_unsupported property to drop warning as follows:
    - $ hwclock.util-linux
      hwclock.util-liux: select() /dev/rtc0
      to wait for clock tick timed out

My case:
    - RTC ds1374's INT pin is connected to VCC on T4240RDB,
      then the RTC cannot inform cpu about the alarm
      interrupt

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 drivers/rtc/rtc-ds1374.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 9c51a12cf70f..e530e887a17e 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -651,6 +651,10 @@ static int ds1374_probe(struct i2c_client *client,
 	if (ret)
 		return ret;
 
+	if (of_property_read_bool(client->dev.of_node,
+						 "uie_unsupported"))
+		ds1374->rtc->uie_unsupported = true;
+
 #ifdef CONFIG_RTC_DRV_DS1374_WDT
 	save_client = client;
 	ret = misc_register(&ds1374_miscdev);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/3] dts: ppc: t4240rdb: add uie_unsupported property to drop warning
  2020-05-08  5:49 [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning Biwen Li
@ 2020-05-08  5:49 ` Biwen Li
  2020-05-08 11:50   ` Alexandre Belloni
  2020-05-08  5:49 ` [PATCH 3/3] dts: ppc: t1024rdb: add wakeup-source " Biwen Li
  2020-05-08 11:49 ` [PATCH 1/3] rtc: ds1374: add uie_unsupported " Alexandre Belloni
  2 siblings, 1 reply; 7+ messages in thread
From: Biwen Li @ 2020-05-08  5:49 UTC (permalink / raw)
  To: leoyang.li, robh+dt, mpe, benh, a.zummo, alexandre.belloni
  Cc: devicetree, linuxppc-dev, linux-kernel, linux-rtc, Biwen Li

From: Biwen Li <biwen.li@nxp.com>

This adds uie_unsupported property to drop warning as follows:
    - $ hwclock.util-linux
      hwclock.util-linux: select() to /dev/rtc0
      to wait for clock tick timed out

My case:
    - RTC ds1374's INT pin is connected to VCC on T4240RDB,
      then the RTC cannot inform cpu about the alarm interrupt

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/powerpc/boot/dts/fsl/t4240rdb.dts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/dts/fsl/t4240rdb.dts b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
index a56a705d41f7..ccdd10202e56 100644
--- a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
@@ -144,7 +144,11 @@
 			rtc@68 {
 				compatible = "dallas,ds1374";
 				reg = <0x68>;
-				interrupts = <0x1 0x1 0 0>;
+				// The ds1374's INT pin isn't
+				// connected to cpu's INT pin,
+				// so the rtc cannot synchronize
+				// clock tick per second.
+				uie_unsupported;
 			};
 		};
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/3] dts: ppc: t1024rdb: add wakeup-source property to drop warning
  2020-05-08  5:49 [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning Biwen Li
  2020-05-08  5:49 ` [PATCH 2/3] dts: ppc: t4240rdb: " Biwen Li
@ 2020-05-08  5:49 ` Biwen Li
  2020-05-08 11:49 ` [PATCH 1/3] rtc: ds1374: add uie_unsupported " Alexandre Belloni
  2 siblings, 0 replies; 7+ messages in thread
From: Biwen Li @ 2020-05-08  5:49 UTC (permalink / raw)
  To: leoyang.li, robh+dt, mpe, benh, a.zummo, alexandre.belloni
  Cc: devicetree, linuxppc-dev, linux-kernel, linux-rtc, Biwen Li

From: Biwen Li <biwen.li@nxp.com>

This adds wakeup-source property to drop warning as follows:
    - $ hwclock.util-linux
      hwclock.util-linux: select() to /dev/rtc0
      to wait for clock tick timed out

My case:
    - RTC ds1339s INT pin isn't connected to cpus INT pin on T1024RDB,
      then the RTC cannot inform cpu about alarm interrupt

How to fix it?
    - add wakeup-source property and remove IRQ line
      to set uie_unsupported flag

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/powerpc/boot/dts/fsl/t1024rdb.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/dts/fsl/t1024rdb.dts b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
index 645caff98ed1..191cbf5cda4e 100644
--- a/arch/powerpc/boot/dts/fsl/t1024rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
@@ -161,7 +161,7 @@
 			rtc@68 {
 				compatible = "dallas,ds1339";
 				reg = <0x68>;
-				interrupts = <0x1 0x1 0 0>;
+				wakeup-source;
 			};
 		};
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning
  2020-05-08  5:49 [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning Biwen Li
  2020-05-08  5:49 ` [PATCH 2/3] dts: ppc: t4240rdb: " Biwen Li
  2020-05-08  5:49 ` [PATCH 3/3] dts: ppc: t1024rdb: add wakeup-source " Biwen Li
@ 2020-05-08 11:49 ` Alexandre Belloni
  2020-05-08 11:59   ` Biwen Li (OSS)
  2 siblings, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2020-05-08 11:49 UTC (permalink / raw)
  To: Biwen Li
  Cc: leoyang.li, robh+dt, mpe, benh, a.zummo, devicetree,
	linuxppc-dev, linux-kernel, linux-rtc, Biwen Li

Hi,

On 08/05/2020 13:49:23+0800, Biwen Li wrote:
> From: Biwen Li <biwen.li@nxp.com>
> 
> Add uie_unsupported property to drop warning as follows:
>     - $ hwclock.util-linux
>       hwclock.util-liux: select() /dev/rtc0
>       to wait for clock tick timed out
> 
> My case:
>     - RTC ds1374's INT pin is connected to VCC on T4240RDB,
>       then the RTC cannot inform cpu about the alarm
>       interrupt
> 
> Signed-off-by: Biwen Li <biwen.li@nxp.com>
> ---
>  drivers/rtc/rtc-ds1374.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
> index 9c51a12cf70f..e530e887a17e 100644
> --- a/drivers/rtc/rtc-ds1374.c
> +++ b/drivers/rtc/rtc-ds1374.c
> @@ -651,6 +651,10 @@ static int ds1374_probe(struct i2c_client *client,
>  	if (ret)
>  		return ret;
>  
> +	if (of_property_read_bool(client->dev.of_node,
> +						 "uie_unsupported"))
> +		ds1374->rtc->uie_unsupported = true;
> +

This is not how this is supposed to work, either the RTC support uie or
don't, it is not board dependent and certainly doesn't require an
(undocumented) DT property.

>  #ifdef CONFIG_RTC_DRV_DS1374_WDT
>  	save_client = client;
>  	ret = misc_register(&ds1374_miscdev);
> -- 
> 2.17.1
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] dts: ppc: t4240rdb: add uie_unsupported property to drop warning
  2020-05-08  5:49 ` [PATCH 2/3] dts: ppc: t4240rdb: " Biwen Li
@ 2020-05-08 11:50   ` Alexandre Belloni
  2020-05-08 11:59     ` Biwen Li (OSS)
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2020-05-08 11:50 UTC (permalink / raw)
  To: Biwen Li
  Cc: leoyang.li, robh+dt, mpe, benh, a.zummo, devicetree,
	linuxppc-dev, linux-kernel, linux-rtc, Biwen Li

On 08/05/2020 13:49:24+0800, Biwen Li wrote:
> From: Biwen Li <biwen.li@nxp.com>
> 
> This adds uie_unsupported property to drop warning as follows:
>     - $ hwclock.util-linux
>       hwclock.util-linux: select() to /dev/rtc0
>       to wait for clock tick timed out
> 
> My case:
>     - RTC ds1374's INT pin is connected to VCC on T4240RDB,
>       then the RTC cannot inform cpu about the alarm interrupt
> 
> Signed-off-by: Biwen Li <biwen.li@nxp.com>
> ---
>  arch/powerpc/boot/dts/fsl/t4240rdb.dts | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/boot/dts/fsl/t4240rdb.dts b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> index a56a705d41f7..ccdd10202e56 100644
> --- a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> +++ b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> @@ -144,7 +144,11 @@
>  			rtc@68 {
>  				compatible = "dallas,ds1374";
>  				reg = <0x68>;
> -				interrupts = <0x1 0x1 0 0>;

removing the interrupt should be enough to solve your issue

> +				// The ds1374's INT pin isn't
> +				// connected to cpu's INT pin,
> +				// so the rtc cannot synchronize
> +				// clock tick per second.
> +				uie_unsupported;
>  			};
>  		};
>  
> -- 
> 2.17.1
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning
  2020-05-08 11:49 ` [PATCH 1/3] rtc: ds1374: add uie_unsupported " Alexandre Belloni
@ 2020-05-08 11:59   ` Biwen Li (OSS)
  0 siblings, 0 replies; 7+ messages in thread
From: Biwen Li (OSS) @ 2020-05-08 11:59 UTC (permalink / raw)
  To: Alexandre Belloni, Biwen Li (OSS)
  Cc: Leo Li, robh+dt, mpe, benh, a.zummo, devicetree, linuxppc-dev,
	linux-kernel, linux-rtc

> 
> Hi,
> 
> On 08/05/2020 13:49:23+0800, Biwen Li wrote:
> > From: Biwen Li <biwen.li@nxp.com>
> >
> > Add uie_unsupported property to drop warning as follows:
> >     - $ hwclock.util-linux
> >       hwclock.util-liux: select() /dev/rtc0
> >       to wait for clock tick timed out
> >
> > My case:
> >     - RTC ds1374's INT pin is connected to VCC on T4240RDB,
> >       then the RTC cannot inform cpu about the alarm
> >       interrupt
> >
> > Signed-off-by: Biwen Li <biwen.li@nxp.com>
> > ---
> >  drivers/rtc/rtc-ds1374.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index
> > 9c51a12cf70f..e530e887a17e 100644
> > --- a/drivers/rtc/rtc-ds1374.c
> > +++ b/drivers/rtc/rtc-ds1374.c
> > @@ -651,6 +651,10 @@ static int ds1374_probe(struct i2c_client *client,
> >  	if (ret)
> >  		return ret;
> >
> > +	if (of_property_read_bool(client->dev.of_node,
> > +						 "uie_unsupported"))
> > +		ds1374->rtc->uie_unsupported = true;
> > +
> 
> This is not how this is supposed to work, either the RTC support uie or don't, it is
> not board dependent and certainly doesn't require an
> (undocumented) DT property.
Okay, got it. Thanks.
> 
> >  #ifdef CONFIG_RTC_DRV_DS1374_WDT
> >  	save_client = client;
> >  	ret = misc_register(&ds1374_miscdev);
> > --
> > 2.17.1
> >
> 
> --
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/3] dts: ppc: t4240rdb: add uie_unsupported property to drop warning
  2020-05-08 11:50   ` Alexandre Belloni
@ 2020-05-08 11:59     ` Biwen Li (OSS)
  0 siblings, 0 replies; 7+ messages in thread
From: Biwen Li (OSS) @ 2020-05-08 11:59 UTC (permalink / raw)
  To: Alexandre Belloni, Biwen Li (OSS)
  Cc: Leo Li, robh+dt, mpe, benh, a.zummo, devicetree, linuxppc-dev,
	linux-kernel, linux-rtc

> 
> On 08/05/2020 13:49:24+0800, Biwen Li wrote:
> > From: Biwen Li <biwen.li@nxp.com>
> >
> > This adds uie_unsupported property to drop warning as follows:
> >     - $ hwclock.util-linux
> >       hwclock.util-linux: select() to /dev/rtc0
> >       to wait for clock tick timed out
> >
> > My case:
> >     - RTC ds1374's INT pin is connected to VCC on T4240RDB,
> >       then the RTC cannot inform cpu about the alarm interrupt
> >
> > Signed-off-by: Biwen Li <biwen.li@nxp.com>
> > ---
> >  arch/powerpc/boot/dts/fsl/t4240rdb.dts | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> > index a56a705d41f7..ccdd10202e56 100644
> > --- a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> > +++ b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
> > @@ -144,7 +144,11 @@
> >  			rtc@68 {
> >  				compatible = "dallas,ds1374";
> >  				reg = <0x68>;
> > -				interrupts = <0x1 0x1 0 0>;
> 
> removing the interrupt should be enough to solve your issue
Okay, got it. Thanks.
> 
> > +				// The ds1374's INT pin isn't
> > +				// connected to cpu's INT pin,
> > +				// so the rtc cannot synchronize
> > +				// clock tick per second.
> > +				uie_unsupported;
> >  			};
> >  		};
> >
> > --
> > 2.17.1
> >
> 
> --
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  5:49 [PATCH 1/3] rtc: ds1374: add uie_unsupported property to drop warning Biwen Li
2020-05-08  5:49 ` [PATCH 2/3] dts: ppc: t4240rdb: " Biwen Li
2020-05-08 11:50   ` Alexandre Belloni
2020-05-08 11:59     ` Biwen Li (OSS)
2020-05-08  5:49 ` [PATCH 3/3] dts: ppc: t1024rdb: add wakeup-source " Biwen Li
2020-05-08 11:49 ` [PATCH 1/3] rtc: ds1374: add uie_unsupported " Alexandre Belloni
2020-05-08 11:59   ` Biwen Li (OSS)

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org
	public-inbox-index linux-rtc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git