Skip to content

Commit c0a4a1e

Browse files
jannauChristoph Hellwig
authored andcommitted
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent c06ba7b commit c0a4a1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/apple.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,11 +1001,11 @@ static void apple_nvme_reset_work(struct work_struct *work)
10011001
goto out;
10021002
}
10031003

1004-
if (anv->ctrl.ctrl_config & NVME_CC_ENABLE)
1005-
apple_nvme_disable(anv, false);
1006-
10071004
/* RTKit must be shut down cleanly for the (soft)-reset to work */
10081005
if (apple_rtkit_is_running(anv->rtk)) {
1006+
/* reset the controller if it is enabled */
1007+
if (anv->ctrl.ctrl_config & NVME_CC_ENABLE)
1008+
apple_nvme_disable(anv, false);
10091009
dev_dbg(anv->dev, "Trying to shut down RTKit before reset.");
10101010
ret = apple_rtkit_shutdown(anv->rtk);
10111011
if (ret)

0 commit comments

Comments
 (0)