From patchwork Fri Feb 17 14:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13144821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0ADBC05027 for ; Fri, 17 Feb 2023 14:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UkwGWg8zuGdJ8Yz5lUO1XnbWcpeVsA3mOc4/qJGnwl8=; b=sNjWdbEp7esL90 m7NRBSVmqj/7Aul2fCv1rqyh8BGTpn2/BTXpPhctZ7Riyc84cjF8UOWJV6PVpVNgCidBj+n/c2NAD VXTZo41WyuceSiT8fKIahuVmbc1PmrrLprlU2bWWemBZqXkMA7rXiuwUDGq7OYjmkfqsAgmSDslQJ eGi/zeB4+Z11ifX4AQD7HwTu3mzG2r1poYwVrWbnqPBo1qR5ZHvB4R7d9bNBCHi1nbU8UebvJsiaF VyxMrKfIkDmwixr07ILvem4Q468uqFzX+3h6aaK9O227Veor24kVQRqwuA0ZicbTjjaPzt0/uL3yK s/C2hUaFipnZJcrzibLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pT1ei-00EX7m-Te; Fri, 17 Feb 2023 14:24:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pT1eV-00EX2u-EX for linux-arm-kernel@lists.infradead.org; Fri, 17 Feb 2023 14:23:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9CA9E61BD4; Fri, 17 Feb 2023 14:23:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29FA3C433EF; Fri, 17 Feb 2023 14:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676643834; bh=7H2DeJNOEk7tlRz3sYy/zEMbu3crAXpNlXvgJu8H2B4=; h=From:To:Cc:Subject:Date:From; b=Ryliv6CyfFtLPk07eFlM1P/VsYsX/f6nTJIhgKkH254ZWYbt9cspnrn7f4QUOpptC fjf3jxU0IFBjuoBPtPxdS+v1NW1iWasjA66+9Q3Rb2wBNfm+14lGYI41ySDBL75BGu 7rrRGEtg277a9mtwJrZmnk6xcJonfwNLkFssKam4UBKiuShXyCEdxfBwKiVAJJM8/m dAU5npIUenIDIyvvYu+EOFTgJpiYwucd10LTamfKfrCM7wdIswihhnWoVziYyDh/bW NC027eQkGGG7gOkZKAN1N7EhLSOdirgZavRFYI+Od9xv4sZzhHx3MU2WUBopfGUezC 8X0d+3A88l+uQ== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: a.zummo@towertech.it, alexandre.belloni@bootlin.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Ard Biesheuvel , Pierre Gondois , Alexandru Elisei Subject: [PATCH] rtc: efi: Avoid spamming the log on RTC read failure Date: Fri, 17 Feb 2023 15:23:38 +0100 Message-Id: <20230217142338.1444509-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1297; i=ardb@kernel.org; h=from:subject; bh=7H2DeJNOEk7tlRz3sYy/zEMbu3crAXpNlXvgJu8H2B4=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBj743p2GXrREsNQPTcNdf5BEQsIa5li4nOa/vDP VT7oy+Ci+KJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY++N6QAKCRDDTyI5ktmP JOQMDADAj7RTrpvWaj/z9/rWenkV64kqh5DBzl+USFcDavcgaH9/HcyE/xMykGaNQtKzRTyZB6O 52ewPcDnWvyZxAubHoM8vQB8CVs3eVE30PpWWjv7pKUGrbqopFbsxoENfUnHG/BExKRSOu99deN CdlzHSBbWg2Hiy5QLY06dy1JeL22opoORoCiux6vS81PRnEJUBzO3PRs4LHkd01KtwM4R3Y86RS 8X38i3YmXU8wqrE3O3BhCBL3Jpkyf+DLxIqabkxUpJgIn1/9cKwp3qEot8wjqs/LxgaiOlERG7f cSH7S9dpfVPPWR/gICye4knitO0kwiqL7qAEHHVVnsB+Wwtn4tZBcT9MgMPW+YxztFraXUMPvrg LPWReVlyoUwsdxrXc93euUs13Qg3wH2ZGIza49byPzjAoAqJ1a/scwJb0ESsAjGerE2A8AIUnAq jFAZC8FxB16GF5LCDfsmHfzZtcqugLQ3tE1gNhUO9L+F7jJYDoA+lzxzdiuiEoTcMno4w= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230217_062355_565131_2BDB21AB X-CRM114-Status: GOOD ( 13.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are cases where the EFI runtime services may end up in a funny state, e.g., due to a crash in the variable services, and this affects other EFI runtime services as well. That means that, even though GetTime() should not return an error, there are cases where it might, and there is no point in logging such an occurrence multiple times. This works around an issue where user space -apparently- keeps hitting on /dev/rtc if it fails to read the h/w clock, resulting in a tsunami of log spam and a non-responsive system as a result. Cc: Pierre Gondois Cc: Alexandru Elisei Link: https://lore.kernel.org/all/Y2o1hdZK9GGDVJsS@monolith.localdoman/ Signed-off-by: Ard Biesheuvel --- drivers/rtc/rtc-efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index e991cccdb6e9cee4..174959f783b8309b 100644 --- a/drivers/rtc/rtc-efi.c +++ b/drivers/rtc/rtc-efi.c @@ -164,7 +164,7 @@ static int efi_read_time(struct device *dev, struct rtc_time *tm) if (status != EFI_SUCCESS) { /* should never happen */ - dev_err(dev, "can't read time\n"); + dev_err_once(dev, "can't read time\n"); return -EINVAL; }