nvme: Ignore timeouts while PCI config access is blocked
PATCH 1/1 nvme: Ignore timeouts while PCI config access is blocked
If an admin command timeout occurs while a PCIe reset (FLR) is pending, the CSTS bits may not be valid which could result in the controller being removed.
--- drivers/nvme/host/pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +3 -2
@@ -1258,13 +1258,14 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)struct request *abort_req;struct nvme_command cmd;bool shutdown = false; +struct pci_dev *pdev =to_pci_dev (dev->dev);u32 csts =readl (dev->bar +NVME_REG_CSTS );/* If PCI error recovery process is happening, we cannot reset or * the recovery mechanism will surely fail. */ mb (); -if (pci_channel_offline (to_pci_dev (dev->dev))) +if (pci_channel_offline (to_pci_dev (dev->dev)) || pdev->block_cfg_access)return BLK_EH_RESET_TIMER ;/*
@@ -2786,7 +2787,7 @@ static void nvme_reset_prepare(struct pci_dev *pdev)static void nvme_reset_done (struct pci_dev *pdev) {struct nvme_dev *dev =pci_get_drvdata (pdev); -nvme_reset_ctrl_sync (&dev->ctrl); +nvme_reset_ctrl (&dev->ctrl); }static void nvme_shutdown (struct pci_dev *pdev)
Signature · 1 line
2.17.1
Sagi Grimberg
maintainerPATCH 1/1 nvme: Ignore timeouts while PCI config access is blocked
drivers/nvme/host/pci.c static void nvme_reset_prepare(struct pci_dev *pdev) · line 2790
Quoted 6 lines
static void nvme_reset_done(struct pci_dev *pdev) { struct nvme_dev *dev = pci_get_drvdata(pdev);drivers/nvme/host/pci.c +1
-1-nvme_reset_ctrl_sync (&dev->ctrl); +nvme_reset_ctrl (&dev->ctrl);
This change is not explained in the change log. This opens a window for nvme_reset_work to run concurrently from different contexts which is not a good idea...
PATCH 1/1 nvme: Ignore timeouts while PCI config access is blocked
Quoted 10 lines · Sagi Grimberg
Quoted 6 lines
? static void
nvme_reset_done(struct pci_dev *pdev)? {
????? structnvme_dev*dev =pci_get_drvdata(pdev); -???nvme_reset_ctrl_sync(&dev->ctrl);
+???nvme_reset_ctrl(&dev->ctrl);This change is not explained in the change log. This opens a window for
nvme_reset_workto run concurrently from different contexts which is not a good idea...
I think Keith recommended the asynchronous reset
"Definitely need the nvme_reset_ctrl change as blk_cfg_access is still set here so need to reset asynchronously to unblock new timeouts"
Keith, does this still hold true or do I need some other mechanism to avoid the issues that Sagi is concerned about?
PATCH 1/1 nvme: Ignore timeouts while PCI config access is blocked
Quoted 12 lines · Kenneth
Quoted 10 lines · Sagi Grimberg
drivers/nvme/host/pci.c static void nvme_reset_prepare(struct pci_dev *pdev) · line 2790
Quoted 6 lines
static void nvme_reset_done(struct pci_dev *pdev) { struct nvme_dev *dev = pci_get_drvdata(pdev);drivers/nvme/host/pci.c +1
-1-nvme_reset_ctrl_sync (&dev->ctrl); +nvme_reset_ctrl (&dev->ctrl);This change is not explained in the change log. This opens a window for
nvme_reset_workto run concurrently from different contexts which is not a good idea...
Quoted 7 lines
I think Keith recommended the asynchronous reset
"Definitely need the
nvme_reset_ctrlchange asblk_cfg_accessis still set here so need to reset asynchronously to unblock new timeouts"Keith, does this still hold true or do I need some other mechanism to avoid the issues that Sagi is concerned about?
Can't use the pci's block_cfg_access in timeout if doing synchronous resets in reset_done. We wouldn't be able to handle IO timeouts during reset using that, so would need to use something else, maybe introduce a new flag like your original patch.