aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWen Xiong <wenxiong@linux.vnet.ibm.com>2018-02-15 15:05:10 -0500
committerKeith Busch <keith.busch@intel.com>2018-03-01 11:34:14 -0500
commit651438bb0af5213f1f70d66e75bf11d08cb5537a (patch)
tree775c5d3742d78fcbcd51e2ee82137cddf21ee017
parent468f098734ab095b72d8af26bcd4bcb2ed31a3be (diff)
nvme-pci: Fix EEH failure on ppc
Triggering PPC EEH detection and handling requires a memory mapped read failure. The NVMe driver removed the periodic health check MMIO, so there's no early detection mechanism to trigger the recovery. Instead, the detection now happens when the nvme driver handles an IO timeout event. This takes the pci channel offline, so we do not want the driver to proceed with escalating its own recovery efforts that may conflict with the EEH handler. This patch ensures the driver will observe the channel was set to offline after a failed MMIO read and resets the IO timer so the EEH handler has a chance to recover the device. Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> [updated change log] Signed-off-by: Keith Busch <keith.busch@intel.com>
-rw-r--r--drivers/nvme/host/pci.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5933a5c732e8..e5ce07f4966f 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1153,12 +1153,6 @@ static bool nvme_should_reset(struct nvme_dev *dev, u32 csts)
1153 if (!(csts & NVME_CSTS_CFS) && !nssro) 1153 if (!(csts & NVME_CSTS_CFS) && !nssro)
1154 return false; 1154 return false;
1155 1155
1156 /* If PCI error recovery process is happening, we cannot reset or
1157 * the recovery mechanism will surely fail.
1158 */
1159 if (pci_channel_offline(to_pci_dev(dev->dev)))
1160 return false;
1161
1162 return true; 1156 return true;
1163} 1157}
1164 1158
@@ -1189,6 +1183,13 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
1189 struct nvme_command cmd; 1183 struct nvme_command cmd;
1190 u32 csts = readl(dev->bar + NVME_REG_CSTS); 1184 u32 csts = readl(dev->bar + NVME_REG_CSTS);
1191 1185
1186 /* If PCI error recovery process is happening, we cannot reset or
1187 * the recovery mechanism will surely fail.
1188 */
1189 mb();
1190 if (pci_channel_offline(to_pci_dev(dev->dev)))
1191 return BLK_EH_RESET_TIMER;
1192
1192 /* 1193 /*
1193 * Reset immediately if the controller is failed 1194 * Reset immediately if the controller is failed
1194 */ 1195 */