linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: <linux-nvme@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NVMe: Only release requested regions
Date: Thu, 9 Jun 2016 14:28:54 -0600	[thread overview]
Message-ID: <5759D186.2090000@fb.com> (raw)
In-Reply-To: <20160608071629.y2ysgc5lsvv2c6nu@c203.arch.suse.de>

On 06/08/2016 01:16 AM, Johannes Thumshirn wrote:
> 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?

Added for 4.7, thanks.

-- 
Jens Axboe

      reply	other threads:[~2016-06-09 20:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 13:14 [PATCH] NVMe: Only release requested regions Johannes Thumshirn
2016-05-10 13:16 ` Hannes Reinecke
2016-05-12  7:03 ` Christoph Hellwig
2016-05-12  7:34   ` Johannes Thumshirn
2016-05-24  9:15 ` Johannes Thumshirn
2016-05-24  9:19   ` Christoph Hellwig
2016-05-24 14:29     ` Keith Busch
2016-06-08  7:16 ` Johannes Thumshirn
2016-06-09 20:28   ` Jens Axboe [this message]

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=5759D186.2090000@fb.com \
    --to=axboe@fb.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.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).