Skip to contentSkip to conversation

efi: rtc-efi: mark UIE as unsupported

PATCH New Ard Biesheuvel 2 participants 2 messages Jan 13, 2015 – Jan 20, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: rtc-efi: mark UIE as unsupported

Tools like hwclock attempt to enable the RTC update interrupt (UIE) to maximize the accuracy of the reported time value. The EFI rtc does not have interrupt capability so this is a pointless exercise to begin with, but the generic RTC framework ends up issuing a SetWakeupTime() Runtime Services call before drawing that conclusion on its own.

Instead, we can mark UIE as unsupported at driver probe time. The net result is the same, but without the spurious SetWakeupTime() call.

---
 drivers/rtc/rtc-efi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-efi.c +1 -0
index b37b0c80bd5a..cb989cd00b14 100644
@@ -218,6 +218,7 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->uie_unsupported = 1;
 	platform_set_drvdata(dev, rtc);
 
 	return 0;
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 efi: rtc-efi: mark UIE as unsupported

Quoted 19 lines · Ard Biesheuvel

Tools like hwclock attempt to enable the RTC update interrupt (UIE) to maximize the accuracy of the reported time value. The EFI rtc does not have interrupt capability so this is a pointless exercise to begin with, but the generic RTC framework ends up issuing a SetWakeupTime() Runtime Services call before drawing that conclusion on its own.

Instead, we can mark UIE as unsupported at driver probe time. The net result is the same, but without the spurious SetWakeupTime() call.

---
 drivers/rtc/rtc-efi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-efi.c +0 -0
index b37b0c80bd5a..cb989cd00b14 100644

drivers/rtc/rtc-efi.c static int __init efi_rtc_probe(struct platform_device *dev) · line 224

Quoted 7 lines
drivers/rtc/rtc-efi.c +1 -0
@@ -218,6 +218,7 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->uie_unsupported = 1;
 	platform_set_drvdata(dev, rtc);
 
 	return 0;

Looks fine to me. Picked up in the EFI tree for v3.20. Thanks Ard.

Signature · 1 line
Matt Fleming, Intel Open Source Technology Center