From: Bjorn Helgaas <helgaas@kernel.org>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Keith Busch <keith.busch@intel.com>, Jens Axboe <axboe@fb.com>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH v3 2/6] NVMe: Use pci_(request|release)_mem_regions
Date: Tue, 21 Jun 2016 17:27:18 -0500 [thread overview]
Message-ID: <20160621222718.GE7603@localhost> (raw)
In-Reply-To: <20160617112716.74e4hgy5bhkkgmi6@c203.arch.suse.de>
On Fri, Jun 17, 2016 at 01:27:16PM +0200, Johannes Thumshirn wrote:
> On Tue, Jun 07, 2016 at 09:44:02AM +0200, Johannes Thumshirn wrote:
> > Now that we do have pci_request_mem_regions() and pci_release_mem_regions() at
> > hand, use it in the NVMe driver.
> >
> > Suggested-by: Christoph Hellwig <hch@infradead.org>
> > Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > Cc: Christoph Hellwig <hch@infradead.org>
> > Cc: Keith Busch <keith.busch@intel.com>
> > Cc: Jens Axboe <axboe@fb.com>
> > Cc: linux-nvme@lists.infradead.org
>
> Bjorn,
>
> Jens merged a band aid here which conflicts with the patch. Shall I send you
> this patch re-based or the entire series?
I see the conflict with the patch below. I don't know how Jens
manages his tree, but the conflict should be pretty trivial to
resolve, so I won't worry about it too much.
commit edb50a5403d2
Author: Johannes Thumshirn <jthumshirn@suse.de>
Date: Tue May 10 15:14:28 2016 +0200
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>
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 78dca31..befac5b 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1679,9 +1679,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)
@@ -1924,7 +1929,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;
}
next prev parent reply other threads:[~2016-06-21 22:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 7:44 [PATCH v3 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
2016-06-07 7:44 ` [PATCH v3 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
2016-06-07 7:44 ` [PATCH v3 2/6] NVMe: Use pci_(request|release)_mem_regions Johannes Thumshirn
2016-06-17 11:27 ` Johannes Thumshirn
2016-06-21 22:27 ` Bjorn Helgaas [this message]
2016-06-07 7:44 ` [PATCH v3 3/6] lpfc: " Johannes Thumshirn
2016-06-07 7:44 ` [PATCH v3 4/6] GenWQE: " Johannes Thumshirn
2016-06-07 7:44 ` [PATCH v3 5/6] ethernet/intel: " Johannes Thumshirn
2016-06-07 7:44 ` [PATCH v3 6/6] alx: " Johannes Thumshirn
2016-06-07 11:57 ` [PATCH v3 0/6] Introduce pci_(request|release)_(mem|io)_regions Christoph Hellwig
2016-06-08 7:28 ` Johannes Thumshirn
2016-06-08 23:04 ` Jeff Kirsher
2016-06-21 22:28 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160621222718.GE7603@localhost \
--to=helgaas@kernel.org \
--cc=axboe@fb.com \
--cc=bhelgaas@google.com \
--cc=hch@infradead.org \
--cc=jthumshirn@suse.de \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).