Commit c0a4a1ea authored by Janne Grunau's avatar Janne Grunau Committed by Christoph Hellwig

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: default avatarJanne Grunau <j@jannau.net>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent c06ba7b8
...@@ -1001,11 +1001,11 @@ static void apple_nvme_reset_work(struct work_struct *work) ...@@ -1001,11 +1001,11 @@ static void apple_nvme_reset_work(struct work_struct *work)
goto out; 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 */ /* RTKit must be shut down cleanly for the (soft)-reset to work */
if (apple_rtkit_is_running(anv->rtk)) { 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."); dev_dbg(anv->dev, "Trying to shut down RTKit before reset.");
ret = apple_rtkit_shutdown(anv->rtk); ret = apple_rtkit_shutdown(anv->rtk);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment