lkml.org 
[lkml]   [2018]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] PCI: stop crashing in pci_release_resource v2
    From
    Date
    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
    >>

    \
     
     \ /
      Last update: 2018-03-02 08:55    [W:3.210 / U:0.468 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site