[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230111043614.27087-2-marcan@marcan.st>
Date: Wed, 11 Jan 2023 13:36:13 +0900
From: Hector Martin <marcan@...can.st>
To: Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...com>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>
Cc: Eric Curtin <ecurtin@...hat.com>, Janne Grunau <j@...nau.net>,
Sven Peter <sven@...npeter.dev>,
Alyssa Rosenzweig <alyssa@...enzweig.io>,
asahi@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
Hector Martin <marcan@...can.st>
Subject: [PATCH 1/2] nvme-apple: Do not try to shut down the controller twice
The blamed commit stopped explicitly disabling the controller when we do
a controlled shutdown, but apple_nvme_reset_work was only checking for
the disable bit before deciding to issue another disable. Check for the
shutdown state too, to avoid breakage.
This issue does not affect nvme-pci, since it only issues controller
shutdowns when the system is actually shutting down anyway.
Fixes: c76b8308e4c9 ("nvme-apple: fix controller shutdown in apple_nvme_disable")
Signed-off-by: Hector Martin <marcan@...can.st>
---
drivers/nvme/host/apple.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
index e13a992b6096..1961376447dc 100644
--- a/drivers/nvme/host/apple.c
+++ b/drivers/nvme/host/apple.c
@@ -1023,7 +1023,8 @@ static void apple_nvme_reset_work(struct work_struct *work)
goto out;
}
- if (anv->ctrl.ctrl_config & NVME_CC_ENABLE)
+ if (anv->ctrl.ctrl_config & NVME_CC_ENABLE &&
+ !(anv->ctrl.ctrl_config & NVME_CC_SHN_MASK))
apple_nvme_disable(anv, false);
/* RTKit must be shut down cleanly for the (soft)-reset to work */
--
2.35.1
Powered by blists - more mailing lists