[PATCH 1/9] nvme-apple: fix controller shutdown in apple_nvme_disable

Hector Martin marcan at marcan.st
Tue Nov 29 07:41:45 PST 2022


On 29/11/2022 22.22, Christoph Hellwig wrote:
> nvme_shutdown_ctrl already shuts the controller down, there is no
> need to also call nvme_disable_ctrl for the shutdown case.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>  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 94ef797e8b4a5f..56d9e9be945b76 100644
> --- a/drivers/nvme/host/apple.c
> +++ b/drivers/nvme/host/apple.c
> @@ -831,7 +831,8 @@ static void apple_nvme_disable(struct apple_nvme *anv, bool shutdown)
>  
>  		if (shutdown)
>  			nvme_shutdown_ctrl(&anv->ctrl);
> -		nvme_disable_ctrl(&anv->ctrl);
> +		else
> +			nvme_disable_ctrl(&anv->ctrl);
>  	}
>  
>  	WRITE_ONCE(anv->ioq.enabled, false);

Reviewed-by: Hector Martin <marcan at marcan.st>

I looked at some of our other implementations and we always seem to do
both, but this makes sense. If it breaks something we'll notice and
shout loudly when it makes it into an -rc at the latest :)

- Hector



More information about the Linux-nvme mailing list