Skip to contentSkip to conversation

Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance"

PATCH Applied Jon Hunter 2 participants 3 messages Oct 31, 2025

Subsystems (2)
lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 1/2 Revert "rtc: tps6586x: Fix initial enable_irq/disable_irq balance"

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")
---
 drivers/rtc/rtc-tps6586x.c | 1 -
 1 file changed, 1 deletion(-)
drivers/rtc/rtc-tps6586x.c +0 -1
index 76ecf7b798f0..54c8429b16bf 100644
@@ -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,
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 2/2 Revert "rtc: cpcap: Fix initial enable_irq/disable_irq balance"

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")

---
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(-)
drivers/rtc/rtc-cpcap.c +0 -1
index 8b6b35716f53..c170345ac076 100644
@@ -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,
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw
In reply to Jon Hunter
Quoted 5 lines · 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.

Quoted 8 lines

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,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com