pci/of: Generic PCI <-> OF matching
Subsystems (9)
PATCH 2/6 microblaze/pci: Remove powermac originated cruft
In reply to Benjamin HerrenschmidtThe whole business with re-assigning all bus numbers, creating an OF bus "map" etc... is ancient powermac stuff that you really don't care about on microblaze.
Similarly pci_device_from_OF_node() is unused and by getting rid of it we can get rid of a whole lot of code otherwise unused on this architecture
--- arch/microblaze/include/asm/pci-bridge.h | 3 - arch/microblaze/include/asm/pci.h | 3 +- arch/microblaze/pci/pci_32.c | 272 +----------------------------- 3 files changed, 3 insertions(+), 275 deletions(-)
arch/microblaze/include/asm/pci-bridge.h +0 -3
@@ -19,9 +19,6 @@ enum {*/ PCI_REASSIGN_ALL_RSRC =0x00000001 , -/* Re-assign all bus numbers */ -PCI_REASSIGN_ALL_BUS =0x00000002 , -/* Do not try to assign, just use existing setup */ PCI_PROBE_ONLY = 0x00000004,
arch/microblaze/include/asm/pci.h +1 -2
@@ -40,8 +40,7 @@ struct pci_dev;* Set this to 1 if you want the kernel to re-assign all PCI * bus numbers (don't do that on ppc64 yet !) */ -#define pcibios_assign_all_busses () \ - (pci_has_flag(PCI_REASSIGN_ALL_BUS)) +#define pcibios_assign_all_busses () 0static inline void pcibios_set_master (struct pci_dev *dev) {
arch/microblaze/pci/pci_32.c +2 -270
295 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 4/6 x86/devicetree: Use generic PCI <-> OF matching
In reply to Benjamin HerrenschmidtInstead of walking the whole PCI tree to update the of_node's for PCI busses and devices after the fact, enable the new generic core code for doing so by providing the proper device nodes for the PCI host bridges
--- arch/x86/kernel/devicetree.c | 60 +++++++++--------------------- arch/x86/platform/ce4100/falconfalls.dts | 2 + 2 files changed, 20 insertions(+), 42 deletions(-)
arch/x86/kernel/devicetree.c +18 -42
@@ -123,6 +123,24 @@ static int __init add_bus_probe(void)module_init (add_bus_probe);#ifdef CONFIG_PCI +struct device_node *pcibios_get_phb_of_node (struct pci_bus *bus) +{ +struct device_node *np; + +for_each_node_by_type (np,"pci" ) { +const void *prop; +unsigned int bus_min; + + prop =of_get_property (np,"bus-range" ,NULL ); +if (!prop) +continue ; + bus_min =be32_to_cpup (prop); +if (bus->number == bus_min) +return np; + } +return NULL ; +} +static int x86_of_pci_irq_enable (struct pci_dev *dev) {struct of_irq oirq;
@@ -154,50 +172,8 @@ static void x86_of_pci_irq_disable(struct pci_dev *dev)void __cpuinit x86_of_pci_init (void ) { -struct device_node *np; - pcibios_enable_irq = x86_of_pci_irq_enable; pcibios_disable_irq = x86_of_pci_irq_disable; - -for_each_node_by_type (np,"pci" ) { -const void *prop; -struct pci_bus *bus; -unsigned int bus_min; -struct device_node *child; - - prop =of_get_property (np,"bus-range" ,NULL ); -if (!prop) -continue ; - bus_min =be32_to_cpup (prop); - - bus =pci_find_bus (0 , bus_min); -if (!bus) { -printk (KERN_ERR "Can't find a node for bus %s.\n" , - np->full_name); -continue ; - } - -if (bus->self) - bus->self->dev.of_node = np; -else - bus->dev.of_node = np; - -for_each_child_of_node (np, child) { -struct pci_dev *dev; -u32 devfn; - - prop =of_get_property (child,"reg" ,NULL ); -if (!prop) -continue ; - - devfn = (be32_to_cpup (prop) >>8 ) &0xff ; - dev =pci_get_slot (bus, devfn); -if (!dev) -continue ; - dev->dev.of_node = child; -pci_dev_put (dev); - } - } }#endif
arch/x86/platform/ce4100/falconfalls.dts +2 -0
@@ -74,6 +74,7 @@ compatible = "intel,ce4100-pci", "pci"; device_type = "pci"; bus-range = <1 1>; + reg = <0x0800 0x0 0x0 0x0 0x0>; ranges = <0x2000000 0 0xdffe0000 0x2000000 0 0xdffe0000 0 0x1000>; interrupt-parent = <&ioapic2>;
@@ -412,6 +413,7 @@ #address-cells = <2>; #size-cells = <1>; compatible = "isa"; + reg = <0xf800 0x0 0x0 0x0 0x0>; ranges = <1 0 0 0 0 0x100>; rtc@70 {
Signature · 1 line
1.7.1
PATCH 5/6 pci/of: Consolidate pci_device_to_OF_node()
In reply to Benjamin HerrenschmidtAll archs do more or less the same thing now, move it into a single generic place.
I chose pci.h rather than of_pci.h to avoid having to change all call-sites to include the later.
--- arch/microblaze/include/asm/pci-bridge.h | 5 ----- arch/powerpc/include/asm/pci-bridge.h | 5 ----- arch/sparc/include/asm/pci_32.h | 3 --- arch/sparc/include/asm/pci_64.h | 3 --- arch/sparc/kernel/pci.c | 6 ------ arch/sparc/kernel/pcic.c | 8 -------- arch/x86/include/asm/prom.h | 5 ----- include/linux/pci.h | 5 +++++ 8 files changed, 5 insertions(+), 35 deletions(-)
arch/microblaze/include/asm/pci-bridge.h +0 -5
@@ -102,11 +102,6 @@ struct pci_controller { };#ifdef CONFIG_PCI -static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) -{ -return dev->dev.of_node; -} -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) {return bus->dev.of_node;
arch/powerpc/include/asm/pci-bridge.h +0 -5
@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)return bus->sysdata; } -static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) -{ -return dev->dev.of_node; -} -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) {return bus->dev.of_node;
arch/sparc/include/asm/pci_32.h +0 -3
@@ -42,9 +42,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, }#endif -struct device_node ; -extern struct device_node *pci_device_to_OF_node (struct pci_dev *pdev); -#endif /* __KERNEL__ */ /* generic pci stuff */
arch/sparc/include/asm/pci_64.h +0 -3
@@ -91,9 +91,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)return PCI_IRQ_NONE ; } -struct device_node ; -extern struct device_node *pci_device_to_OF_node (struct pci_dev *pdev); -#define HAVE_ARCH_PCI_RESOURCE_TO_USER extern void pci_resource_to_user(const struct pci_dev *dev, int bar, const struct resource *rsrc,
arch/sparc/kernel/pci.c +0 -6
@@ -1021,12 +1021,6 @@ void arch_teardown_msi_irq(unsigned int irq) }#endif /* !(CONFIG_PCI_MSI) */ -struct device_node *pci_device_to_OF_node (struct pci_dev *pdev) -{ -return pdev->dev.of_node; -} -EXPORT_SYMBOL (pci_device_to_OF_node); -static void ali_sound_dma_hack (struct pci_dev *pdev,int set_bit) {struct pci_dev *ali_isa_bridge;
arch/sparc/kernel/pcic.c +0 -8
@@ -856,14 +856,6 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource)return -ENXIO ; } -struct device_node *pci_device_to_OF_node (struct pci_dev *pdev) -{ -struct pcidev_cookie *pc = pdev->sysdata; - -return pc->prom_node; -} -EXPORT_SYMBOL (pci_device_to_OF_node); -/* * This probably belongs here rather than ioport.c because * we do not want this crud linked into SBus kernels.
arch/x86/include/asm/prom.h +0 -5
@@ -31,11 +31,6 @@ extern void x86_add_irq_domains(void);void __cpuinit x86_of_pci_init (void );void x86_dtb_init (void ); -static inline struct device_node *pci_device_to_OF_node (struct pci_dev *pdev) -{ -return pdev ? pdev->dev.of_node :NULL ; -} -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) {return pci_device_to_OF_node (bus->self);
include/linux/pci.h +5 -0
@@ -1554,6 +1554,11 @@ extern void pci_release_bus_of_node(struct pci_bus *bus);/* Arch may override this (weak) */ extern struct device_node *__weak pcibios_get_phb_of_node (struct pci_bus *bus); +static inline struct device_node *pci_device_to_OF_node (struct pci_dev *pdev) +{ +return pdev ? pdev->dev.of_node :NULL ; +} +#else /* CONFIG_OF */ static inline void pci_set_of_node (struct pci_dev *dev) { }static inline void pci_release_of_node (struct pci_dev *dev) { }
Signature · 1 line
1.7.1
PATCH v3 1/1 pci/of: Generic PCI <-> OF matching
Here's a new batch. This time, I'm reasonably confident I build-tested the right commit-id's on sparc :-)
To sort out the sparc problem I took a slightly different approach than discussed. I made the new code be of_pci.c (which I enabled on sparc) and put the old stuff into of_pci_irq.c (which should still be disabled there).
I've also consolidated pci_bus_to_OF_node() while at it.
PATCH 3/6 microblaze/pci: Move the remains of pci_32.c to pci-common.c
There's no point in keeping this separate. Even if microblaze grows a 64-bit variant, it will probably be able to re-use that code as-is
--- arch/microblaze/pci/Makefile | 2 +- arch/microblaze/pci/pci-common.c | 112 ++++++++++++++++++++++++++++++ arch/microblaze/pci/pci_32.c | 138 -------------------------------------- 3 files changed, 113 insertions(+), 139 deletions(-) delete mode 100644 arch/microblaze/pci/pci_32.c
arch/microblaze/pci/Makefile +1 -1
@@ -2,5 +2,5 @@ # Makefile # -obj-$(CONFIG_PCI) += pci_32.o pci-common.o indirect_pci.o iomap.o +obj-$(CONFIG_PCI) += pci-common.o indirect_pci.o iomap.o obj-$(CONFIG_PCI_XILINX) += xilinx_pci.o
arch/microblaze/pci/pci-common.c +112 -0
127 lines not on this page · raw message
arch/microblaze/pci/pci_32.c deleted +0 -138
138 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 6/6 pci/of: Consolidate pci_bus_to_OF_node()
In reply to Benjamin HerrenschmidtThe generic code always get the device-node in the right place now so a single implementation will work for all archs
--- arch/microblaze/include/asm/pci-bridge.h | 5 ----- arch/powerpc/include/asm/pci-bridge.h | 5 ----- arch/x86/include/asm/prom.h | 6 ------ include/linux/pci.h | 5 +++++ 4 files changed, 5 insertions(+), 16 deletions(-)
arch/microblaze/include/asm/pci-bridge.h +0 -5
@@ -102,11 +102,6 @@ struct pci_controller { };#ifdef CONFIG_PCI -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ -return bus->dev.of_node; -} -static inline struct pci_controller *pci_bus_to_host (const struct pci_bus *bus) {return bus->sysdata;
arch/powerpc/include/asm/pci-bridge.h +0 -5
@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)return bus->sysdata; } -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ -return bus->dev.of_node; -} -#ifndef CONFIG_PPC64 extern int pci_device_from_OF_node(struct device_node *node,
arch/x86/include/asm/prom.h +0 -6
@@ -30,12 +30,6 @@ extern void add_dtb(u64 data);extern void x86_add_irq_domains (void );void __cpuinit x86_of_pci_init (void );void x86_dtb_init (void ); - -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ -return pci_device_to_OF_node (bus->self); -} -#else static inline void add_dtb (u64 data) { }static inline void x86_add_irq_domains (void ) { }
include/linux/pci.h +5 -0
@@ -1559,6 +1559,11 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) return pdev ? pdev->dev.of_node : NULL; } +static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) +{ +return bus ? bus->dev.of_node :NULL ; +} +#else /* CONFIG_OF */ static inline void pci_set_of_node (struct pci_dev *dev) { }static inline void pci_release_of_node (struct pci_dev *dev) { }
Signature · 1 line
1.7.1
PATCH 1/6 pci/of: Match PCI devices to OF nodes dynamically
In reply to Benjamin Herrenschmidtpowerpc has two different ways of matching PCI devices to their corresponding OF node (if any) for historical reasons. The ppc64 one does a scan looking for matching bus/dev/fn, while the ppc32 one does a scan looking only for matching dev/fn on each level in order to be agnostic to busses being renumbered (which Linux does on some platforms).
This removes both and instead moves the matching code to the PCI core itself. It's the most logical place to do it: when a pci_dev is created, we know the parent and thus can do a single level scan for the matching device_node (if any).
The benefit is that all archs now get the matching for free. There's one hook the arch might want to provide to match a PHB bus to its device node. A default weak implementation is provided that looks for the parent device device node, but it's not entirely reliable on powerpc for various reasons so powerpc provides its own.
--- arch/microblaze/include/asm/pci-bridge.h | 14 ++-- arch/microblaze/include/asm/prom.h | 15 --- arch/microblaze/pci/pci_32.c | 40 ++------- arch/powerpc/include/asm/pci-bridge.h | 35 ++----- arch/powerpc/include/asm/pci.h | 3 +- arch/powerpc/include/asm/prom.h | 14 --- arch/powerpc/kernel/pci-common.c | 11 ++- arch/powerpc/kernel/pci_32.c | 150 +++--------------------------- arch/powerpc/kernel/pci_dn.c | 47 --------- arch/powerpc/kernel/pci_of_scan.c | 9 +- arch/powerpc/platforms/powermac/pci.c | 3 +- arch/sparc/kernel/pci.c | 2 +- drivers/of/Kconfig | 8 ++- drivers/of/Makefile | 1 + drivers/of/of_pci.c | 112 ++++++---------------- drivers/of/of_pci_irq.c | 92 ++++++++++++++++++ drivers/pci/Makefile | 2 + drivers/pci/hotplug/rpadlpar_core.c | 2 +- drivers/pci/of.c | 61 ++++++++++++ drivers/pci/probe.c | 7 +- include/linux/of_pci.h | 5 + include/linux/pci.h | 18 ++++ 22 files changed, 275 insertions(+), 376 deletions(-) create mode 100644 drivers/of/of_pci_irq.c create mode 100644 drivers/pci/of.c
arch/microblaze/include/asm/pci-bridge.h +7 -7
@@ -105,19 +105,19 @@ struct pci_controller { };#ifdef CONFIG_PCI -static inline struct pci_controller *pci_bus_to_host (const struct pci_bus *bus) +static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) { -return bus->sysdata; +return dev->dev.of_node; }static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) { -struct pci_controller *host; +return bus->dev.of_node; +} -if (bus->self) -return pci_device_to_OF_node (bus->self); - host =pci_bus_to_host (bus); -return host ? host->dn :NULL ; +static inline struct pci_controller *pci_bus_to_host (const struct pci_bus *bus) +{ +return bus->sysdata; }static inline int isa_vaddr_is_ioport (void __iomem *address)
arch/microblaze/include/asm/prom.h +0 -15
@@ -29,21 +29,6 @@extern int early_uartlite_console (void );extern int early_uart16550_console (void ); -#ifdef CONFIG_PCI -/* -* PCI <-> OF matching functions -* (XXX should these be here?) -*/ -struct pci_bus ; -struct pci_dev ; -extern int pci_device_from_OF_node (struct device_node *node, -u8 *bus,u8 *devfn); -extern struct device_node *pci_busdev_to_OF_node (struct pci_bus *bus, -int devfn); -extern struct device_node *pci_device_to_OF_node (struct pci_dev *dev); -extern void pci_create_OF_bus_map (void ); -#endif -/* * OF address retreival & translation */
arch/microblaze/pci/pci_32.c +7 -33
@@ -210,38 +210,6 @@ static struct device_node *scan_OF_for_pci_bus(struct pci_bus *bus)return np; } -/* -* Scans the OF tree for a device node matching a PCI device -*/ -struct device_node * -pci_busdev_to_OF_node (struct pci_bus *bus,int devfn) -{ -struct device_node *parent, *np; - -pr_debug ("pci_busdev_to_OF_node(%d,0x%x)\n" , bus->number, devfn); - parent =scan_OF_for_pci_bus (bus); -if (parent ==NULL ) -return NULL ; -pr_debug (" parent is %s\n" , parent ? parent->full_name :"<NULL>" ); - np =scan_OF_for_pci_dev (parent, devfn); -of_node_put (parent); -pr_debug (" result is %s\n" , np ? np->full_name :"<NULL>" ); - -/* XXX most callers don't release the returned node -* mostly because ppc64 doesn't increase the refcount, -* we need to fix that. -*/ -return np; -} -EXPORT_SYMBOL (pci_busdev_to_OF_node); - -struct device_node * -pci_device_to_OF_node (struct pci_dev *dev) -{ -return pci_busdev_to_OF_node (dev->bus, dev->devfn); -} -EXPORT_SYMBOL (pci_device_to_OF_node); -static int find_OF_pci_device_filter (struct device_node *node,void *data) {
@@ -315,6 +283,13 @@ pci_create_OF_bus_map(void) } } +struct device_node *pcibios_get_phb_of_node (struct pci_bus *bus) +{ +struct pci_controller *hose = bus->sysdata; + +return of_node_get (hose->dn); +} +static void __devinit pcibios_scan_phb (struct pci_controller *hose) {struct pci_bus *bus;
@@ -332,7 +307,6 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose) hose->global_number);return ; } - bus.dev->of_node =of_node_get (node); bus->secondary = hose->first_busno; hose->bus = bus;
arch/powerpc/include/asm/pci-bridge.h +11 -24
@@ -169,18 +169,22 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)return bus->sysdata; } -#ifndef CONFIG_PPC64 +static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) +{ +return dev->dev.of_node; +}static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) { -struct pci_controller *host; - -if (bus->self) -return pci_device_to_OF_node (bus->self); - host =pci_bus_to_host (bus); -return host ? host->dn :NULL ; +return bus->dev.of_node; } +#ifndef CONFIG_PPC64 + +extern int pci_device_from_OF_node (struct device_node *node, +u8 *bus,u8 *devfn); +extern void pci_create_OF_bus_map (void ); +static inline int isa_vaddr_is_ioport (void __iomem *address) {/* No specific ISA handling on ppc32 at this stage, it
@@ -223,17 +227,8 @@ struct pci_dn {/* Get the pointer to a device_node's pci_dn */ #define PCI_DN (dn) ((struct pci_dn *) (dn)->data) -extern struct device_node *fetch_dev_dn (struct pci_dev *dev);extern void *update_dn_pci_info (struct device_node *dn,void *data); -/* Get a device_node from a pci_dev. This code must be fast except -* in the case where the sysdata is incorrect and needs to be fixed -* up (this will only happen once). */ -static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) -{ -return dev->dev.of_node ? dev->dev.of_node :fetch_dev_dn (dev); -} -static inline int pci_device_from_OF_node (struct device_node *np,u8 *bus,u8 *devfn) {
@@ -244,14 +239,6 @@ static inline int pci_device_from_OF_node(struct device_node *np,return 0 ; } -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ -if (bus->self) -return pci_device_to_OF_node (bus->self); -else -return bus->dev.of_node;/* Must be root bus (PHB) */ -} -/** Find the bus corresponding to the indicated device node */ extern struct pci_bus *pcibios_find_pci_bus (struct device_node *dn);
arch/powerpc/include/asm/pci.h +1 -2
@@ -179,8 +179,7 @@ extern int remove_phb_dynamic(struct pci_controller *phb);extern struct pci_dev *of_create_pci_dev (struct device_node *node,struct pci_bus *bus,int devfn); -extern void of_scan_pci_bridge (struct device_node *node, -struct pci_dev *dev); +extern void of_scan_pci_bridge (struct pci_dev *dev);extern void of_scan_bus (struct device_node *node,struct pci_bus *bus);extern void of_rescan_bus (struct device_node *node,struct pci_bus *bus);
arch/powerpc/include/asm/prom.h +0 -14
@@ -22,20 +22,6 @@#define HAVE_ARCH_DEVTREE_FIXUPS -#ifdef CONFIG_PPC32 -/* -* PCI <-> OF matching functions -* (XXX should these be here?) -*/ -struct pci_bus ; -struct pci_dev ; -extern int pci_device_from_OF_node (struct device_node *node, -u8 * bus,u8 * devfn); -extern struct device_node *pci_busdev_to_OF_node (struct pci_bus *,int ); -extern struct device_node *pci_device_to_OF_node (struct pci_dev *); -extern void pci_create_OF_bus_map (void ); -#endif -/* * OF address retreival & translation */
arch/powerpc/kernel/pci-common.c +7 -4
@@ -1097,9 +1097,6 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)if (dev->is_added)continue ; -/* Setup OF node pointer in the device */ - dev->dev.of_node =pci_device_to_OF_node (dev); -/* Fixup NUMA node as it may not be setup yet by the generic * code and is needed by the DMA init */
@@ -1685,6 +1682,13 @@ int early_find_capability(struct pci_controller *hose, int bus, int devfn,return pci_bus_find_capability (fake_pci_bus (hose, bus), devfn, cap); } +struct device_node *pcibios_get_phb_of_node (struct pci_bus *bus) +{ +struct pci_controller *hose = bus->sysdata; + +return of_node_get (hose->dn); +} +/** * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus * @hose: Pointer to the PCI host controller instance structure
@@ -1705,7 +1709,6 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose) hose->global_number);return ; } - bus->dev.of_node =of_node_get (node); bus->secondary = hose->first_busno; hose->bus = bus;
arch/powerpc/kernel/pci_32.c +13 -137
163 lines not on this page · raw message
arch/powerpc/kernel/pci_dn.c +0 -47
53 lines not on this page · raw message
arch/powerpc/kernel/pci_of_scan.c +3 -6
@@ -202,9 +202,9 @@ EXPORT_SYMBOL(of_create_pci_dev);* this routine in turn call of_scan_bus() recusively to scan for more child * devices. */ -void __devinit of_scan_pci_bridge (struct device_node *node, -struct pci_dev *dev) +void __devinit of_scan_pci_bridge (struct pci_dev *dev) { +struct device_node *node = dev->dev.of_node;struct pci_bus *bus;const u32 *busrange, *ranges;int len, i, mode;
@@ -238,7 +238,6 @@ void __devinit of_scan_pci_bridge(struct device_node *node, bus->primary = dev->bus->number; bus->subordinate = busrange[1 ]; bus->bridge_ctl =0 ; - bus->dev.of_node =of_node_get (node);/* parse ranges property */ /* PCI #address-cells == 3 and #size-cells == 2 always */
@@ -335,9 +334,7 @@ static void __devinit __of_scan_bus(struct device_node *node,list_for_each_entry (dev, &bus->devices, bus_list) {if (dev->hdr_type ==PCI_HEADER_TYPE_BRIDGE || dev->hdr_type ==PCI_HEADER_TYPE_CARDBUS ) { -struct device_node *child =pci_device_to_OF_node (dev); -if (child) -of_scan_pci_bridge (child, dev); +of_scan_pci_bridge (dev); } } }
arch/powerpc/platforms/powermac/pci.c +2 -1
@@ -17,6 +17,7 @@#include <linux/init.h> #include <linux/bootmem.h> #include <linux/irq.h> +#include <linux/of_pci.h> #include <asm/sections.h> #include <asm/io.h>
@@ -235,7 +236,7 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)if (offset >=0x100 )return PCIBIOS_BAD_REGISTER_NUMBER ; - np =pci_busdev_to_OF_node (bus, devfn); + np =of_pci_find_child_device (bus->dev.of_node, devfn);if (np ==NULL )return PCIBIOS_DEVICE_NOT_FOUND ;
arch/sparc/kernel/pci.c +1 -1
@@ -284,7 +284,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, dev->sysdata = node; dev->dev.parent = bus->bridge; dev->dev.bus = &pci_bus_type; - dev->dev.of_node = node; + dev->dev.of_node =of_node_get (node); dev->devfn = devfn; dev->multifunction =0 ;/* maybe a lie? */ set_pcie_port_type (dev);
drivers/of/Kconfig +7 -1
@@ -71,8 +71,14 @@ config OF_MDIO config OF_PCI def_tristate PCI - depends on PCI && (PPC || MICROBLAZE || X86) + depends on PCI help OpenFirmware PCI bus accessors +config OF_PCI_IRQ + def_tristate PCI + depends on OF_PCI && OF_IRQ + help + OpenFirmware PCI IRQ routing helpers + endmenu # OF
drivers/of/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-$(CONFIG_OF_NET) += of_net.o obj-$(CONFIG_OF_SPI) += of_spi.o obj-$(CONFIG_OF_MDIO) += of_mdio.o obj-$(CONFIG_OF_PCI) += of_pci.o +obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o
drivers/of/of_pci.c +30 -82
122 lines not on this page · raw message
drivers/of/of_pci_irq.c new file +92 -0
92 lines not on this page · raw message
drivers/pci/Makefile +2 -0
@@ -70,4 +70,6 @@ obj-$(CONFIG_PCI_STUB) += pci-stub.o obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o +obj-$(CONFIG_OF) += of.o + ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
drivers/pci/hotplug/rpadlpar_core.c +1 -1
@@ -158,7 +158,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)/* Scan below the new bridge */ if (dev->hdr_type ==PCI_HEADER_TYPE_BRIDGE || dev->hdr_type ==PCI_HEADER_TYPE_CARDBUS ) -of_scan_pci_bridge (dn, dev); +of_scan_pci_bridge (dev);/* Map IO space for child bus, which may or may not succeed */ pcibios_map_io_space (dev->subordinate);
drivers/pci/of.c new file +61 -0
61 lines not on this page · raw message
drivers/pci/probe.c +6 -1
@@ -89,6 +89,7 @@ static void release_pcibus_dev(struct device *dev)if (pci_bus->bridge)put_device (pci_bus->bridge);pci_bus_remove_resources (pci_bus); +pci_release_bus_of_node (pci_bus);kfree (pci_bus); }
@@ -624,7 +625,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, child->self = bridge; child->bridge =get_device (&bridge->dev); - +pci_set_bus_of_node (child);pci_set_bus_speed (child);/* Set up default resource pointers and names.. */
@@ -1074,6 +1075,7 @@ static void pci_release_dev(struct device *dev) pci_dev =to_pci_dev (dev);pci_release_capabilities (pci_dev); +pci_release_of_node (pci_dev);kfree (pci_dev); }
@@ -1193,6 +1195,8 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) dev->vendor = l &0xffff ; dev->device = (l >>16 ) &0xffff ; +pci_set_of_node (dev); +if (pci_setup_device (dev)) {kfree (dev);return NULL ;
@@ -1445,6 +1449,7 @@ struct pci_bus * pci_create_bus(struct device *parent, goto dev_reg_err; b->bridge =get_device (dev);device_enable_async_suspend (b->bridge); +pci_set_bus_of_node (b);if (!parent)set_dev_node (b->bridge,pcibus_to_node (b));
include/linux/of_pci.h +5 -0
@@ -6,4 +6,9 @@struct pci_dev ;struct of_irq ;int of_irq_map_pci (struct pci_dev *pdev,struct of_irq *out_irq); + +struct device_node ; +struct device_node *of_pci_find_child_device (struct device_node *parent, +unsigned int devfn); +#endif
include/linux/pci.h +18 -0
@@ -1543,5 +1543,23 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);int pci_vpd_find_info_keyword (const u8 *buf,unsigned int off,unsigned int len,const char *kw); +/* PCI <-> OF binding helpers */ +#ifdef CONFIG_OF +struct device_node ; +extern void pci_set_of_node (struct pci_dev *dev); +extern void pci_release_of_node (struct pci_dev *dev); +extern void pci_set_bus_of_node (struct pci_bus *bus); +extern void pci_release_bus_of_node (struct pci_bus *bus); + +/* Arch may override this (weak) */ +extern struct device_node *__weak pcibios_get_phb_of_node (struct pci_bus *bus); + +#else /* CONFIG_OF */ +static inline void pci_set_of_node (struct pci_dev *dev) { } +static inline void pci_release_of_node (struct pci_dev *dev) { } +static inline void pci_set_bus_of_node (struct pci_bus *bus) { } +static inline void pci_release_bus_of_node (struct pci_bus *bus) { } +#endif /* CONFIG_OF */ +#endif /* __KERNEL__ */ #endif /* LINUX_PCI_H */
Signature · 1 line
1.7.1
Re: [PATCH 3/6] microblaze/pci: Move the remains of pci_32.c to pci-common.c
In reply to Benjamin HerrenschmidtQuoted 9 lines
There's no point in keeping this separate. Even if microblaze grows a 64-bit variant, it will probably be able to re-use that code as-is
arch/microblaze/pci/pci-common.c +0
-0
arch/microblaze/pci/pci-common.c unsigned int pci_flags; · line 57
Quoted 8 lines
arch/microblaze/pci/pci-common.c +5
-0@@ -50,6 +50,11 @@ unsigned int pci_flags;static struct dma_map_ops *pci_dma_ops = &dma_direct_ops; +unsigned long isa_io_base; +unsigned long pci_dram_offset; +static int pci_bus_count; + +
Extra newline.
Eike
Re: [PATCH 3/6] microblaze/pci: Move the remains of pci_32.c to pci-common.c
Quoted 12 lines · Rolf Eike Beer
Quoted 12 lines
There's no point in keeping this separate. Even if microblaze grows a 64-bit variant, it will probably be able to re-use that code as-is
arch/microblaze/pci/pci-common.c +0
-0@@ -50,6 +50,11 @@ unsigned int pci_flags;static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
Quoted 7 lines
arch/microblaze/pci/pci-common.c unsigned int pci_flags; · line 57
Quoted 5 lines
arch/microblaze/pci/pci-common.c +5
-0+unsigned long isa_io_base; +unsigned long pci_dram_offset; +static int pci_bus_count; + +Extra newline.
Can people with no useful content abstain from commenting please.
Cheers,
Ben.
Quoted 9 lines · * Benjamin Herrenschmidt | 2011-04-11 14:12:44 [+1000]:
Here's a new batch. This time, I'm reasonably confident I build-tested the right commit-id's on sparc :-)
To sort out the sparc problem I took a slightly different approach than discussed. I made the new code be
of_pci.c(which I enabled on sparc) and put the old stuff intoof_pci_irq.c(which should still be disabled there).I've also consolidated
pci_bus_to_OF_node()while at it.
This series builds and boots fine on x86.
Sebastian
Re: [PATCH 1/6] pci/of: Match PCI devices to OF nodes dynamically
In reply to Benjamin HerrenschmidtQuoted 12 lines · Benjamin Herrenschmidt
powerpc has two different ways of matching PCI devices to their corresponding OF node (if any) for historical reasons. The ppc64 one does a scan looking for matching bus/dev/fn, while the ppc32 one does a scan looking only for matching dev/fn on each level in order to be agnostic to busses being renumbered (which Linux does on some platforms).
This removes both and instead moves the matching code to the PCI core itself. It's the most logical place to do it: when a
pci_devis created, we know the parent and thus can do a single level scan for the matchingdevice_node(if any).
Quoted 7 lines
The benefit is that all archs now get the matching for free. There's one hook the arch might want to provide to match a PHB bus to its device node. A default weak implementation is provided that looks for the parent device device node, but it's not entirely reliable on powerpc for various reasons so powerpc provides its own.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
Looks good to me. I've not tested this, but I think it is the right approach. It makes me a little nervous because the patch is quite large and seems to fix up several things at once (like the movement of of_irq_map_pci(), and bug fixes like adding of_node_get() calls). I'm not going to make a stink about it, but it is hard to review in this form. Since this touches several architectures and also core pci code, I think it is probably best (as you suggested on IRC) to put it into a separate branch and get sfr to add it to linux-next. If anything goes wrong, then sfr can punt it independently. :-)
You'll need to check with Jesse also.
g.
Quoted 1,028 lines
---
arch/microblaze/include/asm/pci-bridge.h | 14 ++--arch/microblaze/include/asm/prom.h| 15 ---arch/microblaze/pci/pci_32.c| 40 ++-------arch/powerpc/include/asm/pci-bridge.h| 35 ++-----arch/powerpc/include/asm/pci.h| 3 +-arch/powerpc/include/asm/prom.h| 14 ---arch/powerpc/kernel/pci-common.c| 11 ++-arch/powerpc/kernel/pci_32.c| 150 +++---------------------------arch/powerpc/kernel/pci_dn.c| 47 ---------arch/powerpc/kernel/pci_of_scan.c| 9 +-arch/powerpc/platforms/powermac/pci.c| 3 +-arch/sparc/kernel/pci.c| 2 +-drivers/of/Kconfig | 8 ++- drivers/of/Makefile | 1 + drivers/of/of_pci.c | 112 ++++++----------------drivers/of/of_pci_irq.c | 92 ++++++++++++++++++
drivers/pci/Makefile| 2 +drivers/pci/hotplug/rpadlpar_core.c| 2 +-drivers/pci/of.c| 61 ++++++++++++drivers/pci/probe.c| 7 +-include/linux/of_pci.h| 5 +include/linux/pci.h| 18 ++++22 files changed, 275 insertions(+), 376 deletions(-)create mode 100644
drivers/of/of_pci_irq.c
create mode 100644drivers/pci/of.carch/microblaze/include/asm/pci-bridge.h +7
-7@@ -105,19 +105,19 @@ struct pci_controller { }; #ifdef CONFIG_PCI -static inline struct pci_controller *pci_bus_to_host (const struct pci_bus *bus) +static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) { - return bus->sysdata; + return dev->dev.of_node; } static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) { - struct pci_controller *host; + return bus->dev.of_node; +} - if (bus->self) - return pci_device_to_OF_node(bus->self); - host = pci_bus_to_host(bus); - return host ? host->dn : NULL; +static inline struct pci_controller *pci_bus_to_host (const struct pci_bus *bus) +{ + return bus->sysdata; } static inline int isa_vaddr_is_ioport(void __iomem *address)arch/microblaze/include/asm/prom.h +0
-15@@ -29,21 +29,6 @@ extern int early_uartlite_console(void); extern int early_uart16550_console(void); -#ifdef CONFIG_PCI -/* -* PCI <-> OF matching functions -* (XXX should these be here?) -*/ -struct pci_bus ; -struct pci_dev ; -extern int pci_device_from_OF_node (struct device_node *node, - u8 *bus, u8 *devfn); -extern struct device_node *pci_busdev_to_OF_node (struct pci_bus *bus, - int devfn); -extern struct device_node *pci_device_to_OF_node (struct pci_dev *dev); -extern void pci_create_OF_bus_map (void ); -#endif - /** OF address retreival & translation */ arch/microblaze/pci/pci_32.c +0
-32@@ -210,38 +210,6 @@ static struct device_node *scan_OF_for_pci_bus(struct pci_bus *bus) return np; } -/* -* Scans the OF tree for a device node matching a PCI device -*/ -struct device_node * -pci_busdev_to_OF_node (struct pci_bus *bus,int devfn) -{ - struct device_node *parent, *np; - - pr_debug("pci_busdev_to_OF_node(%d,0x%x)\n", bus->number, devfn); - parent = scan_OF_for_pci_bus(bus); - if (parent == NULL) - return NULL; - pr_debug(" parent is %s\n", parent ? parent->full_name : "<NULL>"); - np = scan_OF_for_pci_dev(parent, devfn); - of_node_put(parent); - pr_debug(" result is %s\n", np ? np->full_name : "<NULL>"); - - /* XXX most callers don't release the returned node - * mostly because ppc64 doesn't increase the refcount, - * we need to fix that. - */ - return np; -} -EXPORT_SYMBOL (pci_busdev_to_OF_node); - -struct device_node * -pci_device_to_OF_node (struct pci_dev *dev) -{ - return pci_busdev_to_OF_node(dev->bus, dev->devfn); -} -EXPORT_SYMBOL (pci_device_to_OF_node); -static int
find_OF_pci_device_filter(structdevice_node*node, void *data) {arch/microblaze/pci/pci_32.c +7
-1@@ -315,6 +283,13 @@ pci_create_OF_bus_map(void) } } +struct device_node *pcibios_get_phb_of_node (struct pci_bus *bus) +{ + struct pci_controller *hose = bus->sysdata; + + return of_node_get(hose->dn); +} + static void __devinit pcibios_scan_phb(struct pci_controller *hose) { struct pci_bus *bus;@@ -332,7 +307,6 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose) hose->global_number); return; } - bus.dev->of_node = of_node_get(node); bus->secondary = hose->first_busno; hose->bus = bus;arch/powerpc/include/asm/pci-bridge.h +11
-24@@ -169,18 +169,22 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) return bus->sysdata; } -#ifndef CONFIG_PPC64 +static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) +{ + return dev->dev.of_node; +} static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) { - struct pci_controller *host; - - if (bus->self) - return pci_device_to_OF_node(bus->self); - host = pci_bus_to_host(bus); - return host ? host->dn : NULL; + return bus->dev.of_node; } +#ifndef CONFIG_PPC64 + +extern int pci_device_from_OF_node (struct device_node *node, + u8 *bus, u8 *devfn); +extern void pci_create_OF_bus_map (void ); + static inline int isa_vaddr_is_ioport(void __iomem *address) { /* No specific ISA handling on ppc32 at this stage, it@@ -223,17 +227,8 @@ struct pci_dn { /* Get the pointer to a device_node's pci_dn */ #define PCI_DN(dn) ((struct pci_dn *) (dn)->data) -extern struct device_node *fetch_dev_dn (struct pci_dev *dev); extern void * update_dn_pci_info(struct device_node *dn, void *data); -/* Get a device_node from a pci_dev. This code must be fast except -* in the case where the sysdata is incorrect and needs to be fixed -* up (this will only happen once). */ -static inline struct device_node *pci_device_to_OF_node (struct pci_dev *dev) -{ - return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev); -} - static inline int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn) {@@ -244,14 +239,6 @@ static inline int pci_device_from_OF_node(struct device_node *np, return 0; } -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ - if (bus->self) - return pci_device_to_OF_node(bus->self); - else - return bus->dev.of_node; /* Must be root bus (PHB) */ -} - /** Find the bus corresponding to the indicated device node */ extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);arch/powerpc/include/asm/pci.h +1
-2@@ -179,8 +179,7 @@ extern int remove_phb_dynamic(struct pci_controller *phb); extern struct pci_dev *of_create_pci_dev(struct device_node *node, struct pci_bus *bus, int devfn); -extern void of_scan_pci_bridge (struct device_node *node, - struct pci_dev *dev); +extern void of_scan_pci_bridge (struct pci_dev *dev); extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus);arch/powerpc/include/asm/prom.h +0
-14@@ -22,20 +22,6 @@ #define HAVE_ARCH_DEVTREE_FIXUPS -#ifdef CONFIG_PPC32 -/* -* PCI <-> OF matching functions -* (XXX should these be here?) -*/ -struct pci_bus ; -struct pci_dev ; -extern int pci_device_from_OF_node (struct device_node *node, - u8* bus, u8* devfn); -extern struct device_node *pci_busdev_to_OF_node (struct pci_bus *,int ); -extern struct device_node *pci_device_to_OF_node (struct pci_dev *); -extern void pci_create_OF_bus_map (void ); -#endif - /** OF address retreival & translation */ arch/powerpc/kernel/pci-common.c +7
-4@@ -1097,9 +1097,6 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) if (dev->is_added) continue; - /* Setup OF node pointer in the device */ - dev->dev.of_node = pci_device_to_OF_node(dev); - /* Fixup NUMA node as it may not be setup yet by the generic* code and is needed by the DMA init */ @@ -1685,6 +1682,13 @@ int early_find_capability(struct pci_controller *hose, int bus, int devfn, return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap); } +struct device_node *pcibios_get_phb_of_node (struct pci_bus *bus) +{ + struct pci_controller *hose = bus->sysdata; + + return of_node_get(hose->dn); +} + /*** pci_scan_phb - Given a pci_controller, setup and scan the PCI bus * @hose: Pointer to the PCI host controller instance structure @@ -1705,7 +1709,6 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose) hose->global_number); return; } - bus->dev.of_node = of_node_get(node); bus->secondary = hose->first_busno; hose->bus = bus;arch/powerpc/kernel/pci_32.c +13
-137@@ -167,150 +167,26 @@ pcibios_make_OF_bus_map(void) #endif } -typedef int (*pci_OF_scan_iterator )(struct device_node * node,void * data); - -static struct device_node * -scan_OF_pci_childs (struct device_node *parent,pci_OF_scan_iterator filter,void * data) -{ - struct device_node *node; - struct device_node* sub_node; - - for_each_child_of_node(parent, node) { - const unsigned int *class_code; - - if (filter(node, data)) { - of_node_put(node); - return node; - } - - /* For PCI<->PCI bridges or CardBus bridges, we go down - * Note: some OFs create a parent node "multifunc-device" as - * a fake root for all functions of a multi-function device, - * we go down them as well. - */ - class_code = of_get_property(node, "class-code", NULL); - if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && - (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) && - strcmp(node->name, "multifunc-device")) - continue; - sub_node = scan_OF_pci_childs(node, filter, data); - if (sub_node) { - of_node_put(node); - return sub_node; - } - } - return NULL; -} - -static struct device_node *scan_OF_for_pci_dev (struct device_node *parent, - unsigned int devfn) -{ - struct device_node *np, *cnp; - const u32 *reg; - unsigned int psize; - - for_each_child_of_node(parent, np) { - reg = of_get_property(np, "reg", &psize); - if (reg && psize >= 4 && ((reg[0] >> 8) & 0xff) == devfn) - return np; - - /* Note: some OFs create a parent node "multifunc-device" as - * a fake root for all functions of a multi-function device, - * we go down them as well. */ - if (!strcmp(np->name, "multifunc-device")) { - cnp = scan_OF_for_pci_dev(np, devfn); - if (cnp) - return cnp; - } - } - return NULL; -} - - -static struct device_node *scan_OF_for_pci_bus (struct pci_bus *bus) -{ - struct device_node *parent, *np; - - /* Are we a root bus ? */ - if (bus->self == NULL || bus->parent == NULL) { - struct pci_controller *hose = pci_bus_to_host(bus); - if (hose == NULL) - return NULL; - return of_node_get(hose->dn); - } - - /* not a root bus, we need to get our parent */ - parent = scan_OF_for_pci_bus(bus->parent); - if (parent == NULL) - return NULL; - - /* now iterate for children for a match */ - np = scan_OF_for_pci_dev(parent, bus->self->devfn); - of_node_put(parent); - - return np; -} - -/* -* Scans the OF tree for a device node matching a PCI device -*/ -struct device_node * -pci_busdev_to_OF_node (struct pci_bus *bus,int devfn) -{ - struct device_node *parent, *np; - - pr_debug("pci_busdev_to_OF_node(%d,0x%x)\n", bus->number, devfn); - parent = scan_OF_for_pci_bus(bus); - if (parent == NULL) - return NULL; - pr_debug(" parent is %s\n", parent ? parent->full_name : "<NULL>"); - np = scan_OF_for_pci_dev(parent, devfn); - of_node_put(parent); - pr_debug(" result is %s\n", np ? np->full_name : "<NULL>"); - - /* XXX most callers don't release the returned node - * mostly because ppc64 doesn't increase the refcount, - * we need to fix that. - */ - return np; -} -EXPORT_SYMBOL (pci_busdev_to_OF_node); - -struct device_node * -pci_device_to_OF_node (struct pci_dev *dev) -{ - return pci_busdev_to_OF_node(dev->bus, dev->devfn); -} -EXPORT_SYMBOL (pci_device_to_OF_node); - -static int -find_OF_pci_device_filter (struct device_node * node,void * data) -{ - return ((void *)node == data); -} /** Returns the PCI device matching a given OF node */ -int -pci_device_from_OF_node (struct device_node * node,u8 * bus,u8 * devfn) +int pci_device_from_OF_node (struct device_node *node,u8 *bus,u8 *devfn) { - const unsigned int *reg; - struct pci_controller* hose; - struct pci_dev* dev = NULL; - - /* Make sure it's really a PCI device */ - hose = pci_find_hose_for_OF_device(node); - if (!hose || !hose->dn) - return -ENODEV; - if (!scan_OF_pci_childs(hose->dn, - find_OF_pci_device_filter, (void *)node)) + struct pci_dev *dev = NULL; + const __be32 *reg; + int size; + + /* Check if it might have a chance to be a PCI device */ + if (!pci_find_hose_for_OF_device(node)) return -ENODEV; - reg = of_get_property(node, "reg", NULL); - if (!reg) + + reg = of_get_property(node, "reg", &size); + if (!reg || size < 5 * sizeof(u32)) return -ENODEV; - *bus = (reg[0] >> 16) & 0xff; - *devfn = ((reg[0] >> 8) & 0xff); + + *bus = (be32_to_cpup(®[0]) >> 16) & 0xff; + *devfn = (be32_to_cpup(®[0]) >> 8) & 0xff; /* Ok, here we need some tweak. If we have already renumbered* all busses, we can't rely on the OF bus number any more. arch/powerpc/kernel/pci_dn.c +0
-47@@ -143,53 +143,6 @@ void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb) traverse_pci_devices(dn, update_dn_pci_info, phb); } -/* -* Traversal func that looks for a <busno,devfcn> value. -* If found, the pci_dn is returned (thus terminating the traversal). -*/ -static void *is_devfn_node (struct device_node *dn,void *data) -{ - int busno = ((unsigned long)data >> 8) & 0xff; - int devfn = ((unsigned long)data) & 0xff; - struct pci_dn *pci = dn->data; - - if (pci && (devfn == pci->devfn) && (busno == pci->busno)) - return dn; - return NULL; -} - -/* -* This is the "slow" path for looking up a device_node from a -* pci_dev. It will hunt for the device under its parent's -* phb and then update of_node pointer. -* -* It may also do fixups on the actual device since this happens -* on the first read/write. -* -* Note that it also must deal with devices that don't exist. -* In this case it may probe for real hardware ("just in case") -* and add a device_node to the device tree if necessary. -* -* Is this function necessary anymore now that dev->dev.of_node is -* used to store the node pointer? -* -*/ -struct device_node *fetch_dev_dn (struct pci_dev *dev) -{ - struct pci_controller *phb = dev->sysdata; - struct device_node *dn; - unsigned long searchval = (dev->bus->number << 8) | dev->devfn; - - if (WARN_ON(!phb)) - return NULL; - - dn = traverse_pci_devices(phb->dn, is_devfn_node, (void *)searchval); - if (dn) - dev->dev.of_node = dn; - return dn; -} -EXPORT_SYMBOL (fetch_dev_dn); - /*** pci_devs_phb_init - Initialize phbs and pci devs under them. * arch/powerpc/kernel/pci_of_scan.c +2
-3@@ -202,9 +202,9 @@ EXPORT_SYMBOL(of_create_pci_dev);* this routine in turn call of_scan_bus() recusively to scan for more child * devices. */ -void __devinit of_scan_pci_bridge (struct device_node *node, - struct pci_dev *dev) +void __devinit of_scan_pci_bridge (struct pci_dev *dev) { + struct device_node *node = dev->dev.of_node; struct pci_bus *bus; const u32 *busrange, *ranges; int len, i, mode;@@ -238,7 +238,6 @@ void __devinit of_scan_pci_bridge(struct device_node *node, bus->primary = dev->bus->number; bus->subordinate = busrange[1]; bus->bridge_ctl = 0; - bus->dev.of_node = of_node_get(node); /* parse ranges property */ /* PCI #address-cells == 3 and #size-cells == 2 always */@@ -335,9 +334,7 @@ static void __devinit __of_scan_bus(struct device_node *node, list_for_each_entry(dev, &bus->devices, bus_list) {if (
dev->hdr_type==PCI_HEADER_TYPE_BRIDGE||dev->hdr_type==PCI_HEADER_TYPE_CARDBUS) {
- structdevice_node*child =pci_device_to_OF_node(dev);
- if (child)
-of_scan_pci_bridge(child, dev);
+of_scan_pci_bridge(dev);
}
}
}arch/powerpc/platforms/powermac/pci.c +2
-1@@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/bootmem.h> #include <linux/irq.h> +#include <linux/of_pci.h> #include <asm/sections.h> #include <asm/io.h>@@ -235,7 +236,7 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) if (offset >= 0x100) return PCIBIOS_BAD_REGISTER_NUMBER; - np = pci_busdev_to_OF_node(bus, devfn); + np = of_pci_find_child_device(bus->dev.of_node, devfn); if (np == NULL) return PCIBIOS_DEVICE_NOT_FOUND;arch/sparc/kernel/pci.c +1
-1@@ -284,7 +284,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, dev->sysdata = node; dev->dev.parent = bus->bridge; dev->dev.bus = &pci_bus_type; - dev->dev.of_node = node; + dev->dev.of_node = of_node_get(node); dev->devfn = devfn;dev->multifunction = 0; /* maybe a lie? */
set_pcie_port_type(dev);drivers/of/Kconfig +0
-0@@ -71,8 +71,14 @@ config OF_MDIOconfig
OF_PCI
def_tristate PCI
- depends on PCI && (PPC || MICROBLAZE || X86)
+ depends on PCI
help
OpenFirmware PCI bus accessorsdrivers/of/Kconfig +6
-0+config OF_PCI_IRQ + def_tristate PCI + depends on OF_PCI && OF_IRQ + help + OpenFirmware PCI IRQ routing helpers +endmenu # OF
drivers/of/Makefile +0
-0@@ -10,3 +10,4 @@ obj-$(CONFIG_OF_NET) += of_net.oobj-$(CONFIG_OF_SPI) += of_spi.o
obj-$(CONFIG_OF_MDIO) += of_mdio.o
obj-$(CONFIG_OF_PCI) += of_pci.odrivers/of/Makefile +1
-0+obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.odrivers/of/of_pci.c +30
-82@@ -1,92 +1,40 @@ #include <linux/kernel.h> #include <linux/of_pci.h> -#include <linux/of_irq.h> #include <asm/prom.h> -/** -* of_irq_map_pci - Resolve the interrupt for a PCI device -* @pdev: the device whose interrupt is to be resolved -* @out_irq: structure of_irq filled by this function -* -* This function resolves the PCI interrupt for a given PCI device. If a -* device-node exists for a given pci_dev, it will use normal OF tree -* walking. If not, it will implement standard swizzling and walk up the -* PCI tree until an device-node is found, at which point it will finish -* resolving using the OF tree walking. -*/ -int of_irq_map_pci (struct pci_dev *pdev,struct of_irq *out_irq) +static inline int __of_pci_pci_compare (struct device_node *node, + unsigned int devfn) { - struct device_node *dn, *ppnode; - struct pci_dev *ppdev; - u32 lspec; - __be32 lspec_be; - __be32 laddr[3]; - u8 pin; - int rc; + unsigned int size; + const __be32 *reg = of_get_property(node, "reg", &size); - /* Check if we have a device node, if yes, fallback to standard - * device tree parsing - */ - dn = pci_device_to_OF_node(pdev); - if (dn) { - rc = of_irq_map_one(dn, 0, out_irq); - if (!rc) - return rc; - } - - /* Ok, we don't, time to have fun. Let's start by building up an - * interrupt spec. we assume #interrupt-cells is 1, which is standard - * for PCI. If you do different, then don't use that routine. - */ - rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); - if (rc != 0) - return rc; - /* No pin, exit */ - if (pin == 0) - return -ENODEV; - - /* Now we walk up the PCI tree */ - lspec = pin; - for (;;) { - /* Get the pci_dev of our parent */ - ppdev = pdev->bus->self; - - /* Ouch, it's a host bridge... */ - if (ppdev == NULL) { - ppnode = pci_bus_to_OF_node(pdev->bus); - - /* No node for host bridge ? give up */ - if (ppnode == NULL) - return -EINVAL; - } else { - /* We found a P2P bridge, check if it has a node */ - ppnode = pci_device_to_OF_node(ppdev); - } - - /* Ok, we have found a parent with a device-node, hand over to - * the OF parsing code. - * We build a unit address from the linux device to be used for - * resolution. Note that we use the linux bus number which may - * not match your firmware bus numbering. - * Fortunately, in most cases, interrupt-map-mask doesn't - * include the bus number as part of the matching. - * You should still be careful about that though if you intend - * to rely on this function (you ship a firmware that doesn't - * create device nodes for all PCI devices). - */ - if (ppnode) - break; + if (!reg || size < 5 * sizeof(__be32)) + return 0; + return ((be32_to_cpup(®[0]) >> 8) & 0xff) == devfn; +} - /* We can only get here if we hit a P2P bridge with no node, - * let's do standard swizzling and try again +struct device_node *of_pci_find_child_device (struct device_node *parent, + unsigned int devfn) +{ + struct device_node *node, *node2; + + for_each_child_of_node(parent, node) { + if (__of_pci_pci_compare(node, devfn)) + return node; + /* + * Some OFs create a parent node "multifunc-device" as + * a fake root for all functions of a multi-function + * device we go down them as well. */ - lspec = pci_swizzle_interrupt_pin(pdev, lspec); - pdev = ppdev; + if (!strcmp(node->name, "multifunc-device")) { + for_each_child_of_node(node, node2) { + if (__of_pci_pci_compare(node2, devfn)) { + of_node_put(node); + return node2; + } + } + } } - - lspec_be = cpu_to_be32(lspec); - laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8)); - laddr[1] = laddr[2] = cpu_to_be32(0); - return of_irq_map_raw(ppnode, &lspec_be, 1, laddr, out_irq); + return NULL; } -EXPORT_SYMBOL_GPL (of_irq_map_pci); +EXPORT_SYMBOL_GPL (of_pci_find_child_device);drivers/of/of_pci_irq.c new file +92
-0@@ -0,0 +1,92 @@ +#include <linux/kernel.h> +#include <linux/of_pci.h> +#include <linux/of_irq.h> +#include <asm/prom.h> + +/** +* of_irq_map_pci - Resolve the interrupt for a PCI device +* @pdev: the device whose interrupt is to be resolved +* @out_irq: structure of_irq filled by this function +* +* This function resolves the PCI interrupt for a given PCI device. If a +* device-node exists for a given pci_dev, it will use normal OF tree +* walking. If not, it will implement standard swizzling and walk up the +* PCI tree until an device-node is found, at which point it will finish +* resolving using the OF tree walking. +*/ +int of_irq_map_pci (struct pci_dev *pdev,struct of_irq *out_irq) +{ + struct device_node *dn, *ppnode; + struct pci_dev *ppdev; + u32 lspec; + __be32 lspec_be; + __be32 laddr[3]; + u8 pin; + int rc; + + /* Check if we have a device node, if yes, fallback to standard + * device tree parsing + */ + dn = pci_device_to_OF_node(pdev); + if (dn) { + rc = of_irq_map_one(dn, 0, out_irq); + if (!rc) + return rc; + } + + /* Ok, we don't, time to have fun. Let's start by building up an + * interrupt spec. we assume #interrupt-cells is 1, which is standard + * for PCI. If you do different, then don't use that routine. + */ + rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); + if (rc != 0) + return rc; + /* No pin, exit */ + if (pin == 0) + return -ENODEV; + + /* Now we walk up the PCI tree */ + lspec = pin; + for (;;) { + /* Get the pci_dev of our parent */ + ppdev = pdev->bus->self; + + /* Ouch, it's a host bridge... */ + if (ppdev == NULL) { + ppnode = pci_bus_to_OF_node(pdev->bus); + + /* No node for host bridge ? give up */ + if (ppnode == NULL) + return -EINVAL; + } else { + /* We found a P2P bridge, check if it has a node */ + ppnode = pci_device_to_OF_node(ppdev); + } + + /* Ok, we have found a parent with a device-node, hand over to + * the OF parsing code. + * We build a unit address from the linux device to be used for + * resolution. Note that we use the linux bus number which may + * not match your firmware bus numbering. + * Fortunately, in most cases, interrupt-map-mask doesn't + * include the bus number as part of the matching. + * You should still be careful about that though if you intend + * to rely on this function (you ship a firmware that doesn't + * create device nodes for all PCI devices). + */ + if (ppnode) + break; + + /* We can only get here if we hit a P2P bridge with no node, + * let's do standard swizzling and try again + */ + lspec = pci_swizzle_interrupt_pin(pdev, lspec); + pdev = ppdev; + } + + lspec_be = cpu_to_be32(lspec); + laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8)); + laddr[1] = laddr[2] = cpu_to_be32(0); + return of_irq_map_raw(ppnode, &lspec_be, 1, laddr, out_irq); +} +EXPORT_SYMBOL_GPL (of_irq_map_pci);drivers/pci/Makefile +0
-0@@ -70,4 +70,6 @@ obj-$(CONFIG_PCI_STUB) += pci-stub.oobj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o
drivers/pci/Makefile +2
-0+obj-$(CONFIG_OF) += of.o +ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
drivers/pci/hotplug/rpadlpar_core.c +0
-0@@ -158,7 +158,7 @@ static void dlpar_pci_add_bus(struct device_node *dn) /* Scan below the new bridge */if (
dev->hdr_type==PCI_HEADER_TYPE_BRIDGE||dev->hdr_type==PCI_HEADER_TYPE_CARDBUS)
-of_scan_pci_bridge(dn, dev);
+of_scan_pci_bridge(dev);/* Map IO space for child bus, which may or may not succeed */
pcibios_map_io_space(dev->subordinate);drivers/pci/of.c new file +61
-0@@ -0,0 +1,61 @@ +/* +* PCI <-> OF mapping helpers +* +* Copyright 2011 IBM Corp. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version +* 2 of the License, or (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/pci.h> +#include <linux/of.h> +#include <linux/of_pci.h> +#include "pci.h" + +void pci_set_of_node (struct pci_dev *dev) +{ + if (!dev->bus->dev.of_node) + return; + dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node, + dev->devfn); +} + +void pci_release_of_node (struct pci_dev *dev) +{ + of_node_put(dev->dev.of_node); + dev->dev.of_node = NULL; +} + +void pci_set_bus_of_node (struct pci_bus *bus) +{ + if (bus->self == NULL) + bus->dev.of_node = pcibios_get_phb_of_node(bus); + else + bus->dev.of_node = of_node_get(bus->self->dev.of_node); +} + +void pci_release_bus_of_node (struct pci_bus *bus) +{ + of_node_put(bus->dev.of_node); + bus->dev.of_node = NULL; +} + +struct device_node *__weak pcibios_get_phb_of_node (struct pci_bus *bus) +{ + /* This should only be called for PHBs */ + if (WARN_ON(bus->self || bus->parent)) + return NULL; + + /* Look for a node pointer in either the intermediary device we + * create above the root bus or it's own parent. Normally only + * the later is populated. + */ + if (bus->bridge->of_node) + return of_node_get(bus->bridge->of_node); + if (bus->bridge->parent->of_node) + return of_node_get(bus->bridge->parent->of_node); + return NULL; +}drivers/pci/probe.c +6
-1@@ -89,6 +89,7 @@ static void release_pcibus_dev(struct device *dev) if (pci_bus->bridge) put_device(pci_bus->bridge); pci_bus_remove_resources(pci_bus); + pci_release_bus_of_node(pci_bus); kfree(pci_bus); }@@ -624,7 +625,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, child->self = bridge; child->bridge = get_device(&bridge->dev); - + pci_set_bus_of_node(child); pci_set_bus_speed(child); /* Set up default resource pointers and names.. */@@ -1074,6 +1075,7 @@ static void pci_release_dev(struct device *dev) pci_dev = to_pci_dev(dev); pci_release_capabilities(pci_dev); + pci_release_of_node(pci_dev); kfree(pci_dev); }@@ -1193,6 +1195,8 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) dev->vendor = l & 0xffff; dev->device = (l >> 16) & 0xffff; + pci_set_of_node(dev); + if (pci_setup_device(dev)) { kfree(dev); return NULL;@@ -1445,6 +1449,7 @@ struct pci_bus * pci_create_bus(struct device *parent, goto dev_reg_err; b->bridge = get_device(dev); device_enable_async_suspend(b->bridge); + pci_set_bus_of_node(b); if (!parent) set_dev_node(b->bridge, pcibus_to_node(b));include/linux/of_pci.h +5
-0@@ -6,4 +6,9 @@ struct pci_dev; struct of_irq; int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); + +struct device_node ; +struct device_node *of_pci_find_child_device (struct device_node *parent, + unsigned int devfn); + #endifinclude/linux/pci.h +18
-1@@ -1543,5 +1543,23 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, unsigned int len, const char *kw); +/* PCI <-> OF binding helpers */ +#ifdef CONFIG_OF +struct device_node ; +extern void pci_set_of_node (struct pci_dev *dev); +extern void pci_release_of_node (struct pci_dev *dev); +extern void pci_set_bus_of_node (struct pci_bus *bus); +extern void pci_release_bus_of_node (struct pci_bus *bus); + +/* Arch may override this (weak) */ +extern struct device_node *__weak pcibios_get_phb_of_node (struct pci_bus *bus); + +#else /* CONFIG_OF */ +static inline void pci_set_of_node (struct pci_dev *dev) { } +static inline void pci_release_of_node (struct pci_dev *dev) { } +static inline void pci_set_bus_of_node (struct pci_bus *bus) { } +static inline void pci_release_bus_of_node (struct pci_bus *bus) { } +#endif /* CONFIG_OF */ + #endif /* __KERNEL__ */ #endif /* LINUX_PCI_H */ --1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 6/6] pci/of: Consolidate pci_bus_to_OF_node()
In reply to Benjamin HerrenschmidtQuoted 4 lines · Benjamin Herrenschmidt
The generic code always get the device-node in the right place now so a single implementation will work for all archs
Signed-off-by Benjamin Herrenschmidt <[email protected]>
Patches 2-6 all look good to me.
Quoted 81 lines
---
arch/microblaze/include/asm/pci-bridge.h | 5 -----arch/powerpc/include/asm/pci-bridge.h| 5 -----arch/x86/include/asm/prom.h| 6 ------include/linux/pci.h| 5 +++++4 files changed, 5 insertions(+), 16 deletions(-)arch/microblaze/include/asm/pci-bridge.h +0
-5@@ -102,11 +102,6 @@ struct pci_controller { }; #ifdef CONFIG_PCI -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ - return bus->dev.of_node; -} - static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) { return bus->sysdata;arch/powerpc/include/asm/pci-bridge.h +0
-5@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) return bus->sysdata; } -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ - return bus->dev.of_node; -} - #ifndef CONFIG_PPC64 extern int pci_device_from_OF_node(struct device_node *node,arch/x86/include/asm/prom.h +0
-6@@ -30,12 +30,6 @@ extern void add_dtb(u64 data); extern void x86_add_irq_domains(void); void __cpuinit x86_of_pci_init(void); void x86_dtb_init(void); - -static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) -{ - return pci_device_to_OF_node(bus->self); -} - #else static inline void add_dtb(u64 data) { } static inline void x86_add_irq_domains(void) { }include/linux/pci.h +5
-1@@ -1559,6 +1559,11 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) return pdev ? pdev->dev.of_node : NULL; } +static inline struct device_node *pci_bus_to_OF_node (struct pci_bus *bus) +{ + return bus ? bus->dev.of_node : NULL; +} + #else /* CONFIG_OF */ static inline void pci_set_of_node(struct pci_dev *dev) { } static inline void pci_release_of_node(struct pci_dev *dev) { } --1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Quoted 10 lines · Benjamin Herrenschmidt
Here's a new batch. This time, I'm reasonably confident I build-tested the right commit-id's on sparc :-)
To sort out the sparc problem I took a slightly different approach than discussed. I made the new code be
of_pci.c(which I enabled on sparc) and put the old stuff intoof_pci_irq.c(which should still be disabled there).I've also consolidated
pci_bus_to_OF_node()while at it.
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Quoted 9 lines · Benjamin Herrenschmidt
Here's a new batch. This time, I'm reasonably confident I build-tested the right commit-id's on sparc :-)
To sort out the sparc problem I took a slightly different approach than discussed. I made the new code be
of_pci.c(which I enabled on sparc) and put the old stuff intoof_pci_irq.c(which should still be disabled there).I've also consolidated
pci_bus_to_OF_node()while at it.
Hi Jesse !
No significant changes (other than a rebase) nor new feedback since last time, I've also added a few acks I got. But not worth spamming the list with a re-post.
I'd like this to go into -next now so it can hit the next merge window, unless somebody objects.
I've put the series in a branch "of-pci" of my powerpc.git repo at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git of-pci
Please let me know if you're ok (and maybe give me Ack's) and I'll ask Stephen to add it to next.
Cheers,
Ben.
Jesse Barnes
Acked-byQuoted 20 lines · On Tue, 07 Jun 2011 15:58:43 +1000 Benjamin Herrenschmidt…
Quoted 9 lines · Benjamin Herrenschmidt
Here's a new batch. This time, I'm reasonably confident I build-tested the right commit-id's on sparc :-)
To sort out the sparc problem I took a slightly different approach than discussed. I made the new code be
of_pci.c(which I enabled on sparc) and put the old stuff intoof_pci_irq.c(which should still be disabled there).I've also consolidated
pci_bus_to_OF_node()while at it.Hi Jesse !
No significant changes (other than a rebase) nor new feedback since last time, I've also added a few acks I got. But not worth spamming the list with a re-post.
I'd like this to go into -next now so it can hit the next merge window, unless somebody objects.
Quoted 6 lines
I've put the series in a branch "of-pci" of my powerpc.git repo at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.gitof-pciPlease let me know if you're ok (and maybe give me Ack's) and I'll ask Stephen to add it to next.
Yeah, the generic bits look good to me, you can add my
Thanks,
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 10 lines
Quoted 10 lines
No significant changes (other than a rebase) nor new feedback since last time, I've also added a few acks I got. But not worth spamming the list with a re-post.
I'd like this to go into -next now so it can hit the next merge window, unless somebody objects.
I've put the series in a branch "of-pci" of my powerpc.git repo at:
Quoted 7 lines
Quoted 4 lines
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.gitof-pciPlease let me know if you're ok (and maybe give me Ack's) and I'll ask Stephen to add it to next.
Yeah, the generic bits look good to me, you can add my
Acked-by Jesse Barnes <[email protected]>
Great. Will do. I'll ask Stephen to that that in -next then and will ask Linus to pull directly at the next merge window, separately from powerpc.git (tho I might actually end up pulling that tree into powerpc.git too as I might end up with stuff that depends on it).
Cheers,
Ben.
Quoted 14 lines · Benjamin Herrenschmidt
Quoted 14 lines
Quoted 13 lines
No significant changes (other than a rebase) nor new feedback since last time, I've also added a few acks I got. But not worth spamming the list with a re-post.
I'd like this to go into -next now so it can hit the next merge window, unless somebody objects.
I've put the series in a branch "of-pci" of my powerpc.git repo at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.gitof-pciPlease let me know if you're ok (and maybe give me Ack's) and I'll ask Stephen to add it to next.
Quoted 7 lines
Quoted 2 lines
Yeah, the generic bits look good to me, you can add my
Acked-by Jesse Barnes <[email protected]>Great. Will do. I'll ask Stephen to that that in -next then and will ask Linus to pull directly at the next merge window, separately from powerpc.git (tho I might actually end up pulling that tree into powerpc.git too as I might end up with stuff that depends on it).
Allright, Stephen, can you stick this into -next please ?
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git of-pci
I've added Jesse's acks.
Thanks !
Cheers,
Ben.
Hi Ben,
Quoted 24 lines · On Wed, 08 Jun 2011 10:06:05 +1000 Benjamin Herrenschmidt…
Quoted 14 lines · Benjamin Herrenschmidt
Quoted 14 lines
Quoted 13 lines
No significant changes (other than a rebase) nor new feedback since last time, I've also added a few acks I got. But not worth spamming the list with a re-post.
I'd like this to go into -next now so it can hit the next merge window, unless somebody objects.
I've put the series in a branch "of-pci" of my powerpc.git repo at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.gitof-pciPlease let me know if you're ok (and maybe give me Ack's) and I'll ask Stephen to add it to next.
Quoted 7 lines
Quoted 2 lines
Yeah, the generic bits look good to me, you can add my
Acked-by Jesse Barnes <[email protected]>Great. Will do. I'll ask Stephen to that that in -next then and will ask Linus to pull directly at the next merge window, separately from powerpc.git (tho I might actually end up pulling that tree into powerpc.git too as I might end up with stuff that depends on it).
Quoted 5 lines
Allright, Stephen, can you stick this into -next please ?
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.gitof-pciI've added Jesse's acks.
OK, I have added this today.
Thanks for adding your subsystem tree as a participant of linux-next. As you may know, this is not a judgment of your code. The purpose of linux-next is for integration testing and to lower the impact of conflicts between subsystems in the next merge window.
You will need to ensure that the patches/commits in your tree/series have been:
* submitted under GPL v2 (or later) and include the Contributor's Signed-off-by,
* posted to the relevant mailing list,
* reviewed by you (or another maintainer of your subsystem tree),
* successfully unit tested, and
* destined for the current or next Linux merge window.
Basically, this should be just what you would send to Linus (or ask him to fetch). It is allowed to be rebased if you deem it necessary.
Signature · 15 lines
Cheers, Stephen Rothwell [email protected] Legal Stuff: By participating in linux-next, your subsystem tree contributions are public and will be included in the linux-next trees. You may be sent e-mail messages indicating errors or other issues when the patches/commits from your subsystem tree are merged and tested in linux-next. These messages may also be cross-posted to the linux-next mailing list, the linux-kernel mailing list, etc. The linux-next tree project and IBM (my employer) make no warranties regarding the linux-next project, the testing procedures, the results, the e-mails, etc. If you don't agree to these ground rules, let me know and I'll remove your tree from participation in linux-next.