Skip to content

Commit 9064610

Browse files
committed
nvme: remove CC register read-back during enabling
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>
1 parent 83340d9 commit 9064610

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/nvme/host/core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,11 +2468,6 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl)
24682468
if (ret)
24692469
return ret;
24702470

2471-
/* Flush write to device (required if transport is PCI) */
2472-
ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CC, &ctrl->ctrl_config);
2473-
if (ret)
2474-
return ret;
2475-
24762471
/* CAP value may change after initial CC write */
24772472
ret = ctrl->ops->reg_read64(ctrl, NVME_REG_CAP, &ctrl->cap);
24782473
if (ret)

0 commit comments

Comments
 (0)