Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1416950 > unrolled thread
| Started by | Johannes Thumshirn <jthumshirn@suse.de> |
|---|---|
| First post | 2016-06-08 09:20 +0200 |
| Last post | 2016-06-08 09:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] NVMe: Only release requested regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-08 09:20 +0200
| From | Johannes Thumshirn <jthumshirn@suse.de> |
|---|---|
| Date | 2016-06-08 09:20 +0200 |
| Subject | Re: [PATCH] NVMe: Only release requested regions |
| Message-ID | <rHFWp-5tG-11@gated-at.bofh.it> |
On Tue, May 10, 2016 at 03:14:28PM +0200, Johannes Thumshirn wrote:
> 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>
> ---
> drivers/nvme/host/pci.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index eec73fe..6f5ad07 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1759,9 +1759,14 @@ static int nvme_pci_enable(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)
> 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)
> @@ -1998,7 +2003,7 @@ static int nvme_dev_map(struct nvme_dev *dev)
>
> return 0;
> release:
> - pci_release_regions(pdev);
> + pci_release_selected_regions(pdev, bars);
> return -ENODEV;
> }
>
> --
> 1.8.5.6
>
Jens, ping?
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Back to top | Article view | linux.kernel
csiph-web