diff mbox series

[v1] RFC: rtc: rv8803: avoid bootloop on low voltage of button cell

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

Commit Message

Oliver Graute Feb. 8, 2023, 7:38 a.m. UTC
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(-)

Comments

Michael Walle Feb. 8, 2023, 8:32 a.m. UTC | #1
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
Oliver Graute Feb. 8, 2023, 11:29 a.m. UTC | #2
> 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
Michael Walle Feb. 8, 2023, 11:33 a.m. UTC | #3
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 mbox series

Patch

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));