[0/2] nvme-apple: Fix suspend-resume regression

Message ID 20230111043614.27087-1-marcan@marcan.st
Headers
Series nvme-apple: Fix suspend-resume regression |

Message

Hector Martin Jan. 11, 2023, 4:36 a.m. UTC
  Commit c76b8308e4c9 introduced a behavior change in the way nvme-apple
disables controllers, avoiding a disable in the shutdown path.
Unfortunately, the NVMe core does not know how to actually start up
controllers in the shutdown state, and this broke suspend/resume since
we use the shutdown command for device suspend in nvme-apple.

Additionally, nvme-apple was also checking only for the disable state in
the reset path to decide whether to disable the controller again, and
just having the controller shut down was triggering an unnecessary code
path that broke things further.

This short series fixes those issues and makes suspend/resume work on
nvme-apple again.

nvme-pci is, to my knowledge, not affected since it only issues a shutdown
when the whole system is actually shutting down, never to come back.

Hector Martin (2):
  nvme-apple: Do not try to shut down the controller twice
  nvme: Handle shut down controllers during initialization

 drivers/nvme/host/apple.c |  3 ++-
 drivers/nvme/host/core.c  | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)