[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0htQ0KZ8M1BpE7H7weRS89jJWPtA0xvgAUmN53jx5DSYg@mail.gmail.com>
Date: Mon, 20 Aug 2018 13:26:39 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Linux PCI <linux-pci@...r.kernel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@...radead.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Subject: Re: [RFC 08/15] x86: PCI: clean up pcibios_scan_root()
On Mon, Aug 20, 2018 at 1:17 PM Arnd Bergmann <arnd@...db.de> wrote:
>
> On Mon, Aug 20, 2018 at 10:31 AM Rafael J. Wysocki <rafael@...nel.org> wrote:
> > On Fri, Aug 17, 2018 at 12:32 PM Arnd Bergmann <arnd@...db.de> wrote:
>
> > > -static struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
> > > - struct pci_ops *ops, void *sysdata, struct list_head *resources)
> > > +void pcibios_scan_root(int busnum)
> > > {
> > > + struct pci_sysdata *sd;
> > > struct pci_host_bridge *bridge;
> > > int error;
> > >
> > > - bridge = pci_alloc_host_bridge(0);
> > > - if (!bridge)
> > > - return NULL;
> > > + bridge = pci_alloc_host_bridge(sizeof(sd));
> > > + if (!bridge) {
> > > + printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum);
> > > + return;
> > > + }
> > > + sd = pci_host_bridge_priv(bridge);
> >
> > This looks fishy, as bridge->private is not set at this point AFAICS,
> > unless one of the previous patches changes that.
>
> bridge->private what comes after the bridge structure, and it's allocated
> by pci_alloc_host_bridge() passing the size of the structure we want
> for this private area.
I see, sorry for the noise.
Powered by blists - more mailing lists