linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: bhelgaas@google.com, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: stop crashing in pci_release_resource v2
Date: Fri, 2 Mar 2018 08:55:03 +0100	[thread overview]
Message-ID: <d850105e-3ce1-2957-de79-98f7eda2dcee@gmail.com> (raw)
In-Reply-To: <20180301184957.GI13722@bhelgaas-glaptop.roam.corp.google.com>

Am 01.03.2018 um 19:49 schrieb Bjorn Helgaas:
> On Wed, Feb 21, 2018 at 10:07:15AM +0100, Christian König wrote:
>> Is it entirely possible that the BIOS wasn't able to assign resources to
>> a device. In this case don't crash in pci_release_resource() when we try
>> to resize the resource.
>>
>> v2: keep printing the info that we try to release the BAR
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> CC: stable@vger.kernel.org
> I was hoping for a dmesg snippet, but I added a Fixes: tag and applied
> this to for-linus for v4.16.

Sorry, been on vacation and missed your mail.

I don't have a dmesg of hand either, cause the reporter provided only a 
mail with a picture of the crash :)

But he confirmed that the patch worked.

Thanks,
Christian.

>
>> ---
>>   drivers/pci/setup-res.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
>> index e815111f3f81..c0f091614805 100644
>> --- a/drivers/pci/setup-res.c
>> +++ b/drivers/pci/setup-res.c
>> @@ -402,6 +402,10 @@ void pci_release_resource(struct pci_dev *dev, int resno)
>>   	struct resource *res = dev->resource + resno;
>>   
>>   	dev_info(&dev->dev, "BAR %d: releasing %pR\n", resno, res);
>> +
>> +	if (!res->parent)
>> +		return;
>> +
>>   	release_resource(res);
>>   	res->end = resource_size(res) - 1;
>>   	res->start = 0;
>> -- 
>> 2.14.1
>>

      reply	other threads:[~2018-03-02  7:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21  9:07 [PATCH] PCI: stop crashing in pci_release_resource v2 Christian König
2018-02-21 19:24 ` Andy Shevchenko
2018-02-26 20:56 ` Bjorn Helgaas
2018-03-01 18:49 ` Bjorn Helgaas
2018-03-02  7:55   ` Christian König [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=d850105e-3ce1-2957-de79-98f7eda2dcee@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=christian.koenig@amd.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.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).