* [PATCH 1/2] Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance"
@ 2025-10-31 10:37 Jon Hunter
2025-10-31 10:37 ` [PATCH 2/2] Revert "rtc: cpcap: " Jon Hunter
2025-10-31 13:20 ` [PATCH 1/2] Revert "rtc: tps6586x: " Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Jon Hunter @ 2025-10-31 10:37 UTC (permalink / raw)
To: Alexandre Belloni, Esben Haabendal
Cc: linux-rtc, linux-kernel, linux-tegra, Jon Hunter
Commit 1502fe0e97be ("rtc: tps6586x: Fix initial enable_irq/disable_irq
balance") breaks the wake-up alarm for the tps6586x. After this commit
was added RTC wake ups from suspend stopped working on the Tegra20
Ventana platform.
The problem is that this change set the 'irq_en' variable to true prior
to calling devm_request_threaded_irq() to indicate that the IRQ is
enabled, however, it was over looked that the flag IRQ_NOAUTOEN is
already set meaning that the IRQ is not enabled by default. This
prevents the IRQ from being enabled as expected. Revert this change to
fix this.
Fixes: 1502fe0e97be ("rtc: tps6586x: Fix initial enable_irq/disable_irq balance")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
drivers/rtc/rtc-tps6586x.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
index 76ecf7b798f0..54c8429b16bf 100644
--- a/drivers/rtc/rtc-tps6586x.c
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -258,7 +258,6 @@ 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,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Revert "rtc: cpcap: Fix initial enable_irq/disable_irq balance"
2025-10-31 10:37 [PATCH 1/2] Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance" Jon Hunter
@ 2025-10-31 10:37 ` Jon Hunter
2025-10-31 13:20 ` [PATCH 1/2] Revert "rtc: tps6586x: " Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Jon Hunter @ 2025-10-31 10:37 UTC (permalink / raw)
To: Alexandre Belloni, Esben Haabendal
Cc: linux-rtc, linux-kernel, linux-tegra, Jon Hunter
Commit e0762fd26ad6 ("rtc: cpcap: Fix initial enable_irq/disable_irq
balance") set 'alarm_enabled' prior to calling the function
devm_request_threaded_irq() because this enables the IRQ. However, right
after calling devm_request_threaded_irq(), the driver calls
disable_irq() to disable the IRQ and so now 'alarm_enabled' will be true
but the IRQ is actually disabled. Revert this commit to fix the
'alarm_enabled' state.
Fixes: e0762fd26ad6 ("rtc: cpcap: Fix initial enable_irq/disable_irq balance")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
I don't have a board with this device, but from reviewing the code this
does look correct.
drivers/rtc/rtc-cpcap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c
index 8b6b35716f53..c170345ac076 100644
--- a/drivers/rtc/rtc-cpcap.c
+++ b/drivers/rtc/rtc-cpcap.c
@@ -268,7 +268,6 @@ 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,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance"
2025-10-31 10:37 [PATCH 1/2] Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance" Jon Hunter
2025-10-31 10:37 ` [PATCH 2/2] Revert "rtc: cpcap: " Jon Hunter
@ 2025-10-31 13:20 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2025-10-31 13:20 UTC (permalink / raw)
To: Esben Haabendal, Jon Hunter; +Cc: linux-rtc, linux-kernel, linux-tegra
On Fri, 31 Oct 2025 10:37:40 +0000, Jon Hunter wrote:
> Commit 1502fe0e97be ("rtc: tps6586x: Fix initial enable_irq/disable_irq
> balance") breaks the wake-up alarm for the tps6586x. After this commit
> was added RTC wake ups from suspend stopped working on the Tegra20
> Ventana platform.
>
> The problem is that this change set the 'irq_en' variable to true prior
> to calling devm_request_threaded_irq() to indicate that the IRQ is
> enabled, however, it was over looked that the flag IRQ_NOAUTOEN is
> already set meaning that the IRQ is not enabled by default. This
> prevents the IRQ from being enabled as expected. Revert this change to
> fix this.
>
> [...]
Applied, thanks!
[1/2] Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance"
https://git.kernel.org/abelloni/c/b1c9390f0a44
[2/2] Revert "rtc: cpcap: Fix initial enable_irq/disable_irq balance"
https://git.kernel.org/abelloni/c/0d510778c2f4
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-31 13:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 10:37 [PATCH 1/2] Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance" Jon Hunter
2025-10-31 10:37 ` [PATCH 2/2] Revert "rtc: cpcap: " Jon Hunter
2025-10-31 13:20 ` [PATCH 1/2] Revert "rtc: tps6586x: " Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox