From 43cf63fb4781e35fc1b25e6f2c8156866ba95872 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Tue, 10 Nov 2026 03:49:30 -0500 Subject: [PATCH 1/2] rtc: apple-pmu: register the alarm interrupt as a wake IRQ Associate the retained PMU alarm interrupt with its wakeup source instead of keeping the thread live through suspend. The IRQ core can then report a wake before the alarm is acknowledged over SPMI, and replay the pending interrupt after device resume. Clear the association on all probe failures and removal. Signed-off-by: Diljit Singh --- drivers/rtc/rtc-apple-pmu.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-apple-pmu.c b/drivers/rtc/rtc-apple-pmu.c index dd1abea676f18..cd46c9b9a10b1 100644 --- a/drivers/rtc/rtc-apple-pmu.c +++ b/drivers/rtc/rtc-apple-pmu.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -450,6 +451,7 @@ static void apple_pmu_rtc_release(void *context) struct apple_pmu_rtc *rtc = dev_get_drvdata(dev); disable_irq(rtc->interrupt); + dev_pm_clear_wake_irq(dev); mutex_lock(&rtc->transaction); if (apple_pmu_rtc_stop_alarm(rtc)) dev_err(dev, "cannot disable RTC alarm on removal\n"); @@ -493,14 +495,17 @@ static int apple_pmu_rtc_probe(struct platform_device *pdev) if (error) return error; /* - * This interrupt remains live during retained-power s2idle. The - * thread uses the parent PMIC's SPMI regmap to acknowledge the alarm. - * Off-domain wake routing is not established by this driver. + * Let the IRQ core wake the system before the thread acknowledges the + * alarm over the parent PMIC's SPMI regmap. Off-domain wake routing is + * still supplied by the platform sleep implementation. */ error = devm_request_threaded_irq(dev, rtc->interrupt, NULL, apple_pmu_rtc_interrupt, - IRQF_NO_AUTOEN | IRQF_NO_SUSPEND | IRQF_ONESHOT, + IRQF_NO_AUTOEN | IRQF_ONESHOT, dev_name(dev), dev); + if (error) + goto disable_wakeup; + error = dev_pm_set_wake_irq(dev, rtc->interrupt); if (error) goto disable_wakeup; error = apple_pmu_rtc_init_alarm(rtc); @@ -516,6 +521,7 @@ static int apple_pmu_rtc_probe(struct platform_device *pdev) return 0; disable_wakeup: + dev_pm_clear_wake_irq(dev); device_init_wakeup(dev, false); return error; } From 0b6665655c7778a15cf9d0c6264ef3cf1d646287 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Tue, 10 Nov 2026 04:04:25 -0500 Subject: [PATCH 2/2] soc: apple: keep suspend-to-idle out of the platform preparation The PM core falls back to the platform begin/end callbacks for suspend-to-idle when no s2idle callbacks are installed. Do not arm the platform watchdog, save the platform sleep state or set the firmware-suspend flag for that path. Otherwise device callbacks cut the debug link and prepare for a firmware commit which s2idle never invokes. Only stop the platform watchdog when that preparation ran. Signed-off-by: Diljit Singh --- drivers/soc/apple/sleep.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/soc/apple/sleep.c b/drivers/soc/apple/sleep.c index 1227c98d0abb4..443ef75b8cfab 100644 --- a/drivers/soc/apple/sleep.c +++ b/drivers/soc/apple/sleep.c @@ -2859,6 +2859,10 @@ static int apple_sleep_begin(suspend_state_t state) { /* The last sleep's cut is its port controller's to take, by its .complete. */ WRITE_ONCE(sleep_debug_link_cut, false); + /* The PM core also calls .begin for s2idle when no s2idle ops are installed. */ + if (state != PM_SUSPEND_MEM) + return 0; + if (apple_sleep) { apple_sleep->apcie_port_stopped = false; apple_sleep->usb_down_ran = false; @@ -2873,7 +2877,8 @@ static int apple_sleep_begin(suspend_state_t state) static void apple_sleep_end(void) { - writel(0, apple_sleep->wdt + WDT_WD2_CTL); + if (pm_suspend_via_firmware()) + writel(0, apple_sleep->wdt + WDT_WD2_CTL); } /*