From 1b916ce15894f0e1a610cabf805c0e895264606b Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 22:19:29 +1100 Subject: [PATCH] wifi: apple: centauri: T6050: don't veto s2idle for a failed or stopped N1 centauri_t6050_suspend() returns -EBUSY for every boot phase but READY when the sleep keeps the N1 powered (no firmware sleep). If the N1's automatic startup failed (CEN_BOOT_FAILED, for example a missing or bad firmware file) or the device was stopped (CEN_BOOT_STOPPED), nothing will ever move it to READY. Every s2idle is then refused, a lid close included, until the driver is unbound. Only a boot in flight (ROM, CYCLE, IPC) needs the sleep held off. On this path a ready N1 only gets its config space saved; the device stays powered through the sleep. A failed or stopped N1 has no boot work in flight either, so treat it the same way and let the system sleep. The firmware-sleep path is unchanged. Fixes: f044e1852ee1 ("wifi/Bluetooth: apple: centauri T6050: the N1 over a firmware sleep") Reported-by: RINNECODER <93304526+RINNECODER@users.noreply.github.com> Closes: https://github.com/aurora-silicon/linux/issues/1380 Signed-off-by: Ryan Murray Co-Authored-By: Claude Opus 5.5 --- .../wireless/apple/centauri/t6050/centauri_pci.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/apple/centauri/t6050/centauri_pci.c b/drivers/net/wireless/apple/centauri/t6050/centauri_pci.c index df385daa8da49..59072f44406c2 100644 --- a/drivers/net/wireless/apple/centauri/t6050/centauri_pci.c +++ b/drivers/net/wireless/apple/centauri/t6050/centauri_pci.c @@ -1035,8 +1035,18 @@ static int centauri_t6050_suspend(struct device *dev) struct centauri_t6050 *c = pci_get_drvdata(pdev); int ret; - if (!apple_centauri_sleep_reboot(pdev)) - return c->boot_phase == CEN_BOOT_READY ? pci_save_state(pdev) : -EBUSY; + if (!apple_centauri_sleep_reboot(pdev)) { + switch (READ_ONCE(c->boot_phase)) { + case CEN_BOOT_ROM: + case CEN_BOOT_CYCLE: + case CEN_BOOT_IPC: + /* A boot in flight; let it finish before the sleep. */ + return -EBUSY; + default: + /* Ready, or failed or stopped: nothing is in flight. */ + return pci_save_state(pdev); + } + } ret = centauri_t6050_quiesce(c); if (ret) goto recover;