From: Ashok Vairavan Date: Mon, 5 Jun 2017 19:24:30 +0000 (-0700) Subject: NVMe: During NVMe probe, get NVMe device information before mapping the device. X-Git-Tag: v4.1.12-104.0.20170618_1145~237 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0120baeea1c91f67cb5290724f9163bcad708b03;p=users%2Fjedix%2Flinux-maple.git NVMe: During NVMe probe, get NVMe device information before mapping the device. Orabug: 26194850 As part of updating NVMe driver (Bug 25130845), the nvme device mapping was done before getting the nvme device information. This change got introduced while resolving a merge conflict. This caused the kernel panic during nvme probe. Signed-off-by: Ashok Vairavan Reviewed-by: Martin K. Petersen --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 55005c5e240ed..4f2d8536c0bcb 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1986,15 +1986,15 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (!dev->queues) goto free; + dev->dev = get_device(&pdev->dev); + pci_set_drvdata(pdev, dev); + result = nvme_dev_map(dev); if (result) goto free; INIT_LIST_HEAD(&dev->ctrl.namespaces); mutex_init(&dev->namespaces_mutex); - dev->dev = get_device(&pdev->dev); - pci_set_drvdata(pdev, dev); - INIT_WORK(&dev->reset_work, nvme_reset_work); INIT_WORK(&dev->remove_work, nvme_remove_dead_ctrl_work); setup_timer(&dev->watchdog_timer, nvme_watchdog_timer,