From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: Alex Chiang <achiang@hp.com>
Cc: jbarnes@virtuousgeek.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 05/11] PCI: beef up pci_do_scan_bus()
Date: Thu, 12 Mar 2009 18:16:36 +0900 [thread overview]
Message-ID: <49B8D2F4.1030206@jp.fujitsu.com> (raw)
In-Reply-To: <20090309054900.3918.4473.stgit@bob.kio>
Alex Chiang wrote:
> We have a nice interface for re-scanning a PCI bus which will
> discover newly added devices, add them to the device tree, and
> enable them properly.
>
> Ensure that the bridge resources are properly sized and assigned
> during the rescan.
>
> Signed-off-by: Alex Chiang <achiang@hp.com>
> ---
>
> drivers/pci/hotplug-pci.c | 16 ++++++++++++----
> 1 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
> index 4d4a644..33ab2d2 100644
> --- a/drivers/pci/hotplug-pci.c
> +++ b/drivers/pci/hotplug-pci.c
> @@ -6,13 +6,21 @@
>
> unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
> {
> - unsigned int max;
> + unsigned int max, pass;
> + struct pci_dev *dev;
>
> max = pci_scan_child_bus(bus);
>
> - /*
> - * Make the discovered devices available.
> - */
> + for (pass=0; pass < 2; pass++)
> + 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 (pass && dev->subordinate)
> + pci_bus_size_bridges(dev->subordinate);
> + }
> +
> + pci_bus_assign_resources(bus);
> + pci_enable_bridges(bus);
> pci_bus_add_devices(bus);
The "for (pass=0; pass <2; pass++)" loop doesn't look necessary.
And I'm worrying that your change have some bad effect to the
existing user of pci_do_scan_bus(). Did you confirm that?
Thanks,
Kenji Kaneshige
next prev parent reply other threads:[~2009-03-12 9:17 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-09 5:48 [PATCH v3 00/11] PCI core learns hotplug Alex Chiang
2009-03-09 5:48 ` [PATCH v3 01/11] PCI: pci_is_root_bus helper Alex Chiang
2009-03-09 5:48 ` [PATCH v3 02/11] PCI: don't scan existing devices Alex Chiang
2009-03-09 5:48 ` [PATCH v3 03/11] PCI: pci_scan_slot() returns newly found devices Alex Chiang
2009-03-09 5:48 ` [PATCH v3 04/11] PCI: always scan child buses Alex Chiang
2009-03-09 5:49 ` [PATCH v3 05/11] PCI: beef up pci_do_scan_bus() Alex Chiang
2009-03-12 9:16 ` Kenji Kaneshige [this message]
2009-03-12 23:22 ` Alex Chiang
2009-03-13 9:11 ` Kenji Kaneshige
2009-03-15 16:48 ` Alex Chiang
2009-03-18 8:29 ` Kenji Kaneshige
2009-03-18 20:39 ` Alex Chiang
2009-03-19 2:15 ` Kenji Kaneshige
2009-03-09 5:49 ` [PATCH v3 06/11] PCI: Introduce /sys/bus/pci/rescan Alex Chiang
2009-03-09 5:49 ` [PATCH v3 07/11] PCI: Introduce /sys/bus/pci/devices/.../remove Alex Chiang
2009-03-09 18:52 ` Alex Chiang
2009-03-10 22:37 ` Alex Chiang
2009-03-11 4:08 ` Alex Chiang
2009-03-09 5:49 ` [PATCH v3 08/11] PCI: Introduce /sys/bus/pci/devices/.../rescan Alex Chiang
2009-03-09 5:49 ` [PATCH v3 09/11] PCI Hotplug: restore fakephp interface with complete reimplementation Alex Chiang
2009-03-09 5:49 ` [PATCH v3 10/11] PCI Hotplug: rename legacy_fakephp to fakephp Alex Chiang
2009-03-09 5:49 ` [PATCH v3 11/11] PCI Hotplug: schedule fakephp for feature removal Alex Chiang
2009-03-09 18:51 ` [PATCH v3 00/11] PCI core learns hotplug Alex Chiang
2009-03-09 19:30 ` Vegard Nossum
2009-03-09 19:52 ` Alex Chiang
2009-03-09 20:28 ` Vegard Nossum
2009-03-09 20:37 ` Alex Chiang
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=49B8D2F4.1030206@jp.fujitsu.com \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=achiang@hp.com \
--cc=jbarnes@virtuousgeek.org \
--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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome