* [PATCH v3 1/2] ARM: pci: Keep pci_common_init() around after init
2012-09-20 7:43 [PATCH v3 0/2] ARM: pci: Prepare for Tegra PCIe controller driver Thierry Reding
@ 2012-09-20 7:43 ` Thierry Reding
2012-09-20 7:43 ` [PATCH v3 2/2] ARM: pci: Allow passing per-controller private data Thierry Reding
2012-10-06 7:03 ` [PATCH v3 0/2] ARM: pci: Prepare for Tegra PCIe controller driver Thierry Reding
2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2012-09-20 7:43 UTC (permalink / raw)
To: linux-arm-kernel
When using deferred driver probing, PCI host controller drivers may
actually require this function after the init stage.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
Changes in v3:
- remove __init annotation from pcibios_init_resources()
Changes in v2:
- remove __devinit annotation from pcibios_swizzle
- remove __init annotations altogether
arch/arm/kernel/bios32.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index b244696..2c80f36 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -389,7 +389,7 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
* PCI standard swizzle is implemented on plug-in cards and Cardbus based
* PCI extenders, so it can not be ignored.
*/
-static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin)
+static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
{
struct pci_sys_data *sys = dev->sysdata;
int slot, oldpin = *pin;
@@ -424,7 +424,7 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
return irq;
}
-static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys)
+static int pcibios_init_resources(int busnr, struct pci_sys_data *sys)
{
int ret;
struct pci_host_bridge_window *window;
@@ -456,7 +456,7 @@ static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys)
return 0;
}
-static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
+static void pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
{
struct pci_sys_data *sys = NULL;
int ret;
@@ -504,7 +504,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
}
}
-void __init pci_common_init(struct hw_pci *hw)
+void pci_common_init(struct hw_pci *hw)
{
struct pci_sys_data *sys;
LIST_HEAD(head);
--
1.7.12
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v3 2/2] ARM: pci: Allow passing per-controller private data
2012-09-20 7:43 [PATCH v3 0/2] ARM: pci: Prepare for Tegra PCIe controller driver Thierry Reding
2012-09-20 7:43 ` [PATCH v3 1/2] ARM: pci: Keep pci_common_init() around after init Thierry Reding
@ 2012-09-20 7:43 ` Thierry Reding
2012-10-06 7:03 ` [PATCH v3 0/2] ARM: pci: Prepare for Tegra PCIe controller driver Thierry Reding
2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2012-09-20 7:43 UTC (permalink / raw)
To: linux-arm-kernel
In order to allow drivers to specify private data for each controller,
this commit adds a private_data field to the struct hw_pci. This field
is an array of nr_controllers pointers that will be used to initialize
the private_data field of the corresponding controller's pci_sys_data
structure.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
arch/arm/include/asm/mach/pci.h | 1 +
arch/arm/kernel/bios32.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index db9fedb..5cf2e97 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -23,6 +23,7 @@ struct hw_pci {
#endif
struct pci_ops *ops;
int nr_controllers;
+ void **private_data;
int (*setup)(int nr, struct pci_sys_data *);
struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
void (*preinit)(void);
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 2c80f36..88da2d4 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -475,6 +475,9 @@ static void pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
sys->map_irq = hw->map_irq;
INIT_LIST_HEAD(&sys->resources);
+ if (hw->private_data)
+ sys->private_data = hw->private_data[nr];
+
ret = hw->setup(nr, sys);
if (ret > 0) {
--
1.7.12
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v3 0/2] ARM: pci: Prepare for Tegra PCIe controller driver
2012-09-20 7:43 [PATCH v3 0/2] ARM: pci: Prepare for Tegra PCIe controller driver Thierry Reding
2012-09-20 7:43 ` [PATCH v3 1/2] ARM: pci: Keep pci_common_init() around after init Thierry Reding
2012-09-20 7:43 ` [PATCH v3 2/2] ARM: pci: Allow passing per-controller private data Thierry Reding
@ 2012-10-06 7:03 ` Thierry Reding
2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2012-10-06 7:03 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 20, 2012 at 09:43:43AM +0200, Thierry Reding wrote:
> Hi Russell,
>
> These are two patches I've been carrying in a larger series that
> converts the Tegra PCIe controller driver to a proper platform driver.
> Since the complete series didn't get much feedback, I've begun to post
> smaller subsets in an effort to get them merged more easily.
>
> The first patch in this series removes the __init annotations from the
> pci_common_init() function (and pcibios_init_hw(), pcibios_swizzle() as
> well as pcibios_init_resources() because they end up being called from
> the former) to make sure that they stay around after the init stage.
> This is required because the Tegra driver depends on regulators that
> become available only very late during boot and uses deferred probing to
> handle this situation. It turned out that this postpones the PCI bus
> initialization until after init, thus this patch.
>
> The second patch is used to pass per-controller or per-host-bridge data
> to the driver, such that it can be associated with the corresponding
> bus. This is also required by the Tegra driver in order to pass a
> driver-private structure to the PCI bus (or more precisely the
> pci_sys_data structure associated with a bus). It is subsequently used
> to obtain the root port private data given the corresponding PCI bus.
>
> Note that v3 is pretty much the same as v2, except that it is rebased on
> linux-next and contains the removal of the __init annotation from the
> pcibios_init_resources() function which is only in linux-next.
Hi Russell,
have you had a chance to look at these yet?
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121006/cb6f89f7/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread