RE: [PATCH v2 1/5] PCI: Make sure all bridges reserve at least one bus number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Bjorn Helgaas [mailto:helgaas@xxxxxxxxxx]
> Sent: Friday, February 23, 2018 11:26 AM
> To: Limonciello, Mario <Mario_Limonciello@xxxxxxxx>
> Cc: bhelgaas@xxxxxxxxxx; rjw@xxxxxxxxxxxxx;
> andriy.shevchenko@xxxxxxxxxxxxxxx; lenb@xxxxxxxxxx; michael.jamet@xxxxxxxxx;
> yehezkel.bernat@xxxxxxxxx; linux-acpi@xxxxxxxxxxxxxxx; linux-
> pci@xxxxxxxxxxxxxxx; mika.westerberg@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 1/5] PCI: Make sure all bridges reserve at least one bus
> number
> 
> On Fri, Feb 23, 2018 at 12:52:18AM +0000, Mario.Limonciello@xxxxxxxx wrote:
> > On Feb 22, 2018 18:27, Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote:
> > > On Thu, Feb 15, 2018 at 05:39:55PM +0300, Mika Westerberg wrote:
> > > > When distributing extra buses between hotplug bridges we need to make
> > > > sure each bridge reserve at least one bus number, even if there is
> > > > currently nothing connected to it. For instance ACPI hotplug may bring
> > > > in additional devices to non-hotplug bridges later on. To make sure we
> > > > don't run out of bus numbers for non-hotplug bridges reserve one bus
> > > > number for them upfront before distributing buses for hotplug bridges.
> > > >
> > > > Fixes: 1c02ea810065 ("PCI: Distribute available buses to hotplug-capable
> bridges")
> > > > Reported-by: Mario Limonciello <mario.limonciello@xxxxxxxx>
> > >
> > > Is there a bugzilla or email URL we can include here?
> >
> > Sorry it was private communication that I believe Mika is referring to in Reported-
> By here.
> >
> > You can remove the tag if you think it's inappropriate for this commit.
> 
> I like to give credit whenever possible, so I wouldn't necessarily
> remove the Reported-by.
> 
> But it would be very useful to also have a URL to something with more
> details, e.g., what sort of failure the user would observe, dmesg
> logs, PCI topology, etc.
> 
> This information can certainly be redacted to remove any proprietary
> things that can't be made public.  Usually that isn't of interest to
> structural issues like this anyway.

It was a result of a very long communication chain, but I think I pulled
out the relevant details here if you would like a URL to include:
https://gist.github.com/superm1/100a2ed20449f684ebb84c392e35dbed

Thank you.

> 
> > > > Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
> > > > Cc: stable@xxxxxxxxxxxxxxx
> > > > ---
> > > >  drivers/pci/probe.c | 11 ++++++++---
> > > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> > > > index ef5377438a1e..6cefd47556e3 100644
> > > > --- a/drivers/pci/probe.c
> > > > +++ b/drivers/pci/probe.c
> > > > @@ -2561,7 +2561,10 @@ static unsigned int
> pci_scan_child_bus_extend(struct pci_bus *bus,
> > > >  for_each_pci_bridge(dev, bus) {
> > > >  cmax = max;
> > > >  max = pci_scan_bridge_extend(bus, dev, max, 0, 0);
> > > > - used_buses += cmax - max;
> > > > + /* Reserve one bus for each bridge */
> > > > + used_buses++;
> > > > + if (cmax - max > 1)
> > > > + used_buses += cmax - max - 1;
> > > >  }
> > > >
> > > >  /* Scan bridges that need to be reconfigured */
> > > > @@ -2584,12 +2587,14 @@ static unsigned int
> pci_scan_child_bus_extend(struct pci_bus *bus,
> > > >  * bridges if any.
> > > >  */
> > > >  buses = available_buses / hotplug_bridges;
> > > > - buses = min(buses, available_buses - used_buses);
> > > > + buses = min(buses, available_buses - used_buses + 1);
> > > >  }
> > > >
> > > >  cmax = max;
> > > >  max = pci_scan_bridge_extend(bus, dev, cmax, buses, 1);
> > > > - used_buses += max - cmax;
> > > > + /* One bus is already accounted so don't add it again */
> > > > + if (max - cmax > 1)
> > > > + used_buses += max - cmax - 1;
> > > >  }
> > > >
> > > >  /*
> > > > --
> > > > 2.15.1
> > > >
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > > > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux