summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/apple.c
diff options
context:
space:
mode:
authorJanne Grunau <j@jannau.net>2023-01-17 19:25:01 +0100
committerChristoph Hellwig <hch@lst.de>2023-01-19 09:08:01 +0100
commitc0a4a1eafbd48e02829045bba3e6163c03037276 (patch)
tree60f162dfcc3d71b9eab04628b19e5e95f6d790ff /drivers/nvme/host/apple.c
parentc06ba7b892a50b48522ad441a40053f483dfee9e (diff)
nvme-apple: only reset the controller when RTKit is running
NVMe controller register access hangs indefinitely when the co-processor is not running. A missed reset is preferable over a hanging thread since it could be recoverable. Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/apple.c')
-rw-r--r--drivers/nvme/host/apple.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
index 146c9e63ce77..b317ce6c4ec3 100644
--- a/drivers/nvme/host/apple.c
+++ b/drivers/nvme/host/apple.c
@@ -1001,11 +1001,11 @@ static void apple_nvme_reset_work(struct work_struct *work)
goto out;
}
- if (anv->ctrl.ctrl_config & NVME_CC_ENABLE)
- apple_nvme_disable(anv, false);
-
/* RTKit must be shut down cleanly for the (soft)-reset to work */
if (apple_rtkit_is_running(anv->rtk)) {
+ /* reset the controller if it is enabled */
+ if (anv->ctrl.ctrl_config & NVME_CC_ENABLE)
+ apple_nvme_disable(anv, false);
dev_dbg(anv->dev, "Trying to shut down RTKit before reset.");
ret = apple_rtkit_shutdown(anv->rtk);
if (ret)