Skip to contentSkip to conversation

rtc: amlogic-a4: clear unsupported update interrupt feature

PATCH In review Xianwei Zhao 2 participants 3 messages Jun 24 – Sep 2

Subsystems (3)
lore
Share & tools
lore

Xianwei Zhao

author maintainer
#0 lore raw

PATCH 1/1 rtc: amlogic-a4: clear unsupported update interrupt feature

The Amlogic A4 RTC does not support update interrupt. Clear RTC_FEATURE_UPDATE_INTERRUPT before registering the RTC device to prevent userspace from enabling an unsupported RTC UIE function.

---
Clear RTC_FEATURE_UPDATE_INTERRUPT before registering the RTC device.

---
 drivers/rtc/rtc-amlogic-a4.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-amlogic-a4.c +1 -0
index 50938c35af36..116cf095a9e9 100644
@@ -379,6 +379,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
 	rtc->rtc_dev->ops = &aml_rtc_ops;
 	rtc->rtc_dev->range_min = 0;
 	rtc->rtc_dev->range_max = U32_MAX;
+	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtc_dev->features);
 
 	return devm_rtc_register_device(rtc->rtc_dev);
 }

---
base-commit: 851d961ff248218f681c53cf0f7f08cf8201a117
change-id: 20260624-rtc-feature-03ce3f3843a9

Best regards,

Signature · 1 line
Xianwei Zhao <[email protected]>
#1 lore raw

Hello,

Quoted 6 lines · On 24/06/2026 07:24:34+0000, Xianwei Zhao via B4 Relay wrote:

From: Xianwei Zhao <[email protected]>

The Amlogic A4 RTC does not support update interrupt. Clear RTC_FEATURE_UPDATE_INTERRUPT before registering the RTC device to prevent userspace from enabling an unsupported RTC UIE function.

Because the driver supports alarms, it should support UIE. Is there any reason the RTC can't handle arming alarms every seconds? There are some that would only support alarms avery 2s, in that case, please set RTC_FEATURE_ALARM_RES_2S.

Quoted 29 lines

---
Clear RTC_FEATURE_UPDATE_INTERRUPT before registering the RTC device.

---
 drivers/rtc/rtc-amlogic-a4.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-amlogic-a4.c +1 -1
index 50938c35af36..116cf095a9e9 100644
@@ -379,6 +379,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
 	rtc->rtc_dev->ops = &aml_rtc_ops;
 	rtc->rtc_dev->range_min = 0;
 	rtc->rtc_dev->range_max = U32_MAX;
+	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtc_dev->features);
 
 	return devm_rtc_register_device(rtc->rtc_dev);
 }
 
---

base-commit: 851d961ff248218f681c53cf0f7f08cf8201a117
change-id: 20260624-rtc-feature-03ce3f3843a9

Best regards,

Signature · 1 line
Xianwei Zhao <[email protected]>
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#2 lore raw

Hi Alexandre,
Thanks for your review.

Quoted 5 lines · Alexandre Belloni

Hello,

Quoted 2 lines · On 24/06/2026 07:24:34+0000, Xianwei Zhao via B4 Relay wrote:

From: Xianwei Zhao<[email protected]>

Quoted 9 lines
Quoted 4 lines

The Amlogic A4 RTC does not support update interrupt. Clear RTC_FEATURE_UPDATE_INTERRUPT before registering the RTC device to prevent userspace from enabling an unsupported RTC UIE function.

Because the driver supports alarms, it should support UIE. Is there any reason the RTC can't handle arming alarms every seconds? There are some that would only support alarms avery 2s, in that case, please set RTC_FEATURE_ALARM_RES_2S.

Got it, Amlogic RTC support every seconds. Please ignore this patch.

Quoted 27 lines
Quoted 27 lines

---
Clear RTC_FEATURE_UPDATE_INTERRUPT before registering the RTC device.

---
  drivers/rtc/rtc-amlogic-a4.c | 1 +
  1 file changed, 1 insertion(+)
drivers/rtc/rtc-amlogic-a4.c +1 -1
index 50938c35af36..116cf095a9e9 100644
@@ -379,6 +379,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
       rtc->rtc_dev->ops = &aml_rtc_ops;
       rtc->rtc_dev->range_min = 0;
       rtc->rtc_dev->range_max = U32_MAX;
+     clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtc_dev->features);
 
       return devm_rtc_register_device(rtc->rtc_dev);
  }
 
---

base-commit: 851d961ff248218f681c53cf0f7f08cf8201a117
change-id: 20260624-rtc-feature-03ce3f3843a9

Best regards,
--
Xianwei Zhao<[email protected]>