[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181210231038-mutt-send-email-mst@kernel.org>
Date: Mon, 10 Dec 2018 23:11:22 -0500
From: "Michael S. Tsirkin" <mst@...hat.com>
To: xuyandong <xuyandong2@...wei.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
Yinghai Lu <yinghai@...nel.org>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>
Subject: Re: [PATCH] pci: avoid bridge feature re-probing on hotplug
On Tue, Dec 11, 2018 at 02:45:44AM +0000, xuyandong wrote:
>
>
> > -----Original Message-----
> > From: Michael S. Tsirkin [mailto:mst@...hat.com]
> > Sent: Tuesday, December 11, 2018 10:19 AM
> > To: linux-kernel@...r.kernel.org
> > Cc: xuyandong <xuyandong2@...wei.com>; stable@...r.kernel.org; Yinghai
> > Lu <yinghai@...nel.org>; Jesse Barnes <jbarnes@...tuousgeek.org>; Bjorn
> > Helgaas <bhelgaas@...gle.com>; linux-pci@...r.kernel.org
> > Subject: [PATCH] pci: avoid bridge feature re-probing on hotplug
> >
> > commit 1f82de10d6 ("PCI/x86: don't assume prefetchable ranges are
> > 64bit") added probing of bridge support for 64 bit memory each time bridge is
> > re-enumerated.
> >
> > Unfortunately this probing is destructive if any device behind the bridge is in
> > use at this time.
> >
> > There's no real need to re-probe the bridge features as the regiters in question
> > never change - detect that using the memory flag being set and skip the
> > probing.
> > Avoiding repeated calls to pci_bridge_check_ranges might be even nicer would
> > be a bigger patch and probably not appropriate on stable.
> >
> > Reported-by: xuyandong <xuyandong2@...wei.com>
> > Cc: stable@...r.kernel.org
> > Cc: Yinghai Lu <yinghai@...nel.org>
> > Cc: Jesse Barnes <jbarnes@...tuousgeek.org>
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
>
> Tested-by: xuyandong <xuyandong2@...wei.com>
Bjorn could you queue this for this release?
> > ---
> >
> > This issue has been reported on upstream Linux and Centos.
> >
> > drivers/pci/setup-bus.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index
> > ed960436df5e..7ab42f76579e 100644
> > --- a/drivers/pci/setup-bus.c
> > +++ b/drivers/pci/setup-bus.c
> > @@ -741,6 +741,13 @@ static void pci_bridge_check_ranges(struct pci_bus
> > *bus)
> > struct resource *b_res;
> >
> > b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
> > +
> > + /* Don't re-check after this was called once already:
> > + * important since bridge might be in use.
> > + */
> > + if (b_res[1].flags & IORESOURCE_MEM)
> > + return;
> > +
> > b_res[1].flags |= IORESOURCE_MEM;
> >
> > pci_read_config_word(bridge, PCI_IO_BASE, &io);
> > --
> > MST
Powered by blists - more mailing lists