rtc: bbnsm: Enable RTC by default to fix time read failure
Subsystems (2)
Frank Li
maintainerPATCH 1/1 rtc: bbnsm: Enable RTC by default to fix time read failure
From: Jacky Bai <[email protected]>
Enable the RTC by default even when no valid time is set to ensure the RTC's time read and alarm functions work properly. Without this, running hwclock results in the following error:
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
--- drivers/rtc/rtc-nxp-bbnsm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/rtc/rtc-nxp-bbnsm.c +3 -0
@@ -189,6 +189,9 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)/* clear all the pending events */ regmap_write (bbnsm->regmap,BBNSM_EVENTS ,0x7A ); +/* Enable the Real-Time counter */ +regmap_update_bits (bbnsm->regmap,BBNSM_CTRL ,RTC_EN_MSK ,RTC_EN ); +device_init_wakeup (&pdev->dev, true);dev_pm_set_wake_irq (&pdev->dev, bbnsm->irq);
Signature · 1 line
2.34.1
Alexandre Belloni
maintainerQuoted 8 lines · Frank Li
From: Jacky Bai <[email protected]>
Enable the RTC by default even when no valid time is set to ensure the RTC's time read and alarm functions work properly. Without this, running hwclock results in the following error:
hwclock:
ioctl(RTC_RD_TIME)to/dev/rtc0to read the time failed: Invalid argument
What is providing your hwclock and which version does it have?
Quoted 25 lines
Fixes eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support")Signed-off-by Jacky Bai <[email protected]>Signed-off-by Dong Aisheng <[email protected]>Signed-off-by Frank Li <[email protected]>--- drivers/rtc/rtc-nxp-bbnsm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/rtc/rtc-nxp-bbnsm.c +3
-0@@ -189,6 +189,9 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)/* clear all the pending events */ regmap_write (bbnsm->regmap,BBNSM_EVENTS ,0x7A ); +/* Enable the Real-Time counter */ +regmap_update_bits (bbnsm->regmap,BBNSM_CTRL ,RTC_EN_MSK ,RTC_EN ); +device_init_wakeup (&pdev->dev, true);dev_pm_set_wake_irq (&pdev->dev, bbnsm->irq);Signature · 1 line
2.34.1
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Alexandre Belloni
maintainerQuoted 7 lines · Alexandre Belloni
Quoted 6 lines · Frank Li
From: Jacky Bai <[email protected]>
Enable the RTC by default even when no valid time is set to ensure the RTC's time read and alarm functions work properly. Without this, running hwclock results in the following error:
Quoted 5 lines
Quoted 2 lines
hwclock:
ioctl(RTC_RD_TIME)to/dev/rtc0to read the time failed: Invalid argumentWhat is providing your hwclock and which version does it have?
This is a bug in util-linux that needs to be fixed.
Quoted 32 lines
Quoted 27 lines
Fixes eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support")Signed-off-by Jacky Bai <[email protected]>Signed-off-by Dong Aisheng <[email protected]>Signed-off-by Frank Li <[email protected]>--- drivers/rtc/rtc-nxp-bbnsm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/rtc/rtc-nxp-bbnsm.c +3
-0@@ -189,6 +189,9 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)/* clear all the pending events */ regmap_write (bbnsm->regmap,BBNSM_EVENTS ,0x7A ); +/* Enable the Real-Time counter */ +regmap_update_bits (bbnsm->regmap,BBNSM_CTRL ,RTC_EN_MSK ,RTC_EN ); +device_init_wakeup (&pdev->dev, true);dev_pm_set_wake_irq (&pdev->dev, bbnsm->irq);Signature · 1 line
2.34.1Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Frank Li
maintainerQuoted 8 lines · Alexandre Belloni
Quoted 7 lines · Alexandre Belloni
Quoted 6 lines · Frank Li
From: Jacky Bai <[email protected]>
Enable the RTC by default even when no valid time is set to ensure the RTC's time read and alarm functions work properly. Without this, running hwclock results in the following error:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
hwclock:
ioctl(RTC_RD_TIME)to/dev/rtc0to read the time failed: Invalid argumentWhat is providing your hwclock and which version does it have?
This is a bug in util-linux that needs to be fixed.
What's suposed/expected beheavor? I think rtc should be enable by default.
Frank
Quoted 37 lines
Quoted 24 lines
Quoted 24 lines
Fixes eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support")Signed-off-by Jacky Bai <[email protected]>Signed-off-by Dong Aisheng <[email protected]>Signed-off-by Frank Li <[email protected]>--- drivers/rtc/rtc-nxp-bbnsm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/rtc/rtc-nxp-bbnsm.c +3
-0@@ -189,6 +189,9 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)/* clear all the pending events */ regmap_write (bbnsm->regmap,BBNSM_EVENTS ,0x7A ); +/* Enable the Real-Time counter */ +regmap_update_bits (bbnsm->regmap,BBNSM_CTRL ,RTC_EN_MSK ,RTC_EN ); +device_init_wakeup (&pdev->dev, true);dev_pm_set_wake_irq (&pdev->dev, bbnsm->irq);Quoted 8 lines
Quoted 3 lines
--
2.34.1--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Frank Li
maintainerQuoted 9 lines · Frank Li
Quoted 8 lines · Alexandre Belloni
Quoted 7 lines · Alexandre Belloni
Quoted 6 lines · Frank Li
From: Jacky Bai <[email protected]>
Enable the RTC by default even when no valid time is set to ensure the RTC's time read and alarm functions work properly. Without this, running hwclock results in the following error:
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
hwclock:
ioctl(RTC_RD_TIME)to/dev/rtc0to read the time failed: Invalid argumentWhat is providing your hwclock and which version does it have?
This is a bug in util-linux that needs to be fixed.
Alexandre:
I can't understand what your means. Why it is util-linux issue?
This driver return failure at read because check hardware bit RTC_EN.
I suppose RTC should be always enable after probe?
Frank
Quoted 42 lines
What's suposed/expected beheavor? I think rtc should be enable by default.
Frank
Quoted 37 lines
Quoted 24 lines
Quoted 24 lines
Fixes eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support")Signed-off-by Jacky Bai <[email protected]>Signed-off-by Dong Aisheng <[email protected]>Signed-off-by Frank Li <[email protected]>--- drivers/rtc/rtc-nxp-bbnsm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/rtc/rtc-nxp-bbnsm.c +3
-0@@ -189,6 +189,9 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)/* clear all the pending events */ regmap_write (bbnsm->regmap,BBNSM_EVENTS ,0x7A ); +/* Enable the Real-Time counter */ +regmap_update_bits (bbnsm->regmap,BBNSM_CTRL ,RTC_EN_MSK ,RTC_EN ); +device_init_wakeup (&pdev->dev, true);dev_pm_set_wake_irq (&pdev->dev, bbnsm->irq);Quoted 8 lines
Quoted 3 lines
--
2.34.1--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com