From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 183A61F239B; Fri, 11 Jul 2025 08:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752224173; cv=none; b=KzKz2LQkSNoYZjkEWl24Q/gv9EVNVAY7Hw1IEomRm8+C7E3GGdOXvL4cXd/YxKMC3WulqSF+aWeNcs+pwR1xO/mqyjhPxselUNN5L4LjVhXz6IGyfKMxJYQ7UmLYHoIk9I/rp/R52ia1Kr1HPuWBeICaf/ZFrhPcsl69EwITLWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752224173; c=relaxed/simple; bh=nGZxBPgcyvIXg3cWoL9n7n609A6VK6iikw5GRM1A1mw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TC3PnAK7Xb6CuKkSYinc7qLV7MtFGix1RC2oOqDQ+2/H1QzyzFyRJuCi7j7VYWsOxiXmFCwnx83FVd4Ah86j2qhik8JZvr1SJl9sBCqgswaLLRGtOtQMo+PFP0rWG6MgnT1BLcaOkUWDqSZbeOOJPKeR2JVmxUh1jV+DjZJ9wY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=MRndLyM9; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MRndLyM9" Received: by mail.gandi.net (Postfix) with ESMTPSA id 7DD9A205B6; Fri, 11 Jul 2025 08:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1752224169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h3s4Z6xT0P2MBx5071F2O5vZS5sxJmlJEOi3WGKuQ1M=; b=MRndLyM9KDDN2xOekjN5Fucibl4QMHrF4zp83Cu96ZGwegXXOXl/bo3+oJYx4Fc46ThJbC hUO0lgFZIuVQQ4os4qgc1HM3cixgBOz0htA0AcA4JjQmPddlb+k4Tcq2m8h13S9Zx/tyS0 MLGAh7xyQHMIdDbEH62Yvu4o1ygX+ILqMUjxZc+I2vMZ34//vhkqrh8bGggWAQ5Kpith7L d6mp2Nop54xeakqep10lQCq4H4QeVkA+pUGgaDPlAiewI2EBPl3FahtieCnn5ASotCvy0k H3yAY61SHaAGEw0VHjxe0kgMxkIHKvqTgQtziaHaIUiV7KwV9c6Z3t94W+ddkg== Date: Fri, 11 Jul 2025 10:56:08 +0200 From: Alexandre Belloni To: Ard Biesheuvel Cc: Feng Tang , 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 Message-ID: <20250711085608f4146d99@mail.local> References: <20250710084151.55003-1-feng.tang@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdegvdeklecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehlvgigrghnughrvgcuuegvlhhlohhnihcuoegrlhgvgigrnhgurhgvrdgsvghllhhonhhisegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeeijeefhfffkeejueehveeuveejvdelveejteduffehuedtffdufeejudffuedvtdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdgsohhothhlihhnrdgtohhmnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemvgdtfhgvmeegfhdvfhemvdelvgegmeehudejtgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemvgdtfhgvmeegfhdvfhemvdelvgegmeehudejtgdphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomheprghlvgigrghnughrvgdrsggvlhhlohhnihessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohephedprhgtphhtthhopegrrhgusgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepfhgvnhhgrdhtrghngheslhhinhhugidrrghlihgsrggsrgdrtghomhdpr hgtphhtthhopehlihhnuhigqdhrthgtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqvghfihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-GND-Sasl: alexandre.belloni@bootlin.com On 11/07/2025 11:26:18+1000, Ard Biesheuvel wrote: > On Fri, 11 Jul 2025 at 11:06, Ard Biesheuvel wrote: > > > > On Thu, 10 Jul 2025 at 18:41, Feng Tang 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 > > > --- > > > 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. I guess this is going to also solve the issue reported by loongson https://lore.kernel.org/linux-rtc/20250613061747.4117470-1-wangming01@loongson.cn/ However, please let me take care of patches in my subsystem... -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com