From: Andy Shevchenko <andy.shevchenko@gmail.com> To: "Christian König" <ckoenig.leichtzumerken@gmail.com> Cc: Bjorn Helgaas <bhelgaas@google.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, linux-pci@vger.kernel.org Subject: Re: [PATCH] PCI: stop crashing in pci_release_resource v2 Date: Wed, 21 Feb 2018 21:24:37 +0200 [thread overview] Message-ID: <CAHp75VcmvgSjC2BqxVBPO26xicVUOQ0UDU7=3QMo81917pW4hQ@mail.gmail.com> (raw) In-Reply-To: <20180221090715.2853-1-christian.koenig@amd.com> On Wed, Feb 21, 2018 at 11:07 AM, Christian König <ckoenig.leichtzumerken@gmail.com> 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 > FWIW, Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Signed-off-by: Christian König <christian.koenig@amd.com> > CC: stable@vger.kernel.org > --- > 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 > -- With Best Regards, Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com> To: "Christian König" <ckoenig.leichtzumerken@gmail.com> Cc: Bjorn Helgaas <bhelgaas@google.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, linux-pci@vger.kernel.org Subject: Re: [PATCH] PCI: stop crashing in pci_release_resource v2 Date: Wed, 21 Feb 2018 21:24:37 +0200 [thread overview] Message-ID: <CAHp75VcmvgSjC2BqxVBPO26xicVUOQ0UDU7=3QMo81917pW4hQ@mail.gmail.com> (raw) In-Reply-To: <20180221090715.2853-1-christian.koenig@amd.com> On Wed, Feb 21, 2018 at 11:07 AM, Christian K=C3=B6nig <ckoenig.leichtzumerken@gmail.com> 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 > FWIW, Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Signed-off-by: Christian K=C3=B6nig <christian.koenig@amd.com> > CC: stable@vger.kernel.org > --- > 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 r= esno) > struct resource *res =3D dev->resource + resno; > > dev_info(&dev->dev, "BAR %d: releasing %pR\n", resno, res); > + > + if (!res->parent) > + return; > + > release_resource(res); > res->end =3D resource_size(res) - 1; > res->start =3D 0; > -- > 2.14.1 > --=20 With Best Regards, Andy Shevchenko
next prev parent reply other threads:[~2018-02-21 19:24 UTC|newest] Thread overview: 6+ 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 [this message] 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
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='CAHp75VcmvgSjC2BqxVBPO26xicVUOQ0UDU7=3QMo81917pW4hQ@mail.gmail.com' \ --to=andy.shevchenko@gmail.com \ --cc=bhelgaas@google.com \ --cc=ckoenig.leichtzumerken@gmail.com \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.