linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Feng Tang <feng.tang@linux.alibaba.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org,  linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: efi: Add runtime check for the wakeup service capability
Date: Fri, 11 Jul 2025 11:26:18 +1000	[thread overview]
Message-ID: <CAMj1kXGiixvwsSmOz65F=OXQuHovO4DMAsJaPZ2sL3PBbMHh8A@mail.gmail.com> (raw)
In-Reply-To: <CAMj1kXHDFq3FZj4134CTcQZnke4t1=u6iRNNsQBvuhb3F6KurQ@mail.gmail.com>

On Fri, 11 Jul 2025 at 11:06, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Thu, 10 Jul 2025 at 18:41, Feng Tang <feng.tang@linux.alibaba.com> wrote:
> >
> > The kernel selftest of rtc reported a error on an ARM server which
> > use rtc-efi device:
> >
> >         RUN           rtc.alarm_alm_set ...
> >         rtctest.c:262:alarm_alm_set:Alarm time now set to 17:31:36.
> >         rtctest.c:267:alarm_alm_set:Expected -1 (-1) != rc (-1)
> >         alarm_alm_set: Test terminated by assertion
> >                  FAIL  rtc.alarm_alm_set
> >         not ok 5 rtc.alarm_alm_set
> >
> > The root cause is, the underlying EFI firmware doesn't support wakeup
> > service (get/set alarm), while it doesn't have the EFI RT_PROP table
> > either. As Ard Biesheuvel clarified [1], this breaks the UEFI spec,
> > which requires EFI firmware to provide a 'RT_PROP' table if it doesn't
> > support all runtime services (Section 4.6.2, UEFI spec 2.10).
> >
> > This issue was also reproduced on ARM server from another vendor, which
> > doesn't have RT_PROP table either. This means, in real world, there are
> > quite some platforms having this issue, that it doesn't support wakeup
> > service while not providing a correct RT_PROP table, which makes it
> > wrongly claimed to support it.
> >
> > Add a runtime check for the wakeup service to detect and correct this
> > kind of cases.
> >
> > [1]. https://lore.kernel.org/lkml/CAMj1kXEkzXsjm0dPhzxB+KdtzqADd4NmafKmw2rKw7mAPBrgdA@mail.gmail.com/
> >
> > Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
> > ---
> >  drivers/rtc/rtc-efi.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
>
> Thanks, I've queued this up now.
>

Actually, we might just remove the EFI get/set wakeup time
functionality altogether, as it seems rather pointless to me to begin
with.

I'll send out an RFC shortly.

  reply	other threads:[~2025-07-11  1:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10  8:41 [PATCH] rtc: efi: Add runtime check for the wakeup service capability Feng Tang
2025-07-11  1:06 ` Ard Biesheuvel
2025-07-11  1:26   ` Ard Biesheuvel [this message]
2025-07-11  8:56     ` Alexandre Belloni
2025-07-14  2:08       ` Ard Biesheuvel
2025-07-14  2:36         ` Bibo Mao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMj1kXGiixvwsSmOz65F=OXQuHovO4DMAsJaPZ2sL3PBbMHh8A@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=feng.tang@linux.alibaba.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).