Message ID | 20230208073840.10329-1-oliver.graute@kococonnector.com |
---|---|
State | RFC |
Delegated to: | Tom Rini |
Headers | show |
Series | [v1] RFC: rtc: rv8803: avoid bootloop on low voltage of button cell | expand |
Am 2023-02-08 08:38, schrieb Oliver Graute: > if the rtc button cell is on low voltage this can result in a permanent > bootloop in u-boot because V2F Register is permanent set. > > ### Warning: temperature compensation has stopped > ### Warning: Voltage low, data is invalid > resetting ... > > With this patch the bootloop is prevented > > Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> I'm curious, how is the call tree here? I don't see the dm_rtc_get() being called during boot. Basically, you are now just ignoring the error. -michael
> Am 08.02.2023 um 09:32 schrieb Michael Walle <michael@walle.cc>: > > Am 2023-02-08 08:38, schrieb Oliver Graute: >> if the rtc button cell is on low voltage this can result in a permanent >> bootloop in u-boot because V2F Register is permanent set. >> ### Warning: temperature compensation has stopped >> ### Warning: Voltage low, data is invalid >> resetting ... >> With this patch the bootloop is prevented >> Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> > > I'm curious, how is the call tree here? I don't see the dm_rtc_get() > being called during boot. Basically, you are now just ignoring the error. I use dm_rtc_get() in a modified boot/bootm.c to check for a End-Off Live booting date. Just to prevent that testers uses devices with out-dated images. So if this only affects me so this patch can be ignored. Best regards, Oliver
Am 2023-02-08 12:29, schrieb Oliver Graute: >> Am 08.02.2023 um 09:32 schrieb Michael Walle <michael@walle.cc>: >> >> Am 2023-02-08 08:38, schrieb Oliver Graute: >>> if the rtc button cell is on low voltage this can result in a >>> permanent >>> bootloop in u-boot because V2F Register is permanent set. >>> ### Warning: temperature compensation has stopped >>> ### Warning: Voltage low, data is invalid >>> resetting ... >>> With this patch the bootloop is prevented >>> Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> >> >> I'm curious, how is the call tree here? I don't see the dm_rtc_get() >> being called during boot. Basically, you are now just ignoring the >> error. > > I use dm_rtc_get() in a modified boot/bootm.c to check for a End-Off > Live > booting date. Just to prevent that testers uses devices with out-dated > images. > > So if this only affects me so this patch can be ignored. In this case you should just ignore the return value (and live with bogus values). Or.. handle it gracefully. -michael
diff --git a/drivers/rtc/rv8803.c b/drivers/rtc/rv8803.c index 06a4ae89fa..75debac607 100644 --- a/drivers/rtc/rv8803.c +++ b/drivers/rtc/rv8803.c @@ -79,7 +79,6 @@ static int rv8803_rtc_get(struct udevice *dev, struct rtc_time *tm) if (flags & RTC_FLAG_BIT_V2F) { printf("### Warning: Voltage low, data is invalid\n"); - return -1; } ret = dm_i2c_read(dev, 0, buf, sizeof(buf));
if the rtc button cell is on low voltage this can result in a permanent bootloop in u-boot because V2F Register is permanent set. ### Warning: temperature compensation has stopped ### Warning: Voltage low, data is invalid resetting ... With this patch the bootloop is prevented Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> --- drivers/rtc/rv8803.c | 1 - 1 file changed, 1 deletion(-)