[PATCH 2/3] nvmet: pci-epf: Clear CC and CSTS when disabling the controller
Keith Busch
kbusch at kernel.org
Thu Apr 10 01:34:33 PDT 2025
On Tue, Apr 08, 2025 at 11:47:32AM +0900, Damien Le Moal wrote:
> @@ -1895,6 +1912,11 @@ static void nvmet_pci_epf_disable_ctrl(struct nvmet_pci_epf_ctrl *ctrl)
> nvmet_pci_epf_delete_cq(ctrl->tctrl, 0);
>
> ctrl->csts &= ~NVME_CSTS_RDY;
> + if (shutdown) {
> + ctrl->csts |= NVME_CSTS_SHST_CMPLT;
> + ctrl->cc &= ~NVME_CC_ENABLE;
> + nvmet_pci_epf_bar_write32(ctrl, NVME_REG_CC, ctrl->cc);
> + }
> }
I think this is probably okay, but I don't know if it's necessary to be
messing with CC.EN that the host didn't request. The qemu emulated nvme
doesn't do this, at least. But it looks like that would all work out in
the end anyway, so again, I think it's fine.
More information about the Linux-nvme
mailing list