* [PATCH] rtc: pm8xxx: Return -ENODEV if set_time disallowed
@ 2022-02-17 9:36 Loic Poulain
2022-03-25 10:42 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Loic Poulain @ 2022-02-17 9:36 UTC (permalink / raw)
To: a.zummo, alexandre.belloni; +Cc: linux-rtc, Loic Poulain
Having !allow_set_time is equivalent to non-implemented set_time
function, which is normally represented with -ENODEV error in RTC
subsystem.
Today we are returning -EACCES error code, which is not considered
by RTC clients as a 'non implemented' feature, and which causes NTP
to retry hw clk sync (update_rtc) indefinitely.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
drivers/rtc/rtc-pm8xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index 75954dd..dc6d147 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -84,7 +84,7 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm)
const struct pm8xxx_rtc_regs *regs = rtc_dd->regs;
if (!rtc_dd->allow_set_time)
- return -EACCES;
+ return -ENODEV;
secs = rtc_tm_to_time64(tm);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc: pm8xxx: Return -ENODEV if set_time disallowed
2022-02-17 9:36 [PATCH] rtc: pm8xxx: Return -ENODEV if set_time disallowed Loic Poulain
@ 2022-03-25 10:42 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-03-25 10:42 UTC (permalink / raw)
To: Loic Poulain, a.zummo; +Cc: linux-rtc
On Thu, 17 Feb 2022 10:36:18 +0100, Loic Poulain wrote:
> Having !allow_set_time is equivalent to non-implemented set_time
> function, which is normally represented with -ENODEV error in RTC
> subsystem.
>
> Today we are returning -EACCES error code, which is not considered
> by RTC clients as a 'non implemented' feature, and which causes NTP
> to retry hw clk sync (update_rtc) indefinitely.
>
> [...]
Applied, thanks!
[1/1] rtc: pm8xxx: Return -ENODEV if set_time disallowed
commit: 870c54e1a3e111613cd68e5cc867455dc4765cd6
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-25 10:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17 9:36 [PATCH] rtc: pm8xxx: Return -ENODEV if set_time disallowed Loic Poulain
2022-03-25 10:42 ` Alexandre Belloni
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).