Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions drivers/net/wireless/apple/centauri/t6050/centauri_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading