From: Ard Biesheuvel <ardb@kernel.org>
The EFI rtc driver is used by non-x86 architectures only, and exposes
the get/set wakeup time functionality provided by the underlying
platform. This is usually broken on most platforms, and not widely used
to begin with [if at all], so let's just remove it.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
drivers/rtc/rtc-efi.c | 76 +-------------------
1 file changed, 2 insertions(+), 74 deletions(-)
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index fa8bf82df948..b4f44999ef0f 100644
--- a/drivers/rtc/rtc-efi.c
+++ b/drivers/rtc/rtc-efi.c
@@ -112,48 +112,6 @@ convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
return true;
}
-static int efi_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
-{
- efi_time_t eft;
- efi_status_t status;
-
- /*
- * As of EFI v1.10, this call always returns an unsupported status
- */
- status = efi.get_wakeup_time((efi_bool_t *)&wkalrm->enabled,
- (efi_bool_t *)&wkalrm->pending, &eft);
-
- if (status != EFI_SUCCESS)
- return -EINVAL;
-
- if (!convert_from_efi_time(&eft, &wkalrm->time))
- return -EIO;
-
- return rtc_valid_tm(&wkalrm->time);
-}
-
-static int efi_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
-{
- efi_time_t eft;
- efi_status_t status;
-
- convert_to_efi_time(&wkalrm->time, &eft);
-
- /*
- * XXX Fixme:
- * As of EFI 0.92 with the firmware I have on my
- * machine this call does not seem to work quite
- * right
- *
- * As of v1.10, this call always returns an unsupported status
- */
- status = efi.set_wakeup_time((efi_bool_t)wkalrm->enabled, &eft);
-
- dev_warn(dev, "write status is %d\n", (int)status);
-
- return status == EFI_SUCCESS ? 0 : -EINVAL;
-}
-
static int efi_read_time(struct device *dev, struct rtc_time *tm)
{
efi_status_t status;
@@ -188,17 +146,13 @@ static int efi_set_time(struct device *dev, struct rtc_time *tm)
static int efi_procfs(struct device *dev, struct seq_file *seq)
{
- efi_time_t eft, alm;
+ efi_time_t eft;
efi_time_cap_t cap;
- efi_bool_t enabled, pending;
- struct rtc_device *rtc = dev_get_drvdata(dev);
memset(&eft, 0, sizeof(eft));
- memset(&alm, 0, sizeof(alm));
memset(&cap, 0, sizeof(cap));
efi.get_time(&eft, &cap);
- efi.get_wakeup_time(&enabled, &pending, &alm);
seq_printf(seq,
"Time\t\t: %u:%u:%u.%09u\n"
@@ -214,26 +168,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq)
/* XXX fixme: convert to string? */
seq_printf(seq, "Timezone\t: %u\n", eft.timezone);
- if (test_bit(RTC_FEATURE_ALARM, rtc->features)) {
- seq_printf(seq,
- "Alarm Time\t: %u:%u:%u.%09u\n"
- "Alarm Date\t: %u-%u-%u\n"
- "Alarm Daylight\t: %u\n"
- "Enabled\t\t: %s\n"
- "Pending\t\t: %s\n",
- alm.hour, alm.minute, alm.second, alm.nanosecond,
- alm.year, alm.month, alm.day,
- alm.daylight,
- enabled == 1 ? "yes" : "no",
- pending == 1 ? "yes" : "no");
-
- if (alm.timezone == EFI_UNSPECIFIED_TIMEZONE)
- seq_puts(seq, "Timezone\t: unspecified\n");
- else
- /* XXX fixme: convert to string? */
- seq_printf(seq, "Timezone\t: %u\n", alm.timezone);
- }
-
/*
* now prints the capabilities
*/
@@ -249,8 +183,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq)
static const struct rtc_class_ops efi_rtc_ops = {
.read_time = efi_read_time,
.set_time = efi_set_time,
- .read_alarm = efi_read_alarm,
- .set_alarm = efi_set_alarm,
.proc = efi_procfs,
};
@@ -271,11 +203,7 @@ static int __init efi_rtc_probe(struct platform_device *dev)
platform_set_drvdata(dev, rtc);
rtc->ops = &efi_rtc_ops;
- clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
- if (efi_rt_services_supported(EFI_RT_SUPPORTED_WAKEUP_SERVICES))
- set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features);
- else
- clear_bit(RTC_FEATURE_ALARM, rtc->features);
+ clear_bit(RTC_FEATURE_ALARM, rtc->features);
device_init_wakeup(&dev->dev, true);
--
2.50.0.727.gbf7dc18ff4-goog
Hello, Apart from the topic that should be "rtc: efi:...", I'm ready to apply this patch. On 14/07/2025 08:08:45+0200, Ard Biesheuvel wrote: > From: Ard Biesheuvel <ardb@kernel.org> > > The EFI rtc driver is used by non-x86 architectures only, and exposes > the get/set wakeup time functionality provided by the underlying > platform. This is usually broken on most platforms, and not widely used > to begin with [if at all], so let's just remove it. > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > --- > drivers/rtc/rtc-efi.c | 76 +------------------- > 1 file changed, 2 insertions(+), 74 deletions(-) > > diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c > index fa8bf82df948..b4f44999ef0f 100644 > --- a/drivers/rtc/rtc-efi.c > +++ b/drivers/rtc/rtc-efi.c > @@ -112,48 +112,6 @@ convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime) > return true; > } > > -static int efi_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) > -{ > - efi_time_t eft; > - efi_status_t status; > - > - /* > - * As of EFI v1.10, this call always returns an unsupported status > - */ > - status = efi.get_wakeup_time((efi_bool_t *)&wkalrm->enabled, > - (efi_bool_t *)&wkalrm->pending, &eft); > - > - if (status != EFI_SUCCESS) > - return -EINVAL; > - > - if (!convert_from_efi_time(&eft, &wkalrm->time)) > - return -EIO; > - > - return rtc_valid_tm(&wkalrm->time); > -} > - > -static int efi_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) > -{ > - efi_time_t eft; > - efi_status_t status; > - > - convert_to_efi_time(&wkalrm->time, &eft); > - > - /* > - * XXX Fixme: > - * As of EFI 0.92 with the firmware I have on my > - * machine this call does not seem to work quite > - * right > - * > - * As of v1.10, this call always returns an unsupported status > - */ > - status = efi.set_wakeup_time((efi_bool_t)wkalrm->enabled, &eft); > - > - dev_warn(dev, "write status is %d\n", (int)status); > - > - return status == EFI_SUCCESS ? 0 : -EINVAL; > -} > - > static int efi_read_time(struct device *dev, struct rtc_time *tm) > { > efi_status_t status; > @@ -188,17 +146,13 @@ static int efi_set_time(struct device *dev, struct rtc_time *tm) > > static int efi_procfs(struct device *dev, struct seq_file *seq) > { > - efi_time_t eft, alm; > + efi_time_t eft; > efi_time_cap_t cap; > - efi_bool_t enabled, pending; > - struct rtc_device *rtc = dev_get_drvdata(dev); > > memset(&eft, 0, sizeof(eft)); > - memset(&alm, 0, sizeof(alm)); > memset(&cap, 0, sizeof(cap)); > > efi.get_time(&eft, &cap); > - efi.get_wakeup_time(&enabled, &pending, &alm); > > seq_printf(seq, > "Time\t\t: %u:%u:%u.%09u\n" > @@ -214,26 +168,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) > /* XXX fixme: convert to string? */ > seq_printf(seq, "Timezone\t: %u\n", eft.timezone); > > - if (test_bit(RTC_FEATURE_ALARM, rtc->features)) { > - seq_printf(seq, > - "Alarm Time\t: %u:%u:%u.%09u\n" > - "Alarm Date\t: %u-%u-%u\n" > - "Alarm Daylight\t: %u\n" > - "Enabled\t\t: %s\n" > - "Pending\t\t: %s\n", > - alm.hour, alm.minute, alm.second, alm.nanosecond, > - alm.year, alm.month, alm.day, > - alm.daylight, > - enabled == 1 ? "yes" : "no", > - pending == 1 ? "yes" : "no"); > - > - if (alm.timezone == EFI_UNSPECIFIED_TIMEZONE) > - seq_puts(seq, "Timezone\t: unspecified\n"); > - else > - /* XXX fixme: convert to string? */ > - seq_printf(seq, "Timezone\t: %u\n", alm.timezone); > - } > - > /* > * now prints the capabilities > */ > @@ -249,8 +183,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) > static const struct rtc_class_ops efi_rtc_ops = { > .read_time = efi_read_time, > .set_time = efi_set_time, > - .read_alarm = efi_read_alarm, > - .set_alarm = efi_set_alarm, > .proc = efi_procfs, > }; > > @@ -271,11 +203,7 @@ static int __init efi_rtc_probe(struct platform_device *dev) > platform_set_drvdata(dev, rtc); > > rtc->ops = &efi_rtc_ops; > - clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features); > - if (efi_rt_services_supported(EFI_RT_SUPPORTED_WAKEUP_SERVICES)) > - set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features); > - else > - clear_bit(RTC_FEATURE_ALARM, rtc->features); > + clear_bit(RTC_FEATURE_ALARM, rtc->features); > > device_init_wakeup(&dev->dev, true); > > -- > 2.50.0.727.gbf7dc18ff4-goog > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Sun, 3 Aug 2025 at 11:05, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote: > > Hello, > > Apart from the topic that should be "rtc: efi:...", I'm ready to apply > this patch. > Thanks, please go ahead. > On 14/07/2025 08:08:45+0200, Ard Biesheuvel wrote: > > From: Ard Biesheuvel <ardb@kernel.org> > > > > The EFI rtc driver is used by non-x86 architectures only, and exposes > > the get/set wakeup time functionality provided by the underlying > > platform. This is usually broken on most platforms, and not widely used > > to begin with [if at all], so let's just remove it. > > > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > > --- > > drivers/rtc/rtc-efi.c | 76 +------------------- > > 1 file changed, 2 insertions(+), 74 deletions(-) > > > > diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c > > index fa8bf82df948..b4f44999ef0f 100644 > > --- a/drivers/rtc/rtc-efi.c > > +++ b/drivers/rtc/rtc-efi.c > > @@ -112,48 +112,6 @@ convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime) > > return true; > > } > > > > -static int efi_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) > > -{ > > - efi_time_t eft; > > - efi_status_t status; > > - > > - /* > > - * As of EFI v1.10, this call always returns an unsupported status > > - */ > > - status = efi.get_wakeup_time((efi_bool_t *)&wkalrm->enabled, > > - (efi_bool_t *)&wkalrm->pending, &eft); > > - > > - if (status != EFI_SUCCESS) > > - return -EINVAL; > > - > > - if (!convert_from_efi_time(&eft, &wkalrm->time)) > > - return -EIO; > > - > > - return rtc_valid_tm(&wkalrm->time); > > -} > > - > > -static int efi_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) > > -{ > > - efi_time_t eft; > > - efi_status_t status; > > - > > - convert_to_efi_time(&wkalrm->time, &eft); > > - > > - /* > > - * XXX Fixme: > > - * As of EFI 0.92 with the firmware I have on my > > - * machine this call does not seem to work quite > > - * right > > - * > > - * As of v1.10, this call always returns an unsupported status > > - */ > > - status = efi.set_wakeup_time((efi_bool_t)wkalrm->enabled, &eft); > > - > > - dev_warn(dev, "write status is %d\n", (int)status); > > - > > - return status == EFI_SUCCESS ? 0 : -EINVAL; > > -} > > - > > static int efi_read_time(struct device *dev, struct rtc_time *tm) > > { > > efi_status_t status; > > @@ -188,17 +146,13 @@ static int efi_set_time(struct device *dev, struct rtc_time *tm) > > > > static int efi_procfs(struct device *dev, struct seq_file *seq) > > { > > - efi_time_t eft, alm; > > + efi_time_t eft; > > efi_time_cap_t cap; > > - efi_bool_t enabled, pending; > > - struct rtc_device *rtc = dev_get_drvdata(dev); > > > > memset(&eft, 0, sizeof(eft)); > > - memset(&alm, 0, sizeof(alm)); > > memset(&cap, 0, sizeof(cap)); > > > > efi.get_time(&eft, &cap); > > - efi.get_wakeup_time(&enabled, &pending, &alm); > > > > seq_printf(seq, > > "Time\t\t: %u:%u:%u.%09u\n" > > @@ -214,26 +168,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) > > /* XXX fixme: convert to string? */ > > seq_printf(seq, "Timezone\t: %u\n", eft.timezone); > > > > - if (test_bit(RTC_FEATURE_ALARM, rtc->features)) { > > - seq_printf(seq, > > - "Alarm Time\t: %u:%u:%u.%09u\n" > > - "Alarm Date\t: %u-%u-%u\n" > > - "Alarm Daylight\t: %u\n" > > - "Enabled\t\t: %s\n" > > - "Pending\t\t: %s\n", > > - alm.hour, alm.minute, alm.second, alm.nanosecond, > > - alm.year, alm.month, alm.day, > > - alm.daylight, > > - enabled == 1 ? "yes" : "no", > > - pending == 1 ? "yes" : "no"); > > - > > - if (alm.timezone == EFI_UNSPECIFIED_TIMEZONE) > > - seq_puts(seq, "Timezone\t: unspecified\n"); > > - else > > - /* XXX fixme: convert to string? */ > > - seq_printf(seq, "Timezone\t: %u\n", alm.timezone); > > - } > > - > > /* > > * now prints the capabilities > > */ > > @@ -249,8 +183,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) > > static const struct rtc_class_ops efi_rtc_ops = { > > .read_time = efi_read_time, > > .set_time = efi_set_time, > > - .read_alarm = efi_read_alarm, > > - .set_alarm = efi_set_alarm, > > .proc = efi_procfs, > > }; > > > > @@ -271,11 +203,7 @@ static int __init efi_rtc_probe(struct platform_device *dev) > > platform_set_drvdata(dev, rtc); > > > > rtc->ops = &efi_rtc_ops; > > - clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features); > > - if (efi_rt_services_supported(EFI_RT_SUPPORTED_WAKEUP_SERVICES)) > > - set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features); > > - else > > - clear_bit(RTC_FEATURE_ALARM, rtc->features); > > + clear_bit(RTC_FEATURE_ALARM, rtc->features); > > > > device_init_wakeup(&dev->dev, true); > > > > -- > > 2.50.0.727.gbf7dc18ff4-goog > > > > -- > Alexandre Belloni, co-owner and COO, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com >
On Mon, Jul 14, 2025 at 08:08:45AM +0200, Ard Biesheuvel wrote: > From: Ard Biesheuvel <ardb@kernel.org> > > The EFI rtc driver is used by non-x86 architectures only, and exposes > the get/set wakeup time functionality provided by the underlying > platform. This is usually broken on most platforms, and not widely used > to begin with [if at all], so let's just remove it. This solves the problem reported in https://lore.kernel.org/all/20250710084151.55003-1-feng.tang@linux.alibaba.com/T/#u Tested-by: Feng Tang <feng.tang@linux.alibaba.com> Thanks! - Feng > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > --- > drivers/rtc/rtc-efi.c | 76 +------------------- > 1 file changed, 2 insertions(+), 74 deletions(-) > > diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c > index fa8bf82df948..b4f44999ef0f 100644 > --- a/drivers/rtc/rtc-efi.c > +++ b/drivers/rtc/rtc-efi.c > @@ -112,48 +112,6 @@ convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime) > return true; > } > > -static int efi_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) > -{ > - efi_time_t eft; > - efi_status_t status; > - > - /* > - * As of EFI v1.10, this call always returns an unsupported status > - */ > - status = efi.get_wakeup_time((efi_bool_t *)&wkalrm->enabled, > - (efi_bool_t *)&wkalrm->pending, &eft); > - > - if (status != EFI_SUCCESS) > - return -EINVAL; > - > - if (!convert_from_efi_time(&eft, &wkalrm->time)) > - return -EIO; > - > - return rtc_valid_tm(&wkalrm->time); > -} > - > -static int efi_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) > -{ > - efi_time_t eft; > - efi_status_t status; > - > - convert_to_efi_time(&wkalrm->time, &eft); > - > - /* > - * XXX Fixme: > - * As of EFI 0.92 with the firmware I have on my > - * machine this call does not seem to work quite > - * right > - * > - * As of v1.10, this call always returns an unsupported status > - */ > - status = efi.set_wakeup_time((efi_bool_t)wkalrm->enabled, &eft); > - > - dev_warn(dev, "write status is %d\n", (int)status); > - > - return status == EFI_SUCCESS ? 0 : -EINVAL; > -} > - > static int efi_read_time(struct device *dev, struct rtc_time *tm) > { > efi_status_t status; > @@ -188,17 +146,13 @@ static int efi_set_time(struct device *dev, struct rtc_time *tm) > > static int efi_procfs(struct device *dev, struct seq_file *seq) > { > - efi_time_t eft, alm; > + efi_time_t eft; > efi_time_cap_t cap; > - efi_bool_t enabled, pending; > - struct rtc_device *rtc = dev_get_drvdata(dev); > > memset(&eft, 0, sizeof(eft)); > - memset(&alm, 0, sizeof(alm)); > memset(&cap, 0, sizeof(cap)); > > efi.get_time(&eft, &cap); > - efi.get_wakeup_time(&enabled, &pending, &alm); > > seq_printf(seq, > "Time\t\t: %u:%u:%u.%09u\n" > @@ -214,26 +168,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) > /* XXX fixme: convert to string? */ > seq_printf(seq, "Timezone\t: %u\n", eft.timezone); > > - if (test_bit(RTC_FEATURE_ALARM, rtc->features)) { > - seq_printf(seq, > - "Alarm Time\t: %u:%u:%u.%09u\n" > - "Alarm Date\t: %u-%u-%u\n" > - "Alarm Daylight\t: %u\n" > - "Enabled\t\t: %s\n" > - "Pending\t\t: %s\n", > - alm.hour, alm.minute, alm.second, alm.nanosecond, > - alm.year, alm.month, alm.day, > - alm.daylight, > - enabled == 1 ? "yes" : "no", > - pending == 1 ? "yes" : "no"); > - > - if (alm.timezone == EFI_UNSPECIFIED_TIMEZONE) > - seq_puts(seq, "Timezone\t: unspecified\n"); > - else > - /* XXX fixme: convert to string? */ > - seq_printf(seq, "Timezone\t: %u\n", alm.timezone); > - } > - > /* > * now prints the capabilities > */ > @@ -249,8 +183,6 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) > static const struct rtc_class_ops efi_rtc_ops = { > .read_time = efi_read_time, > .set_time = efi_set_time, > - .read_alarm = efi_read_alarm, > - .set_alarm = efi_set_alarm, > .proc = efi_procfs, > }; > > @@ -271,11 +203,7 @@ static int __init efi_rtc_probe(struct platform_device *dev) > platform_set_drvdata(dev, rtc); > > rtc->ops = &efi_rtc_ops; > - clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features); > - if (efi_rt_services_supported(EFI_RT_SUPPORTED_WAKEUP_SERVICES)) > - set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features); > - else > - clear_bit(RTC_FEATURE_ALARM, rtc->features); > + clear_bit(RTC_FEATURE_ALARM, rtc->features); > > device_init_wakeup(&dev->dev, true); > > -- > 2.50.0.727.gbf7dc18ff4-goog
On 7/14/25 02:08, Ard Biesheuvel wrote: > From: Ard Biesheuvel <ardb@kernel.org> > > The EFI rtc driver is used by non-x86 architectures only, and exposes > the get/set wakeup time functionality provided by the underlying > platform. This is usually broken on most platforms, and not widely used > to begin with [if at all], so let's just remove it. systemd uses the underlying functionality: a timer can wake the system up. I have no idea if that is implemented in terms of this function, though. -- Sincerely, Demi Marie Obenour (she/her/hers)
On Mon, 14 Jul 2025 at 16:13, Demi Marie Obenour <demiobenour@gmail.com> wrote: > > On 7/14/25 02:08, Ard Biesheuvel wrote: > > From: Ard Biesheuvel <ardb@kernel.org> > > > > The EFI rtc driver is used by non-x86 architectures only, and exposes > > the get/set wakeup time functionality provided by the underlying > > platform. This is usually broken on most platforms, and not widely used > > to begin with [if at all], so let's just remove it. > systemd uses the underlying functionality: a timer can wake the system up. > I have no idea if that is implemented in terms of this function, though. To be clear, you are referring to wake from poweroff at some date/time in the future, right? This change does not remove this functionality from the RTC subsystem, it just ceases to expose it on non-x86 EFI platforms that claim to support it. For reference (which I should have included in the cover letter) [0], there are arm64 server systems which always return an error when calling this API, and most non-server arm64 systems do not implement it to begin with. The patch in question implements one of the workarounds that was considered, which is to invoke GetWakeupTime() when registering the RTC, and disable the wakeup functionality if that fails. However, that call by itself could easily regress other platforms, where GetWakeupTime() was simply never called before, and where calling it may tickle other bugs. Hence this RFC: if nobody uses this API on non-x86 EFI platforms, then I'd rather not support it to begin with. [0] https://lore.kernel.org/all/20250710084151.55003-1-feng.tang@linux.alibaba.com/T/#u
On 7/14/25 02:19, Ard Biesheuvel wrote: > On Mon, 14 Jul 2025 at 16:13, Demi Marie Obenour <demiobenour@gmail.com> wrote: >> >> On 7/14/25 02:08, Ard Biesheuvel wrote: >>> From: Ard Biesheuvel <ardb@kernel.org> >>> >>> The EFI rtc driver is used by non-x86 architectures only, and exposes >>> the get/set wakeup time functionality provided by the underlying >>> platform. This is usually broken on most platforms, and not widely used >>> to begin with [if at all], so let's just remove it. >> systemd uses the underlying functionality: a timer can wake the system up. >> I have no idea if that is implemented in terms of this function, though. > > To be clear, you are referring to wake from poweroff at some date/time > in the future, right? Yes. > This change does not remove this functionality from the RTC subsystem, > it just ceases to expose it on non-x86 EFI platforms that claim to > support it. Do these platforms generally expose the functionality in a different way? If not, systemd should probably document that the functionality is non-portable if it doesn't do that already. -- Sincerely, Demi Marie Obenour (she/her/hers)
On Mon, 14 Jul 2025 at 16:22, Demi Marie Obenour <demiobenour@gmail.com> wrote: > > On 7/14/25 02:19, Ard Biesheuvel wrote: > > On Mon, 14 Jul 2025 at 16:13, Demi Marie Obenour <demiobenour@gmail.com> wrote: > >> > >> On 7/14/25 02:08, Ard Biesheuvel wrote: > >>> From: Ard Biesheuvel <ardb@kernel.org> > >>> > >>> The EFI rtc driver is used by non-x86 architectures only, and exposes > >>> the get/set wakeup time functionality provided by the underlying > >>> platform. This is usually broken on most platforms, and not widely used > >>> to begin with [if at all], so let's just remove it. > >> systemd uses the underlying functionality: a timer can wake the system up. > >> I have no idea if that is implemented in terms of this function, though. > > > > To be clear, you are referring to wake from poweroff at some date/time > > in the future, right? > > Yes. > > > This change does not remove this functionality from the RTC subsystem, > > it just ceases to expose it on non-x86 EFI platforms that claim to > > support it. > > Do these platforms generally expose the functionality in a different way? On x86, the CMOS rtc is manipulated directly (and this is officially condoned by the EFI spec). On non-x86, this functionality rarely works, which is really the point of this series. > If not, systemd should probably document that the functionality is > non-portable if it doesn't do that already. Not sure what you mean by non-portable. This functionality should be exposed in a generic manner (using the RTC subsystem interfaces), but only if it can be relied upon. On x86, the RTC subsystem will use the rtc-cmos driver, which implements the wakeup routines in terms of port I/O. If removing this functionality altogether from the EFI rtc driver is a problem, perhaps it would be better to implement an allowlist based solution that does not attempt to access the runtime services by default.
On Mon, 14 Jul 2025 08:08:45 +0200, Ard Biesheuvel wrote: > The EFI rtc driver is used by non-x86 architectures only, and exposes > the get/set wakeup time functionality provided by the underlying > platform. This is usually broken on most platforms, and not widely used > to begin with [if at all], so let's just remove it. > > Applied, thanks! [1/3] efi-rtc: Remove wakeup functionality https://git.kernel.org/abelloni/c/50562f9cd366 Best regards, -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
© 2016 - 2025 Red Hat, Inc.