From: Bjorn Helgaas <bhelgaas@google.com>
To: Jiang Liu <liuj97@gmail.com>
Cc: Yinghai Lu <yinghai@kernel.org>, Jiang Liu <jiang.liu@huawei.com>,
"Rafael J . Wysocki" <rjw@sisk.pl>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Gu Zheng <guz.fnst@cn.fujitsu.com>,
Toshi Kani <toshi.kani@hp.com>,
Myron Stowe <myron.stowe@redhat.com>,
Yijing Wang <wangyijing@huawei.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Russell King <linux@arm.linux.org.uk>,
Thierry Reding <thierry.reding@avionic-design.de>,
Rob Herring <rob.herring@calxeda.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3, part2 20/20] PCI, ARM: use hotplug-safe PCI bus iterators to walk PCI buses
Date: Mon, 17 Jun 2013 12:24:12 -0600 [thread overview]
Message-ID: <20130617182412.GB4233@google.com> (raw)
In-Reply-To: <1369583597-3801-21-git-send-email-jiang.liu@huawei.com>
On Sun, May 26, 2013 at 11:53:17PM +0800, Jiang Liu wrote:
> Enhance ARM architecture specific code to use new hotplug-safe PCI
> bus iterators to walk PCI buses.
>
> Change pcibios_report_status implementation so that it doesn't access
> pci_root_buses global list. The pci_root_buses list will be scheduled
> to be removed.
>
> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
> arch/arm/kernel/bios32.c | 13 +------------
> arch/arm/mach-footbridge/dc21285.c | 12 +++++++++++-
> 2 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index b2ed73c..50ebbe8 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -22,7 +22,7 @@ static int debug_pci;
> * We can't use pci_find_device() here since we are
> * called from interrupt context.
> */
> -static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn)
> +void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn)
> {
> struct pci_dev *dev;
>
> @@ -55,17 +55,6 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
> pcibios_bus_report_status(dev->subordinate, status_mask, warn);
> }
>
> -void pcibios_report_status(u_int status_mask, int warn)
> -{
> - struct list_head *l;
> -
> - list_for_each(l, &pci_root_buses) {
> - struct pci_bus *bus = pci_bus_b(l);
> -
> - pcibios_bus_report_status(bus, status_mask, warn);
> - }
> -}
> -
> /*
> * We don't use this to fix the device, but initialisation of it.
> * It's not the correct use for this, but it works.
> diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
> index a7cd2cf..a0f1d01 100644
> --- a/arch/arm/mach-footbridge/dc21285.c
> +++ b/arch/arm/mach-footbridge/dc21285.c
> @@ -35,7 +35,16 @@
> PCI_STATUS_PARITY) << 16)
>
> extern int setup_arm_irq(int, struct irqaction *);
> -extern void pcibios_report_status(u_int status_mask, int warn);
> +extern void pcibios_report_bus_status(struct pci_bus *bus, u_int status_mask,
> + int warn);
> +
> +static struct pci_bus *dc21285_root_bus;
> +
> +static void pcibios_report_status(u_int status_mask, int warn)
> +{
> + if (dc21285_root_bus)
> + pcibios_report_bus_status(dc21285_root_bus, status_mask, warn);
> +}
>
> static unsigned long
> dc21285_base_address(struct pci_bus *bus, unsigned int devfn)
> @@ -376,5 +385,6 @@ void __init dc21285_preinit(void)
>
> void __init dc21285_postinit(void)
> {
> + dc21285_root_bus = pci_get_next_root_bus(NULL);
It seems sort of ugly to scan the bus in pcibios_init_hw(), which
*returns* the struct pci_bus, then search for it here. Why can't
we just remember the bus we scanned?
It's also a little dubious that we only do pcibios_report_status()
for footbridge. That makes it look like it's debug code that might
not be necessary at all.
> register_isa_ports(DC21285_PCI_MEM, DC21285_PCI_IO, 0);
> }
> --
> 1.8.1.2
>
WARNING: multiple messages have this Message-ID (diff)
From: bhelgaas@google.com (Bjorn Helgaas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3, part2 20/20] PCI, ARM: use hotplug-safe PCI bus iterators to walk PCI buses
Date: Mon, 17 Jun 2013 12:24:12 -0600 [thread overview]
Message-ID: <20130617182412.GB4233@google.com> (raw)
In-Reply-To: <1369583597-3801-21-git-send-email-jiang.liu@huawei.com>
On Sun, May 26, 2013 at 11:53:17PM +0800, Jiang Liu wrote:
> Enhance ARM architecture specific code to use new hotplug-safe PCI
> bus iterators to walk PCI buses.
>
> Change pcibios_report_status implementation so that it doesn't access
> pci_root_buses global list. The pci_root_buses list will be scheduled
> to be removed.
>
> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> ---
> arch/arm/kernel/bios32.c | 13 +------------
> arch/arm/mach-footbridge/dc21285.c | 12 +++++++++++-
> 2 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index b2ed73c..50ebbe8 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -22,7 +22,7 @@ static int debug_pci;
> * We can't use pci_find_device() here since we are
> * called from interrupt context.
> */
> -static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn)
> +void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn)
> {
> struct pci_dev *dev;
>
> @@ -55,17 +55,6 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
> pcibios_bus_report_status(dev->subordinate, status_mask, warn);
> }
>
> -void pcibios_report_status(u_int status_mask, int warn)
> -{
> - struct list_head *l;
> -
> - list_for_each(l, &pci_root_buses) {
> - struct pci_bus *bus = pci_bus_b(l);
> -
> - pcibios_bus_report_status(bus, status_mask, warn);
> - }
> -}
> -
> /*
> * We don't use this to fix the device, but initialisation of it.
> * It's not the correct use for this, but it works.
> diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
> index a7cd2cf..a0f1d01 100644
> --- a/arch/arm/mach-footbridge/dc21285.c
> +++ b/arch/arm/mach-footbridge/dc21285.c
> @@ -35,7 +35,16 @@
> PCI_STATUS_PARITY) << 16)
>
> extern int setup_arm_irq(int, struct irqaction *);
> -extern void pcibios_report_status(u_int status_mask, int warn);
> +extern void pcibios_report_bus_status(struct pci_bus *bus, u_int status_mask,
> + int warn);
> +
> +static struct pci_bus *dc21285_root_bus;
> +
> +static void pcibios_report_status(u_int status_mask, int warn)
> +{
> + if (dc21285_root_bus)
> + pcibios_report_bus_status(dc21285_root_bus, status_mask, warn);
> +}
>
> static unsigned long
> dc21285_base_address(struct pci_bus *bus, unsigned int devfn)
> @@ -376,5 +385,6 @@ void __init dc21285_preinit(void)
>
> void __init dc21285_postinit(void)
> {
> + dc21285_root_bus = pci_get_next_root_bus(NULL);
It seems sort of ugly to scan the bus in pcibios_init_hw(), which
*returns* the struct pci_bus, then search for it here. Why can't
we just remember the bus we scanned?
It's also a little dubious that we only do pcibios_report_status()
for footbridge. That makes it look like it's debug code that might
not be necessary at all.
> register_isa_ports(DC21285_PCI_MEM, DC21285_PCI_IO, 0);
> }
> --
> 1.8.1.2
>
next prev parent reply other threads:[~2013-06-17 18:24 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-26 15:52 [PATCH v3, part2 00/20] Introduce hotplug-safe PCI bus iterators Jiang Liu
2013-05-26 15:52 ` [PATCH v3, part2 01/20] PCI: introduce " Jiang Liu
2013-05-28 4:22 ` Yinghai Lu
2013-05-28 15:06 ` Liu Jiang
2013-06-17 20:06 ` Bjorn Helgaas
2013-06-18 16:23 ` Jiang Liu
2013-06-20 16:18 ` Jiang Liu
2013-06-26 2:58 ` Bjorn Helgaas
2013-05-26 15:52 ` [PATCH v3, part2 02/20] PCI, core: use hotplug-safe iterators to walk PCI buses Jiang Liu
2013-05-26 15:52 ` Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 03/20] PCI, hotplug: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 04/20] PCI, IOV: hold a reference to PCI bus when creating virtual PCI devices Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 05/20] PCI, Alpha: use hotplug-safe iterators to walk PCI buses Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 06/20] PCI, FRV: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 07/20] PCI, IA64: " Jiang Liu
2013-05-26 15:53 ` Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 08/20] PCI, Microblaze: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 09/20] PCI, mn10300: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 10/20] PCI, PPC: " Jiang Liu
2013-05-26 15:53 ` Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 11/20] PCI, SPARC: " Jiang Liu
2013-05-26 15:53 ` Jiang Liu
2013-05-26 17:11 ` David Miller
2013-05-26 17:11 ` David Miller
2013-05-26 15:53 ` [PATCH v3, part2 12/20] PCI, x86: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 13/20] PCI, ACPI: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 14/20] PCI, DRM: " Jiang Liu
2013-06-17 18:08 ` Bjorn Helgaas
2013-05-26 15:53 ` [PATCH v3, part2 15/20] PCI, EDAC: use hotplug-safe PCI bus " Jiang Liu
2013-06-17 20:18 ` Bjorn Helgaas
2013-06-18 16:33 ` Jiang Liu
2013-06-26 3:00 ` Bjorn Helgaas
2013-05-26 15:53 ` [PATCH v3, part2 16/20] PCI, via-camera: use hotplug-safe " Jiang Liu
[not found] ` <1369583597-3801-1-git-send-email-jiang.liu-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-05-26 15:53 ` [PATCH v3, part2 17/20] PCI, iommu: " Jiang Liu
2013-05-26 15:53 ` Jiang Liu
[not found] ` <1369583597-3801-18-git-send-email-jiang.liu-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-06-17 20:20 ` Bjorn Helgaas
2013-06-17 20:20 ` Bjorn Helgaas
[not found] ` <20130617202010.GC7877-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2013-06-17 20:34 ` Don Dutile
2013-06-17 20:34 ` Don Dutile
[not found] ` <51BF72DA.3050106-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-18 16:34 ` Jiang Liu
2013-06-18 16:34 ` Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 18/20] PCI, eeepc-laptop: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 19/20] PCI, asus-wmi: " Jiang Liu
2013-05-26 15:53 ` [PATCH v3, part2 20/20] PCI, ARM: use hotplug-safe PCI bus " Jiang Liu
2013-05-26 15:53 ` Jiang Liu
2013-06-17 18:24 ` Bjorn Helgaas [this message]
2013-06-17 18:24 ` Bjorn Helgaas
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=20130617182412.GB4233@google.com \
--to=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=guz.fnst@cn.fujitsu.com \
--cc=jiang.liu@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=liuj97@gmail.com \
--cc=myron.stowe@redhat.com \
--cc=rjw@sisk.pl \
--cc=rob.herring@calxeda.com \
--cc=thierry.reding@avionic-design.de \
--cc=toshi.kani@hp.com \
--cc=wangyijing@huawei.com \
--cc=yinghai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.