From patchwork Tue Dec 3 10:45:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13892187 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 19088E69EA6 for ; Tue, 3 Dec 2024 11:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=f4GQahu87vhd88hFE8JRJ4HYD1rmTxDILIyZYp/HAr0=; b=nFRS9t989rSCQlqNcGnr2JIW5S PW5aJbApAhUrMJ/gyMJPVZC/U0OPU+7e5MVr1zl88ataNv9jfwZmvRA2DKJ4bFEkMGMzKt2fjetZh +IlVO53DePJHpBkp5kIkYYU8CbNZWwFGpyUXJDGlqhOTNztQHDt6Htb9m4/j+No1+wmZdPY53oDTf w+lQTrfYTa75ymt/SQZeCefbaI8VtGkCkzksq8WzO2Jbk98E7pO0CcvgtHBhOTRLruu9JunfHHLIC 3Kphz75y3+D3ewFBndJ+ynNNZO2sGfEieoV/zsitxKyjglTdGv/zXtYyaY3WE978Adz3BwiOE4vfG JxOj75dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIQi5-00000009BtA-0Gaj; Tue, 03 Dec 2024 11:04:53 +0000 Received: from www530.your-server.de ([188.40.30.78]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIQPu-000000097rf-1B8W for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 10:46:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=f4GQahu87vhd88hFE8JRJ4HYD1rmTxDILIyZYp/HAr0=; b=tqaVNbPcmZNh+77T/UilL7CrLP hH97DpmQufsim5ee71fVIWWOPVc9PDHG+XRTv40HynXgbp34guCl4PRSYIEm41jsO9mlGc2CUexM+ caJFCKBIfL8am3OCGuYPMnyB9iyBp33SJrc2UvuT+gZHBMzPxltUdA91XVEsE0hsBOEe79BTBp/1P 5lJn2qKzt/+QXaQQ5RBMnffyYEzw34UbijAuQAzD1W2JW8vh5LzHsMXbDIurMsBdTBqvxkHOOvB1Z SKWv4W31aByqTB+Heuw2UxesLhuYKfy5mJPCDYNbQw7nZVPuzMTTweXyDqoz7dBjYYAkTQEB+w1XF EZKMvqGw==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQPh-0001On-FH; Tue, 03 Dec 2024 11:45:53 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tIQPg-000L8G-2g; Tue, 03 Dec 2024 11:45:53 +0100 From: Esben Haabendal Date: Tue, 03 Dec 2024 11:45:31 +0100 Subject: [PATCH 1/6] rtc: interface: Fix long-standing race when setting alarm MIME-Version: 1.0 Message-Id: <20241203-rtc-uie-irq-fixes-v1-1-01286ecd9f3f@geanix.com> References: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> In-Reply-To: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Esben Haabendal , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733222752; l=2485; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=UAN7dJJYBHqrrdv1gqBUohBZJi21Jc3c9XZjYqmVsUA=; b=Gioy18FoeQopz/OaoQ+E5tbVP+NcprFBYM1Wuwd8vtThzFcyh6O4hvETtrPhXzR2z1l7vN4hh eN702yy0ltZAyvpluSKY5QQatXoRSASaJdKAcEkpnxBOS59ucOImBnP X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27476/Tue Dec 3 10:52:11 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_024606_351154_13DF074E X-CRM114-Status: GOOD ( 18.73 ) 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 As described in the old comment dating back to commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events") from 2010, we have been living with a race window when setting alarm with an expiry in the near future (i.e. next second). With 1 second resolution, it can happen that the second ticks after the check for the timer having expired, but before the alarm is actually set. When this happen, no alarm IRQ is generated, at least not with some RTC chips (isl12022 is an example of this). With UIE RTC timer being implemented on top of alarm irq, being re-armed every second, UIE will occasionally fail to work, as an alarm irq lost due to this race will stop the re-arming loop. For now, I have limited the additional expiry check to only be done for alarms set to next seconds. I expect it should be good enough, although I don't know if we can now for sure that systems with loads could end up causing the same problems for alarms set 2 seconds or even longer in the future. I haven't been able to reproduce the problem with this check in place. Cc: stable@vger.kernel.org Signed-off-by: Esben Haabendal --- drivers/rtc/interface.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index aaf76406cd7d7d2cfd5479fc1fc892fcb5efbb6b..e365e8fd166db31f8b44fac9fb923d36881b1394 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -443,6 +443,29 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) else err = rtc->ops->set_alarm(rtc->dev.parent, alarm); + /* + * Check for potential race described above. If the waiting for next + * second, and the second just ticked since the check above, either + * + * 1) It ticked after the alarm was set, and an alarm irq should be + * generated. + * + * 2) It ticked before the alarm was set, and alarm irq most likely will + * not be generated. + * + * While we cannot easily check for which of these two scenarios we + * are in, we can return -ETIME to signal that the timer has already + * expired, which is true in both cases. + */ + if ((scheduled - now) <= 1) { + err = __rtc_read_time(rtc, &tm); + if (err) + return err; + now = rtc_tm_to_time64(&tm); + if (scheduled <= now) + return -ETIME; + } + trace_rtc_set_alarm(rtc_tm_to_time64(&alarm->time), err); return err; } From patchwork Tue Dec 3 10:45:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13892179 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 D7162E69E9F for ; Tue, 3 Dec 2024 11:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2vJ5gzpYa+APGJDBpuV2gyqdCOt2zO7G8uCRrZjW9y0=; b=PSlfIAySDRtdjsmEz52dgcuczb rF7UQ2ui225se7shbGxsIbTqQDO+0AT9fB1liY4SLvISRTumg8laFmZBoLa4JGBuageFTnXKOk9ET 6b8+MGO8vTwr6sJb+GLDXQlOE2HPUj5UMqcT6N7WI1UaUAkhx5Cz/uYJJeUpREads4RcVnTPY4RxZ gJmEPz4l/YxZTfWcQciguNnCTlmq2xl56ZkLhFaObV6tkyCh8SY6SW0e3I6r7T2s0JQ0v/io1n7uC DCIeI7DMh/PWyFJK81GfO1RFHqcAT1c+VauYWbdF31H8pfFkD6oFuqvVcbU2gNivqrwb4+gQ1C1Fh MXHghpxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIQdD-00000009AhX-3klJ; Tue, 03 Dec 2024 10:59:51 +0000 Received: from www530.your-server.de ([188.40.30.78]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIQPq-000000097rv-1fWO for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 10:46:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=2vJ5gzpYa+APGJDBpuV2gyqdCOt2zO7G8uCRrZjW9y0=; b=SMxnv0KZn0jLSnJChxqT2LPcu2 +wnN8N+LoFav+6urlxBrWNkaTklnvJ7hvApd2rCIbsWT21LNHIWq57KeMsRno6e7D+UYw7Q+mJJwT cjl0hYjG+FoLqUGvde1PUteQE/esQU0SDJvuTu/C6g9XvQ3iCXeM2s0fo0rnot5zQctpRZ+NtyZ8Z fARD3fHMsQS/SxDZhgRDZddLznjDNIHCtO8VsmeeLeEi4Ipwi/2hzPimnUMSBPPdwT2KBgSCNs17E 9sm8VEmTOFyOZhgTe5x73s3s8r95SHHuzCG4AQ20XLIjAG6NpWED//3b2axW98K44RBCLm2DCVb+G FNcSoolg==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQPh-0001Ov-Ro; Tue, 03 Dec 2024 11:45:53 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tIQPh-000L9W-0p; Tue, 03 Dec 2024 11:45:53 +0100 From: Esben Haabendal Date: Tue, 03 Dec 2024 11:45:32 +0100 Subject: [PATCH 2/6] rtc: isl12022: Fix initial enable_irq/disable_irq balance MIME-Version: 1.0 Message-Id: <20241203-rtc-uie-irq-fixes-v1-2-01286ecd9f3f@geanix.com> References: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> In-Reply-To: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Esben Haabendal X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733222752; l=849; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=aLsSYnYzd0GPXM1Me/YHB+us7IQCUlk6jk1u8U6Lfns=; b=uWTWtCFJ+1XCx6axiciAWY6NQo5kJc0CFu2XxJjYzRM1XOX9JP+ysUOosmQa4MZgpTO7AdLqP /u3wffJpPH5DOdWaMPymcZHBnZFpCiff9tEbSgtJNcokq4fsFxkACtU X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27476/Tue Dec 3 10:52:11 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_024602_483837_86142558 X-CRM114-Status: UNSURE ( 8.32 ) X-CRM114-Notice: Please train this message. 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 Interrupts are automatically enabled when requested, so we need to initialize irq_enabled accordingly to avoid causing an unbalanced enable warning. Fixes: c62d658e5253 ("rtc: isl12022: Add alarm support") Signed-off-by: Esben Haabendal --- drivers/rtc/rtc-isl12022.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index 9b44839a7402c9ab7da634d95152c2520eb8552e..5fc52dc6421305e957a0c3a169009c3f6a6c7320 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -413,6 +413,7 @@ static int isl12022_setup_irq(struct device *dev, int irq) if (ret) return ret; + isl12022->irq_enabled = true; ret = devm_request_threaded_irq(dev, irq, NULL, isl12022_rtc_interrupt, IRQF_SHARED | IRQF_ONESHOT, From patchwork Tue Dec 3 10:45:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13892181 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 48BCEE69E9F for ; Tue, 3 Dec 2024 11:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nX4bkbIZKpT7sODYvlUnUTFKlu0EJnUa7K5EJrNYpnI=; b=P2CPF7nkzLNpPBK9PVVxx++2GV 2It+rPYeEUmXe02YVgADlSqgNwh1tKQePBT6Yo0GDb8U0B8XtxYd3/PM5aYVxU0+axqv2tdxExZhk Af4umqn96Lf1f+lR2mHHU9EidRfnHQR0w0EFYp3TU5wb1yjuT5m2h2qWABO54kLhZ44sV36SCGqLm MBhZdh9jT8bFxXNU9PaqXkBVoWK0ev2ikFLHEgGOlGQ+L20UM0P7EQeY52tAtQsJ2kf/E9K8ZBJWk LjCy8uY2tcYQMzMlrBguqza1NAeZ6qRr17vSMM4w4xTuSYvDkl8TP6rItvQxcEQZl1+FXWTxbab38 KjW8M6WQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIQfA-00000009B6X-0h0e; Tue, 03 Dec 2024 11:01:52 +0000 Received: from www530.your-server.de ([188.40.30.78]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIQPq-000000097sD-0XpB for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 10:46:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=nX4bkbIZKpT7sODYvlUnUTFKlu0EJnUa7K5EJrNYpnI=; b=ZUjl4u0PaXGwcTI9JyDaApkeDd guJmK9tROv4XV6z1g2pBzD0MHtIerd2KWGlnGO0T5ELQoVOEPc8I/GEJVcNI91KYx5F1IlpeuBILy 1LdF44sHZPMGDYrMttP3dfUZ8EQ9dz/ZFPHwjsqzXqDLnf3SzOtb4JosrXSE7aTLMvmJCYJVFDv+Z Frc33UuUlEbJ8QeddEnJlnYn6WyNFk1FueJc5ioqP4gcq6a/YKwMp8fGpYdNDzOiLp+uPSGrdUBJb oNfltBafrhC9vOF7wqphSvzH0VRfz3e2swbIq7q7YDnRglYlKQZBXhzY69oEuNqqvbv/4VyIsci+C zCqn8dng==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQPi-0001P6-8A; Tue, 03 Dec 2024 11:45:54 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tIQPh-000LAz-2C; Tue, 03 Dec 2024 11:45:53 +0100 From: Esben Haabendal Date: Tue, 03 Dec 2024 11:45:33 +0100 Subject: [PATCH 3/6] rtc: cpcap: Fix initial enable_irq/disable_irq balance MIME-Version: 1.0 Message-Id: <20241203-rtc-uie-irq-fixes-v1-3-01286ecd9f3f@geanix.com> References: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> In-Reply-To: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Esben Haabendal X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733222752; l=822; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=lfceF/R4zTEKZtMbD2dtF8hRgU22gyhkWzqZ3V/HmJo=; b=85nu3Rb3mId3Ufq7YSxPYM3kCNK9+/t/TLYGoPM4g2wqqf7gttiZ56EwrnAoJ9+1Z5OQUFACb V0fF4wGUVqOCpiYWkU4xYH7Io8dhgu1axxAS9+CuYtuDnZ7Cq+fMKjs X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27476/Tue Dec 3 10:52:11 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_024602_457837_E3333CCD X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. 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 Interrupts are automatically enabled when requested, so we need to initialize alarm_enabled accordingly to avoid causing an unbalanced enable warning. Signed-off-by: Esben Haabendal --- drivers/rtc/rtc-cpcap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c index afc8fcba8f8885c15730e47fe0a9d3f681e3cba4..b74148935d21ff69095e703e99bf024714e41ac1 100644 --- a/drivers/rtc/rtc-cpcap.c +++ b/drivers/rtc/rtc-cpcap.c @@ -268,6 +268,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev) return err; rtc->alarm_irq = platform_get_irq(pdev, 0); + rtc->alarm_enabled = true; err = devm_request_threaded_irq(dev, rtc->alarm_irq, NULL, cpcap_rtc_alarm_irq, IRQF_TRIGGER_NONE | IRQF_ONESHOT, From patchwork Tue Dec 3 10:45:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13892183 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 67B90E69E9F for ; Tue, 3 Dec 2024 11:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HckHfqd1Ci6rmjSqq4jkSS7hiji1q1F7NU0SCgFEvmw=; b=Kp8CQZGImMlci+U7WNLtGOFD4X sg8I6RGSvGh5xW3God5MrykuEDKb9Zfai/PD0F8lZ24oF8PsdjsunXJXQIZCo0UOcxQ9f/jLlhFix aPvvcb0ustOJPH+L2E4cy/LcbLmGEjob6TIBSt6YPSoFjzX/n1EuBXjgtqgidH21vtOXrCplV0NBg NS2UQfxW/33DE+A6bcOTci3xXYO3nr7mmQYNdL5DNO0Rf/VdudkQyMInEDs7jk1KMEi7uMCZgc/sZ fD0bK9UkAKz1fjo5u9rgsc+3/d5AuDokVnp4REsbuPWbTSX55kom7kaAD0oXURUx04bqHWJmCltwD MOz8PnYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIQh7-00000009Bh2-1yLL; Tue, 03 Dec 2024 11:03:53 +0000 Received: from www530.your-server.de ([188.40.30.78]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIQPs-000000097uH-3ECK for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 10:46:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=HckHfqd1Ci6rmjSqq4jkSS7hiji1q1F7NU0SCgFEvmw=; b=GYJJlfCTzz73b3h2Mt6iEEDNRu AOeaqNKu9mpvJQY8YbJjd1ZfBMvJwxlxsTD37HpItfsU9han+JWfFOJKUxaCArHc+RRbnkYiJglrV UcyVdWDrF6PwqJjK3Oyj03pcPmIPOR/F/6uKgLHlK32r7NBRH2hcbgLElX8CAHqwOQ6M5vAN3tI93 uLwdtRWhBhBt/13KLlLW8g/1NqrGhK+xri6yTUwt8tGj+k1JF8sFCVjnUpHFHgTFurueeejNCVa1P 2aKxSFzRDJck5ezBB0XGUXo/7nrCxc5BzQMuLa5iq5hJ1miHzs373wU1WDrdxR/KdGv42HF15lPSc nJOIGDCw==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQPi-0001PS-Px; Tue, 03 Dec 2024 11:45:54 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tIQPi-000LCx-0P; Tue, 03 Dec 2024 11:45:54 +0100 From: Esben Haabendal Date: Tue, 03 Dec 2024 11:45:34 +0100 Subject: [PATCH 4/6] rtc: st-lpc: Fix initial enable_irq/disable_irq balance MIME-Version: 1.0 Message-Id: <20241203-rtc-uie-irq-fixes-v1-4-01286ecd9f3f@geanix.com> References: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> In-Reply-To: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Esben Haabendal , Patrice Chotard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733222752; l=826; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=HikzWfGUHdTPcWzOAsF0rH2hfac+zvWroN/rJRztwt0=; b=8Vqg6fZTE/p/+KF1BlVVtd+83PourQxUoWZXQn/mUt9bvnFZCLorV9aF867KVouKsn3OJN2sl wqfo9+wfKNmD24TJGy5aeAutisgd/gGfeZmtBfh7RiGY6hoJHR63G0G X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27476/Tue Dec 3 10:52:11 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_024604_814613_6A87D900 X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. 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 Interrupts are automatically enabled when requested, so we need to initialize irq_enabled accordingly to avoid causing an unbalanced enable warning. To: Patrice Chotard Signed-off-by: Esben Haabendal --- drivers/rtc/rtc-st-lpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index c6d4522411b312f94de2701ff4ff491e5323aa96..dbc2c23bca23f5de6de3fd4b39c9c67290bfd78d 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c @@ -218,6 +218,7 @@ static int st_rtc_probe(struct platform_device *pdev) return -EINVAL; } + rtc->irq_enabled = true; ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, IRQF_NO_AUTOEN, pdev->name, rtc); if (ret) { From patchwork Tue Dec 3 10:45:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13892180 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 E5B33E69E9F for ; Tue, 3 Dec 2024 11:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WApADZKBlq3j3lJdD1KVN3i3EQ3JBwzraehjqPZ59qw=; b=4aR0WfdiRxMnx+mSmWWBIs4YN0 W8pOjrz3Jf9jeX0SuVf5oNOhd8CPuidFl9/JOPYwy/uLNPs715FvXD6NQp1b1ssOtwdIfbXlOHL7C VlPFLQwyohdxw4doiVs6YcecWaDy5KRa3ltB+Mlj+YQU38C1h7ORBMnV3BgurabBzr4sq5lFoNpVm VhYreGYkEgznnSQrTwE6geEMqelPi4CSb6DHZ9/3NowGywKtWvyYn39ZA1qW3nhXjTla4mNX4c5Dp Plsp5yGZ9LJ0eivsHq9D4xEGJNcF1t9cUnZSYX5imee4GB7TsSadmHq4591JH3necQKtAiLwY1x/P D2zj80Eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIQeB-00000009Apj-2Qor; Tue, 03 Dec 2024 11:00:51 +0000 Received: from www530.your-server.de ([188.40.30.78]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIQPq-000000097sR-0sIt for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 10:46:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=WApADZKBlq3j3lJdD1KVN3i3EQ3JBwzraehjqPZ59qw=; b=M7uJAsU5fDKbVFglFHGswVCFpu wdR3a3HcWQqbcEMsMf8YL9OaxtnrpqFjaAvwk3evdMxSHv0hasZrd5GyKOZ+CDE8l2lGOKFosrlF/ Wovc0si+FafxjafqCPnndFUKYlaooV5XsW4/wLAsAs0V4aQC53HU6OjcZGDZ/DEVZhziYlEm6Eyzj 6Vr/5mBxcZ9bdoD3Y73QxVcryc0HQj5eaEuGSAQu9yd/7aXNqMQxUshLLJkbuUeZYRQYgD35D/rRd s/ixaA6bZXTEN91e4benfAdBS4MMya5kD28D9UHe4vPTNUVPfUFUHM+aM99GizDi7Ymp+yOTIA9EK wXanh/oA==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQPj-0001Pf-7j; Tue, 03 Dec 2024 11:45:55 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tIQPi-000LEU-1u; Tue, 03 Dec 2024 11:45:54 +0100 From: Esben Haabendal Date: Tue, 03 Dec 2024 11:45:35 +0100 Subject: [PATCH 5/6] rtc: tps6586x: Fix initial enable_irq/disable_irq balance MIME-Version: 1.0 Message-Id: <20241203-rtc-uie-irq-fixes-v1-5-01286ecd9f3f@geanix.com> References: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> In-Reply-To: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Esben Haabendal X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733222752; l=791; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=TUFCOTwIdhBII4MetoSWEIKjJ6AZodGxnrFm8Wl+ZIE=; b=MNCoBNJy0N6XD8lT7Ymd2mtjlDVYqgW2/cSEAWw4WeUko3mDRKhp3nl0v9qHQY14CengPCy5y QO0U8hfZ9JyChM0ylxJ15HJXORpgUlbuYq9nTomK+9QFxHKoIq/OGs9 X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27476/Tue Dec 3 10:52:11 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_024602_466726_479C82CC X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. 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 Interrupts are automatically enabled when requested, so we need to initialize irq_en accordingly to avoid causing an unbalanced enable warning. Signed-off-by: Esben Haabendal --- drivers/rtc/rtc-tps6586x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c index e796729fc817c1bd99f4c70b714a346fc1a795d2..c8ccb4779b50b2c5909e6a64748f52b61e78dac5 100644 --- a/drivers/rtc/rtc-tps6586x.c +++ b/drivers/rtc/rtc-tps6586x.c @@ -258,6 +258,7 @@ static int tps6586x_rtc_probe(struct platform_device *pdev) irq_set_status_flags(rtc->irq, IRQ_NOAUTOEN); + rtc->irq_en = true; ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL, tps6586x_rtc_irq, IRQF_ONESHOT, From patchwork Tue Dec 3 10:45:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13892178 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 A88EDE69E9F for ; Tue, 3 Dec 2024 10:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=q4sUFc93gmjBPZgy68yfM8oI42T2WlPXmr5pgphYQSI=; b=eTaBrB5/Ovplvn1+ovvHQGoZG2 2s3KU0V4Cx645+WJcbXwLJzD2Ka21k3M/Wqi/TN00AGvrBmx7vLwhfibZ74IssoychjH1TXyXwBH1 wJIOUMgdF900sdlo4pI3WPE0O8gOiKh/pBFqor3IPwfR6GgwWyDsX2hmVXIDtDJfLA9UzHplCMm+r kSHfjDOFDHJn4M9LMhnd2UzSdxb3I+qqpgB+Asr6goqLQllUyxKO3HLxnAcVqVz7naYUZURMA733C PiKPYZHeLwwhBXPyGaGYGGsjRkagc9ksxOYf8RdE0A9Vnh+iHqUeef2x6rEsssWNF6mFpgg83fkFR ZbchSr6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIQcF-00000009ATf-1IYx; Tue, 03 Dec 2024 10:58:51 +0000 Received: from www530.your-server.de ([188.40.30.78]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIQPq-000000097sX-0PHI for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 10:46:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=q4sUFc93gmjBPZgy68yfM8oI42T2WlPXmr5pgphYQSI=; b=nTrt4M3CasJxXw6OBstUtotAwB 1WpkLzMA5oiU3Ba86Sa2CIFx8lJwxpKMWvAhVTsNWCxypFy4crjYZgHxUfIjloq0PSFz9Z6mLCja8 oq1Ce0VtkITV8dQ7PqrelwFvQHDwT+b1Ka3jhM/rn1oR5Lpws+Lo9izXljgMkZSYsre8Bx389bRnP m1saEEoL2bDUQ9moGPwOIR5M3wyGvAH8jduBhN+/ibCY1f5PAQSQbspSClgVADFxNO5RNubN7YcRG d8EkB38Vd+VTVd8H6GhekIHctrFkou6mPGf/KuaA5iKodR8RAy5PIHKzlCqZFJhYeKjFp9d/MmEEP 8YY/dTaw==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQPj-0001Pu-Nv; Tue, 03 Dec 2024 11:45:55 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tIQPj-000LGA-0D; Tue, 03 Dec 2024 11:45:55 +0100 From: Esben Haabendal Date: Tue, 03 Dec 2024 11:45:36 +0100 Subject: [PATCH 6/6] rtc: interface: Ensure alarm irq is enabled when UIE is enabled MIME-Version: 1.0 Message-Id: <20241203-rtc-uie-irq-fixes-v1-6-01286ecd9f3f@geanix.com> References: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> In-Reply-To: <20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com> To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Esben Haabendal , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733222752; l=1219; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=9Dt96s2Bcm1MRb0U9H3U4fTwQJyZ4SwoQ7T4izq5lpw=; b=r3Dyu5602AIrHx2dWjtPnTDJcvMVNYZzvLiEShal74iF5XFHfuxtkFwXBxg/GB5IcrPZAcp/Y sUdFz60GGCoARdQ0Yvo2lFgP3OoUSFmijOQzgDAwUvHBkSD7c4NrMhn X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27476/Tue Dec 3 10:52:11 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_024602_448891_7B205A1D X-CRM114-Status: GOOD ( 10.62 ) 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 When setting a normal alarm, user-space is responsible for using RTC_AIE_ON/RTC_AIE_OFF to control if alarm irq should be enabled. But when RTC_UIE_ON is used, interrupts must be so that the requested irq events are generated. When RTC_UIE_OFF is used, alarm irq is disabled if there are no other alarms queued, so this commit brings symmetry to that. Signed-off-by: Esben Haabendal Cc: stable@vger.kernel.org --- drivers/rtc/interface.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index e365e8fd166db31f8b44fac9fb923d36881b1394..39db12f267cc627febb78e67400aaf8fc3301b0c 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -617,6 +617,10 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) rtc->uie_rtctimer.node.expires = ktime_add(now, onesec); rtc->uie_rtctimer.period = ktime_set(1, 0); err = rtc_timer_enqueue(rtc, &rtc->uie_rtctimer); + if (!err && rtc->ops && rtc->ops->alarm_irq_enable) + err = rtc->ops->alarm_irq_enable(rtc->dev.parent, 1); + if (err) + goto out; } else { rtc_timer_remove(rtc, &rtc->uie_rtctimer); }