summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-03-08 19:12:59 -0700
committerJens Axboe <axboe@kernel.dk>2018-03-08 19:12:59 -0700
commite576b7b528bb4c352ab2b9fbdaa6124f0ae82e1d (patch)
tree6c7a93490f239932677ba989a7569ca3b214ec94 /drivers/nvme/host/pci.c
parent9296080a18d95bfe97d399e5ce4e0980293e6194 (diff)
parentd157e5343cb360a525e6b3e7924612a9a90df3b7 (diff)
downloadlinux-e576b7b528bb4c352ab2b9fbdaa6124f0ae82e1d.tar.bz2
Merge branch 'nvme-4.16-rc5' of git://git.infradead.org/nvme into for-linus
Pull NVMe fixes for this series from Keith: "A few late fixes for 4.16: * Reverting sysfs slave device links for native nvme multipathing. The hidden disk attributes broke common user tools. * A fix for a PPC pci error handling regression. * Update pci interrupt count to consider the actual IRQ spread, fixing potentially poor initial queue affinity. * Off-by-one errors in nvme-fc queue sizes * A fabrics discovery fix to be more tolerant with user tools." * 'nvme-4.16-rc5' of git://git.infradead.org/nvme: nvme_fc: rework sqsize handling nvme-fabrics: Ignore nr_io_queues option for discovery controllers Revert "nvme: create 'slaves' and 'holders' entries for hidden controllers" nvme: pci: pass max vectors as num_possible_cpus() to pci_alloc_irq_vectors nvme-pci: Fix EEH failure on ppc
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)
if (!(csts & NVME_CSTS_CFS) && !nssro)
return false;
- /* If PCI error recovery process is happening, we cannot reset or
- * the recovery mechanism will surely fail.
- */
- if (pci_channel_offline(to_pci_dev(dev->dev)))
- return false;
-
return true;
}
@@ -1189,6 +1183,13 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
struct nvme_command cmd;
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)))
+ return BLK_EH_RESET_TIMER;
+
/*
* Reset immediately if the controller is failed
*/
@@ -1913,7 +1914,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
int result, nr_io_queues;
unsigned long size;
- nr_io_queues = num_present_cpus();
+ nr_io_queues = num_possible_cpus();
result = nvme_set_queue_count(&dev->ctrl, &nr_io_queues);
if (result < 0)
return result;