]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
nvme: remove CC register read-back during enabling
authorKeith Busch <kbusch@kernel.org>
Wed, 4 Sep 2024 21:48:50 +0000 (14:48 -0700)
committerKeith Busch <kbusch@kernel.org>
Wed, 25 Sep 2024 06:35:10 +0000 (23:35 -0700)
Any non-posted read should flush the previous write, so we don't
necessarily need to read back the value we just wrote. I've found at
least some controllers that respond with 0 for short moments after
writing the CC register with EN (enable) cleared, so the read-back is
overwriting our valid ctrl_config value and ends up breaking on the
subsequent enabling.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index ca9959a8fb9e04cf0f505b2a7003e23a97899be9..ba6508455e185fc6a3331580a5b61bc9c4b7a922 100644 (file)
@@ -2468,11 +2468,6 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl)
        if (ret)
                return ret;
 
-       /* Flush write to device (required if transport is PCI) */
-       ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CC, &ctrl->ctrl_config);
-       if (ret)
-               return ret;
-
        /* CAP value may change after initial CC write */
        ret = ctrl->ops->reg_read64(ctrl, NVME_REG_CAP, &ctrl->cap);
        if (ret)