aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r--drivers/nvme/host/pci.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5933a5c732e8..b6f43b738f03 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 */
@@ -1913,7 +1914,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
1913 int result, nr_io_queues; 1914 int result, nr_io_queues;
1914 unsigned long size; 1915 unsigned long size;
1915 1916
1916 nr_io_queues = num_present_cpus(); 1917 nr_io_queues = num_possible_cpus();
1917 result = nvme_set_queue_count(&dev->ctrl, &nr_io_queues); 1918 result = nvme_set_queue_count(&dev->ctrl, &nr_io_queues);
1918 if (result < 0) 1919 if (result < 0)
1919 return result; 1920 return result;