[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090319022956.25ae6a5a.akpm@linux-foundation.org>
Date: Thu, 19 Mar 2009 02:29:56 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Alex Chiang <achiang@...com>
Cc: jbarnes@...tuousgeek.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 06/12] PCI: Introduce pci_rescan_bus()
On Wed, 18 Mar 2009 16:39:56 -0600 Alex Chiang <achiang@...com> wrote:
> +/**
> + * pci_rescan_bus - scan a PCI bus for devices.
> + * @bus: PCI bus to scan
> + *
> + * Scan a PCI bus and child buses for new devices, adds them,
> + * and enables them.
> + *
> + * Returns the max number of subordinate bus discovered.
> + */
> +unsigned int __devinit pci_rescan_bus(struct pci_bus *bus)
> +{
> + unsigned int max;
> + struct pci_dev *dev;
> +
> + max = pci_scan_child_bus(bus);
> + list_for_each_entry(dev, &bus->devices, bus_list)
> + if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
> + dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
> + if (dev->subordinate)
> + pci_bus_size_bridges(dev->subordinate);
> +
> + pci_bus_assign_resources(bus);
> + pci_enable_bridges(bus);
> + pci_bus_add_devices(bus);
> +
> + return max;
> +}
The conspicuous lack of locking for the list walk requires either
a) documenting or
b) fixing
IMO.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists