diff mbox

[v3,5/7] PCI/ACPI: Consolidate common PCI host bridge code into ACPI core

Message ID 5559E44B.2010702@linaro.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Hanjun Guo May 18, 2015, 1:08 p.m. UTC
Hi Jiang,

On 2015?05?14? 16:56, Jiang Liu wrote:
> Introduce common interface acpi_pci_root_create() and related data
> structures to create PCI root bus for ACPI PCI host bridges. It will
> be used to kill duplicated arch specific code for IA64 and x86. It may
> also help ARM64 in future.

As I commented in previous version, this patch will introduce
compile error on ACPI enabled ARM64 kernel because struct
pci_controller is not defined for ARM64, so how about adding
the following patch before this patch, or squash to this one,
does it make sense?

 From 11d0e98154e681e75936698208398cb4dcd73632 Mon Sep 17 00:00:00 2001
From: Hanjun Guo <hanjun.guo@linaro.org>
Date: Mon, 18 May 2015 19:41:56 +0800
Subject: [PATCH] ARM64 / PCI: introduce struct pci_controller for ACPI

ARM64 ACPI based PCI host bridge init needs a arch dependent
struct pci_controller to accommodate common PCI host bridge
code which is introduced later, or it will lead to compile
errors on ARM64.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
CC: Liviu Dudau <Liviu.Dudau@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
CC: Arnd Bergmann <arnd@arndb.de>
---
  arch/arm64/include/asm/pci.h | 10 ++++++++++
  1 file changed, 10 insertions(+)


Thanks
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jiang Liu May 20, 2015, 3:16 a.m. UTC | #1
On 2015/5/18 21:08, Hanjun Guo wrote:
> Hi Jiang,
> 
> On 2015?05?14? 16:56, Jiang Liu wrote:
>> Introduce common interface acpi_pci_root_create() and related data
>> structures to create PCI root bus for ACPI PCI host bridges. It will
>> be used to kill duplicated arch specific code for IA64 and x86. It may
>> also help ARM64 in future.
> 
> As I commented in previous version, this patch will introduce
> compile error on ACPI enabled ARM64 kernel because struct
> pci_controller is not defined for ARM64, so how about adding
> the following patch before this patch, or squash to this one,
> does it make sense?
Hi Hanjun,
	Thanks for fixing this building issue for ARM64. The patch
is really what I want:). Will merge it into next version. With this
patch applied, are there any other issues from ARM64 side?
Thanks!
Gerry

> 
> From 11d0e98154e681e75936698208398cb4dcd73632 Mon Sep 17 00:00:00 2001
> From: Hanjun Guo <hanjun.guo@linaro.org>
> Date: Mon, 18 May 2015 19:41:56 +0800
> Subject: [PATCH] ARM64 / PCI: introduce struct pci_controller for ACPI
> 
> ARM64 ACPI based PCI host bridge init needs a arch dependent
> struct pci_controller to accommodate common PCI host bridge
> code which is introduced later, or it will lead to compile
> errors on ARM64.
> 
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> CC: Liviu Dudau <Liviu.Dudau@arm.com>
> CC: Will Deacon <will.deacon@arm.com>
> CC: Catalin Marinas <catalin.marinas@arm.com>
> CC: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
> CC: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm64/include/asm/pci.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
> index b008a72..7088495 100644
> --- a/arch/arm64/include/asm/pci.h
> +++ b/arch/arm64/include/asm/pci.h
> @@ -10,6 +10,16 @@
>  #include <asm-generic/pci-bridge.h>
>  #include <asm-generic/pci-dma-compat.h>
> 
> +struct acpi_device;
> +
> +struct pci_controller {
> +#ifdef CONFIG_ACPI
> +       struct acpi_device *companion;  /* ACPI companion device */
> +#endif
> +       int             segment;        /* PCI domain */
> +       int             node;           /* NUMA node */
> +};
> +
>  #define PCIBIOS_MIN_IO         0x1000
>  #define PCIBIOS_MIN_MEM                0
> 
> 
> Thanks
> Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hanjun Guo May 20, 2015, 3:33 a.m. UTC | #2
+CC Suravee,

On 2015?05?20? 11:16, Jiang Liu wrote:
> On 2015/5/18 21:08, Hanjun Guo wrote:
>> Hi Jiang,
>>
>> On 2015?05?14? 16:56, Jiang Liu wrote:
>>> Introduce common interface acpi_pci_root_create() and related data
>>> structures to create PCI root bus for ACPI PCI host bridges. It will
>>> be used to kill duplicated arch specific code for IA64 and x86. It may
>>> also help ARM64 in future.
>>
>> As I commented in previous version, this patch will introduce
>> compile error on ACPI enabled ARM64 kernel because struct
>> pci_controller is not defined for ARM64, so how about adding
>> the following patch before this patch, or squash to this one,
>> does it make sense?
> Hi Hanjun,
> 	Thanks for fixing this building issue for ARM64. The patch
> is really what I want:). Will merge it into next version. With this
> patch applied, are there any other issues from ARM64 side?

Suravee is testing ARM64 PCI on top of your patch set, he can confirm
that if there are any other issues :) (Suravee has a real ARM64 hardware
in hand)

Thanks
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hanjun Guo May 22, 2015, 11:23 a.m. UTC | #3
On 2015?05?20? 11:33, Hanjun Guo wrote:
> +CC Suravee,
>
> On 2015?05?20? 11:16, Jiang Liu wrote:
>> On 2015/5/18 21:08, Hanjun Guo wrote:
>>> Hi Jiang,
>>>
>>> On 2015?05?14? 16:56, Jiang Liu wrote:
>>>> Introduce common interface acpi_pci_root_create() and related data
>>>> structures to create PCI root bus for ACPI PCI host bridges. It will
>>>> be used to kill duplicated arch specific code for IA64 and x86. It may
>>>> also help ARM64 in future.
>>>
>>> As I commented in previous version, this patch will introduce
>>> compile error on ACPI enabled ARM64 kernel because struct
>>> pci_controller is not defined for ARM64, so how about adding
>>> the following patch before this patch, or squash to this one,
>>> does it make sense?
>> Hi Hanjun,
>>     Thanks for fixing this building issue for ARM64. The patch
>> is really what I want:). Will merge it into next version. With this
>> patch applied, are there any other issues from ARM64 side?
>
> Suravee is testing ARM64 PCI on top of your patch set, he can confirm
> that if there are any other issues :) (Suravee has a real ARM64 hardware
> in hand)

After confirmed with Suravee, this patch set works OK on ARM64
hardware for PCI hostbridge init, and can enumerate PCI devices
(adding some ARM64 related PCI patches) and works fine with legacy
interrupt, so to me, this patch set is good to go :)

For this patchset:

Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>

I will add my Reviewed-by for some of patches later.

Thanks
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
index b008a72..7088495 100644
--- a/arch/arm64/include/asm/pci.h
+++ b/arch/arm64/include/asm/pci.h
@@ -10,6 +10,16 @@ 
  #include <asm-generic/pci-bridge.h>
  #include <asm-generic/pci-dma-compat.h>

+struct acpi_device;
+
+struct pci_controller {
+#ifdef CONFIG_ACPI
+       struct acpi_device *companion;  /* ACPI companion device */
+#endif
+       int             segment;        /* PCI domain */
+       int             node;           /* NUMA node */
+};
+
  #define PCIBIOS_MIN_IO         0x1000
  #define PCIBIOS_MIN_MEM                0