mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 11:30:53 +07:00
NVMe: Only release requested regions
The NVMe driver only requests the PCIe device's memory regions but releases all possible regions (including eventual I/O regions). This leads to a stale warning entry in dmesg about freeing non existent resources. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
1decabc1a7
commit
edb50a5403
@ -1679,9 +1679,14 @@ static int nvme_pci_enable(struct nvme_dev *dev)
|
|||||||
|
|
||||||
static void nvme_dev_unmap(struct nvme_dev *dev)
|
static void nvme_dev_unmap(struct nvme_dev *dev)
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = to_pci_dev(dev->dev);
|
||||||
|
int bars;
|
||||||
|
|
||||||
if (dev->bar)
|
if (dev->bar)
|
||||||
iounmap(dev->bar);
|
iounmap(dev->bar);
|
||||||
pci_release_regions(to_pci_dev(dev->dev));
|
|
||||||
|
bars = pci_select_bars(pdev, IORESOURCE_MEM);
|
||||||
|
pci_release_selected_regions(pdev, bars);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nvme_pci_disable(struct nvme_dev *dev)
|
static void nvme_pci_disable(struct nvme_dev *dev)
|
||||||
@ -1924,7 +1929,7 @@ static int nvme_dev_map(struct nvme_dev *dev)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
release:
|
release:
|
||||||
pci_release_regions(pdev);
|
pci_release_selected_regions(pdev, bars);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user