All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/19] Refactor PCI controller operations
@ 2015-03-31  5:00 Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 01/19] powerpc: move find_and_init_phbs() to pSeries specific code Daniel Axtens
                   ` (19 more replies)
  0 siblings, 20 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This patch set moves some PCI controller operations out of ppc_md and
into a new pci_controller_ops struct.

This is desirable for systems with more than one type of PCI
controller. In particular, it's intended that this new interface will
be used by the CXL (aka CAPI) driver.

The design tries to balance a desire to avoid having yet another
abstraction layer with a desire to make it easy for vendor kernels to
pull in as little or as much as they are comfortable with.

To this end, it's in 3 main parts:

 1) Set up the pci_controller_ops structure. For each function we add
 to the structure, set up a shim that calls the controller_ops
 function if it exists, or the ppc_md function otherwise. Modify
 callsites to use the shims.

 2) Move each affected platform over from using ppc_md to using the
 controller_ops structure.

 3) Take out the shims and the ppc_md entries. Modify the callsites to
 use the controller_ops calls.

MSI and some legacy functions have been deliberately deferred, and
will be to be tackled at a later point.

The set has been build tested for PowerNV, pSeries, Power Mac, Maple,
Cell, PaSemi and Corenet 64 (for fsl_pci). It builds at every point in
the series.

The set depends on mpe's two recent cleanup patches to remove powernv
RTAS support [1] and drop celleb [2].

Thanks for feedback from mpe, there is one functional change since v1,
and a number of cosmetic ones.
Functionally:

 - A mistake was made regarding in fsl_pci/swiotlb. I though that
   setting ppc_swiotlb_enable in fsl_pci.c couldn't have an effect,
   and removed it in patch #4. This was wrong. Drop the offending
   patch. In the patch that ports fsl_pci/swiotlb to the new
   structure, move the hook around so that it always has the correct
   value.

Cosmetically:
 - Prefer "phb" over "hose" whenever possible.
 - Drop an unnecessary renaming patch. (prev #3)
 - Squash all the shim removal.
 - Squash the creation of the struct with the addition of the first
   member.
 - Better commit messages. (Thanks sfr & mpe)
 - Shims now have names that (where possible) match the ppc_md names,
   rather than the new, non-namespaced names.


The series has also been rebased onto -rc6; no changes were necessary.

The full breakdown of the patches is as follows:
Patches  1 - 3:  minor necessary cleanups
Patches  4 - 9: Introduce struct and shims
Patches 10 - 17: Platform specific migrations
Patch        18: Remove shims
Patch        19: Final cleanup


Daniel Axtens (19):
  powerpc: move find_and_init_phbs() to pSeries specific code
  powerpc/powermac: move pmac_pci_probe_mode from setup.c to pci.c
  powerpc: pcibios_enable_device_hook: return bool rather than int
  powerpc: Create pci_controller_ops.dma_dev_setup and shims
  powerpc: Create pci_controller_ops.dma_bus_setup and shim
  powerpc: Create pci_controller_ops.probe_mode and shim
  powerpc: Create pci_controller_ops.enable_device_hook and shim
  powerpc: Create pci_controller_ops.window_alignment and shim
  powerpc: Create pci_controller_ops.reset_secondary_bus and shim
  powerpc: dart_iommu: optionally populate controller_ops on init
  powerpc/powermac: Move controller ops from ppc_md to controller_ops
  powerpc/pseries: Move controller ops from ppc_md to controller_ops
  powerpc/powernv:  Move controller ops from ppc_md to controller_ops
  powerpc/pasemi: Move controller ops from ppc_md to controller_ops
  powerpc/maple: Move controller ops from ppc_md to controller_ops
  powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to
    controller_ops
  powerpc/cell: Move controller ops from ppc_md to controller_ops
  powerpc: Remove shims for pci_controller_ops operations
  powerpc: dart_iommu: Remove check for controller_ops == NULL case

 arch/powerpc/include/asm/iommu.h            |  3 +-
 arch/powerpc/include/asm/machdep.h          | 14 --------
 arch/powerpc/include/asm/pci-bridge.h       | 19 +++++++++++
 arch/powerpc/include/asm/pci.h              |  2 +-
 arch/powerpc/include/asm/ppc-pci.h          |  3 --
 arch/powerpc/kernel/dma-swiotlb.c           | 11 +++---
 arch/powerpc/kernel/pci-common.c            | 35 ++++++++++++-------
 arch/powerpc/kernel/pci-hotplug.c           |  7 ++--
 arch/powerpc/kernel/pci_of_scan.c           |  7 ++--
 arch/powerpc/kernel/rtas_pci.c              | 47 -------------------------
 arch/powerpc/platforms/cell/cell.h          | 24 +++++++++++++
 arch/powerpc/platforms/cell/iommu.c         |  7 ++--
 arch/powerpc/platforms/cell/setup.c         |  5 +++
 arch/powerpc/platforms/maple/maple.h        |  2 ++
 arch/powerpc/platforms/maple/pci.c          |  4 +++
 arch/powerpc/platforms/maple/setup.c        |  2 +-
 arch/powerpc/platforms/pasemi/iommu.c       |  6 ++--
 arch/powerpc/platforms/pasemi/pasemi.h      |  1 +
 arch/powerpc/platforms/pasemi/pci.c         |  5 +++
 arch/powerpc/platforms/powermac/pci.c       | 38 ++++++++++++++++++---
 arch/powerpc/platforms/powermac/pmac.h      |  3 +-
 arch/powerpc/platforms/powermac/setup.c     | 22 +-----------
 arch/powerpc/platforms/powernv/pci-ioda.c   | 15 ++++----
 arch/powerpc/platforms/powernv/pci-p5ioc2.c |  1 +
 arch/powerpc/platforms/powernv/pci.c        |  5 ++-
 arch/powerpc/platforms/powernv/powernv.h    |  2 ++
 arch/powerpc/platforms/pseries/iommu.c      |  9 ++---
 arch/powerpc/platforms/pseries/pseries.h    |  2 ++
 arch/powerpc/platforms/pseries/setup.c      | 53 ++++++++++++++++++++++++++++-
 arch/powerpc/sysdev/dart_iommu.c            | 10 +++---
 arch/powerpc/sysdev/fsl_pci.c               | 19 +++++++++++
 31 files changed, 244 insertions(+), 139 deletions(-)
 create mode 100644 arch/powerpc/platforms/cell/cell.h

-- 
2.1.4

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH v2 01/19] powerpc: move find_and_init_phbs() to pSeries specific code
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 02/19] powerpc/powermac: move pmac_pci_probe_mode from setup.c to pci.c Daniel Axtens
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Previously, find_and_init_phbs() was used in both PowerNV and pSeries
setup. However, since RTAS support has been dropped from PowerNV, we
can move it into a platform-specific file.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

This patch depends on the patch to drop RTAS support from PowerNV:
http://patchwork.ozlabs.org/patch/449316/
---
 arch/powerpc/include/asm/ppc-pci.h     |  3 ---
 arch/powerpc/kernel/rtas_pci.c         | 47 ----------------------------------
 arch/powerpc/platforms/pseries/setup.c | 47 ++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 50 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index db1e2b8..83f7e8e 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -23,8 +23,6 @@ extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary);
 
 extern struct list_head hose_list;
 
-extern void find_and_init_phbs(void);
-
 extern struct pci_dev *isa_bridge_pcidev;	/* may be NULL if no ISA bus */
 
 /** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */
@@ -76,7 +74,6 @@ static inline const char *eeh_driver_name(struct pci_dev *pdev)
 #endif /* CONFIG_EEH */
 
 #else /* CONFIG_PCI */
-static inline void find_and_init_phbs(void) { }
 static inline void init_pci_config_tokens(void) { }
 #endif /* !CONFIG_PCI */
 
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index ce230da..42db314 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -277,50 +277,3 @@ int rtas_setup_phb(struct pci_controller *phb)
 
 	return 0;
 }
-
-void __init find_and_init_phbs(void)
-{
-	struct device_node *node;
-	struct pci_controller *phb;
-	struct device_node *root = of_find_node_by_path("/");
-
-	for_each_child_of_node(root, node) {
-		if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
-					   strcmp(node->type, "pciex") != 0))
-			continue;
-
-		phb = pcibios_alloc_controller(node);
-		if (!phb)
-			continue;
-		rtas_setup_phb(phb);
-		pci_process_bridge_OF_ranges(phb, node, 0);
-		isa_bridge_find_early(phb);
-	}
-
-	of_node_put(root);
-	pci_devs_phb_init();
-
-	/*
-	 * PCI_PROBE_ONLY and PCI_REASSIGN_ALL_BUS can be set via properties
-	 * in chosen.
-	 */
-	if (of_chosen) {
-		const int *prop;
-
-		prop = of_get_property(of_chosen,
-				"linux,pci-probe-only", NULL);
-		if (prop) {
-			if (*prop)
-				pci_add_flags(PCI_PROBE_ONLY);
-			else
-				pci_clear_flags(PCI_PROBE_ONLY);
-		}
-
-#ifdef CONFIG_PPC32 /* Will be made generic soon */
-		prop = of_get_property(of_chosen,
-				"linux,pci-assign-all-buses", NULL);
-		if (prop && *prop)
-			pci_add_flags(PCI_REASSIGN_ALL_BUS);
-#endif /* CONFIG_PPC32 */
-	}
-}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index e445b67..1a5f884 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -461,6 +461,53 @@ static long pseries_little_endian_exceptions(void)
 }
 #endif
 
+static void __init find_and_init_phbs(void)
+{
+	struct device_node *node;
+	struct pci_controller *phb;
+	struct device_node *root = of_find_node_by_path("/");
+
+	for_each_child_of_node(root, node) {
+		if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
+					   strcmp(node->type, "pciex") != 0))
+			continue;
+
+		phb = pcibios_alloc_controller(node);
+		if (!phb)
+			continue;
+		rtas_setup_phb(phb);
+		pci_process_bridge_OF_ranges(phb, node, 0);
+		isa_bridge_find_early(phb);
+	}
+
+	of_node_put(root);
+	pci_devs_phb_init();
+
+	/*
+	 * PCI_PROBE_ONLY and PCI_REASSIGN_ALL_BUS can be set via properties
+	 * in chosen.
+	 */
+	if (of_chosen) {
+		const int *prop;
+
+		prop = of_get_property(of_chosen,
+				"linux,pci-probe-only", NULL);
+		if (prop) {
+			if (*prop)
+				pci_add_flags(PCI_PROBE_ONLY);
+			else
+				pci_clear_flags(PCI_PROBE_ONLY);
+		}
+
+#ifdef CONFIG_PPC32 /* Will be made generic soon */
+		prop = of_get_property(of_chosen,
+				"linux,pci-assign-all-buses", NULL);
+		if (prop && *prop)
+			pci_add_flags(PCI_REASSIGN_ALL_BUS);
+#endif /* CONFIG_PPC32 */
+	}
+}
+
 static void __init pSeries_setup_arch(void)
 {
 	set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 02/19] powerpc/powermac: move pmac_pci_probe_mode from setup.c to pci.c
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 01/19] powerpc: move find_and_init_phbs() to pSeries specific code Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 03/19] powerpc: pcibios_enable_device_hook: return bool rather than int Daniel Axtens
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/platforms/powermac/pci.c   | 17 +++++++++++++++++
 arch/powerpc/platforms/powermac/pmac.h  |  4 ++++
 arch/powerpc/platforms/powermac/setup.c | 18 ------------------
 3 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index f4071a6..a792f45 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1223,3 +1223,20 @@ static void fixup_u4_pcie(struct pci_dev* dev)
 	pci_write_config_dword(dev, PCI_PREF_MEMORY_BASE, 0);
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie);
+
+#ifdef CONFIG_PPC64
+int pmac_pci_probe_mode(struct pci_bus *bus)
+{
+	struct device_node *node = pci_bus_to_OF_node(bus);
+
+	/* We need to use normal PCI probing for the AGP bus,
+	 * since the device for the AGP bridge isn't in the tree.
+	 * Same for the PCIe host on U4 and the HT host bridge.
+	 */
+	if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
+				  of_device_is_compatible(node, "u4-pcie") ||
+				  of_device_is_compatible(node, "u3-ht")))
+		return PCI_PROBE_NORMAL;
+	return PCI_PROBE_DEVTREE;
+}
+#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index 8327cce..46d2193 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -39,4 +39,8 @@ extern void low_cpu_die(void) __attribute__((noreturn));
 extern int pmac_nvram_init(void);
 extern void pmac_pic_init(void);
 
+#ifdef CONFIG_PPC64
+extern int pmac_pci_probe_mode(struct pci_bus *bus);
+#endif
+
 #endif /* __PMAC_H__ */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 713d36d..efe172d 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -637,24 +637,6 @@ static int __init pmac_probe(void)
 	return 1;
 }
 
-#ifdef CONFIG_PPC64
-/* Move that to pci.c */
-static int pmac_pci_probe_mode(struct pci_bus *bus)
-{
-	struct device_node *node = pci_bus_to_OF_node(bus);
-
-	/* We need to use normal PCI probing for the AGP bus,
-	 * since the device for the AGP bridge isn't in the tree.
-	 * Same for the PCIe host on U4 and the HT host bridge.
-	 */
-	if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
-				  of_device_is_compatible(node, "u4-pcie") ||
-				  of_device_is_compatible(node, "u3-ht")))
-		return PCI_PROBE_NORMAL;
-	return PCI_PROBE_DEVTREE;
-}
-#endif /* CONFIG_PPC64 */
-
 define_machine(powermac) {
 	.name			= "PowerMac",
 	.probe			= pmac_probe,
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 03/19] powerpc: pcibios_enable_device_hook: return bool rather than int
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 01/19] powerpc: move find_and_init_phbs() to pSeries specific code Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 02/19] powerpc/powermac: move pmac_pci_probe_mode from setup.c to pci.c Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim Daniel Axtens
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

pcibios_enable_device_hook returned an int. Every implementation
returned either -EINVAL or 0. The return value wasn't propagated by
the caller: any non-zero return value caused pcibios_enable_device
to return -EINVAL itself. Therefore, make the hook return a bool.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/include/asm/machdep.h        | 4 ++--
 arch/powerpc/kernel/pci-common.c          | 2 +-
 arch/powerpc/platforms/powermac/pci.c     | 8 ++++----
 arch/powerpc/platforms/powermac/pmac.h    | 2 +-
 arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++++----
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index c8175a3..9d4a067 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -237,9 +237,9 @@ struct machdep_calls {
 	/* Called for each PCI bus in the system when it's probed */
 	void (*pcibios_fixup_bus)(struct pci_bus *);
 
-	/* Called when pci_enable_device() is called. Returns 0 to
+	/* Called when pci_enable_device() is called. Returns true to
 	 * allow assignment/enabling of the device. */
-	int  (*pcibios_enable_device_hook)(struct pci_dev *);
+	bool (*pcibios_enable_device_hook)(struct pci_dev *);
 
 	/* Called after scan and before resource survey */
 	void (*pcibios_fixup_phb)(struct pci_controller *hose);
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 2a525c9..3d07d81 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1451,7 +1451,7 @@ EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus);
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
 	if (ppc_md.pcibios_enable_device_hook)
-		if (ppc_md.pcibios_enable_device_hook(dev))
+		if (!ppc_md.pcibios_enable_device_hook(dev))
 			return -EINVAL;
 
 	return pci_enable_resources(dev, mask);
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index a792f45..9c89fd2 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -942,7 +942,7 @@ void __init pmac_pci_init(void)
 }
 
 #ifdef CONFIG_PPC32
-int pmac_pci_enable_device_hook(struct pci_dev *dev)
+bool pmac_pci_enable_device_hook(struct pci_dev *dev)
 {
 	struct device_node* node;
 	int updatecfg = 0;
@@ -958,11 +958,11 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev)
 	    && !node) {
 		printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n",
 		       pci_name(dev));
-		return -EINVAL;
+		return false;
 	}
 
 	if (!node)
-		return 0;
+		return true;
 
 	uninorth_child = node->parent &&
 		of_device_is_compatible(node->parent, "uni-north");
@@ -1003,7 +1003,7 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev)
 				      L1_CACHE_BYTES >> 2);
 	}
 
-	return 0;
+	return true;
 }
 
 void pmac_pci_fixup_ohci(struct pci_dev *dev)
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index 46d2193..b8d5721 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -25,7 +25,7 @@ extern void pmac_pci_init(void);
 extern void pmac_nvram_update(void);
 extern unsigned char pmac_nvram_read_byte(int addr);
 extern void pmac_nvram_write_byte(int addr, unsigned char val);
-extern int pmac_pci_enable_device_hook(struct pci_dev *dev);
+extern bool pmac_pci_enable_device_hook(struct pci_dev *dev);
 extern void pmac_pcibios_after_init(void);
 extern int of_show_percpuinfo(struct seq_file *m, int i);
 
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 6c9ff2b..c18e191 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1910,7 +1910,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,
 /* Prevent enabling devices for which we couldn't properly
  * assign a PE
  */
-static int pnv_pci_enable_device_hook(struct pci_dev *dev)
+static bool pnv_pci_enable_device_hook(struct pci_dev *dev)
 {
 	struct pci_controller *hose = pci_bus_to_host(dev->bus);
 	struct pnv_phb *phb = hose->private_data;
@@ -1922,13 +1922,13 @@ static int pnv_pci_enable_device_hook(struct pci_dev *dev)
 	 * PEs isn't ready.
 	 */
 	if (!phb->initialized)
-		return 0;
+		return true;
 
 	pdn = pci_get_pdn(dev);
 	if (!pdn || pdn->pe_number == IODA_INVALID_PE)
-		return -EINVAL;
+		return false;
 
-	return 0;
+	return true;
 }
 
 static u32 pnv_ioda_bdfn_to_pe(struct pnv_phb *phb, struct pci_bus *bus,
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (2 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 03/19] powerpc: pcibios_enable_device_hook: return bool rather than int Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-04-02 14:13     ` Arnd Bergmann
  2015-03-31  5:00 ` [PATCH v2 05/19] powerpc: Create pci_controller_ops.dma_bus_setup " Daniel Axtens
                   ` (15 subsequent siblings)
  19 siblings, 1 reply; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Introduces the pci_controller_ops structure.
Add pci_controller_ops.dma_dev_setup, shadowing ppc_md.pci_dma_dev_setup.
Add a shim, and change the callsites to use the shim.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Better commit message
 - Use phb in favour of hose
 - Make shim name match ppc_md name, not pci_controller_ops name.
---
 arch/powerpc/include/asm/pci-bridge.h | 21 +++++++++++++++++++++
 arch/powerpc/kernel/pci-common.c      |  3 +--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 546d036..347d49d 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -15,6 +15,13 @@
 struct device_node;
 
 /*
+ * PCI controller operations
+ */
+struct pci_controller_ops {
+	void		(*dma_dev_setup)(struct pci_dev *dev);
+};
+
+/*
  * Structure of a PCI controller (host bridge)
  */
 struct pci_controller {
@@ -46,6 +53,7 @@ struct pci_controller {
 	resource_size_t	isa_mem_phys;
 	resource_size_t	isa_mem_size;
 
+	struct pci_controller_ops controller_ops;
 	struct pci_ops *ops;
 	unsigned int __iomem *cfg_addr;
 	void __iomem *cfg_data;
@@ -258,5 +266,18 @@ static inline int pcibios_vaddr_is_ioport(void __iomem *address)
 }
 #endif	/* CONFIG_PCI */
 
+/*
+ * Shims to prefer pci_controller version over ppc_md where available.
+ */
+static inline void pci_dma_dev_setup(struct pci_dev *dev)
+{
+	struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+	if (phb->controller_ops.dma_dev_setup)
+		phb->controller_ops.dma_dev_setup(dev);
+	else if (ppc_md.pci_dma_dev_setup)
+		ppc_md.pci_dma_dev_setup(dev);
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 3d07d81..bce6356 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -969,8 +969,7 @@ static void pcibios_setup_device(struct pci_dev *dev)
 	set_dma_offset(&dev->dev, PCI_DRAM_OFFSET);
 
 	/* Additional platform DMA/iommu setup */
-	if (ppc_md.pci_dma_dev_setup)
-		ppc_md.pci_dma_dev_setup(dev);
+	pci_dma_dev_setup(dev);
 
 	/* Read default IRQs and fixup if necessary */
 	pci_read_irq_line(dev);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 05/19] powerpc: Create pci_controller_ops.dma_bus_setup and shim
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (3 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 06/19] powerpc: Create pci_controller_ops.probe_mode " Daniel Axtens
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Add pci_controller_ops.dma_bus_setup, shadowing ppc_md.pci_dma_bus_setup.
Add a shim, and changes the callsites to use the shim.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Better commit message
 - Use phb in favour of hose
 - Make shim name match ppc_md name, not pci_controller_ops name.
---
 arch/powerpc/include/asm/pci-bridge.h | 11 +++++++++++
 arch/powerpc/kernel/pci-common.c      |  3 +--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 347d49d..44305ac 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -19,6 +19,7 @@ struct device_node;
  */
 struct pci_controller_ops {
 	void		(*dma_dev_setup)(struct pci_dev *dev);
+	void		(*dma_bus_setup)(struct pci_bus *bus);
 };
 
 /*
@@ -279,5 +280,15 @@ static inline void pci_dma_dev_setup(struct pci_dev *dev)
 		ppc_md.pci_dma_dev_setup(dev);
 }
 
+static inline void pci_dma_bus_setup(struct pci_bus *bus)
+{
+	struct pci_controller *phb = pci_bus_to_host(bus);
+
+	if (phb->controller_ops.dma_bus_setup)
+		phb->controller_ops.dma_bus_setup(bus);
+	else if (ppc_md.pci_dma_bus_setup)
+		ppc_md.pci_dma_bus_setup(bus);
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index bce6356..317ed00 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -953,8 +953,7 @@ void pcibios_setup_bus_self(struct pci_bus *bus)
 		ppc_md.pcibios_fixup_bus(bus);
 
 	/* Setup bus DMA mappings */
-	if (ppc_md.pci_dma_bus_setup)
-		ppc_md.pci_dma_bus_setup(bus);
+	pci_dma_bus_setup(bus);
 }
 
 static void pcibios_setup_device(struct pci_dev *dev)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 06/19] powerpc: Create pci_controller_ops.probe_mode and shim
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (4 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 05/19] powerpc: Create pci_controller_ops.dma_bus_setup " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 07/19] powerpc: Create pci_controller_ops.enable_device_hook " Daniel Axtens
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Add pci_controller_ops.probe_mode, shadowing ppc_md.pci_probe_mode.
Add a shim, and changes the callsites to use the shim.

We also need to move the probe mode defines to pci-bridge.h from pci.h.
They are required by the shim in order to return a sensible default.
Previously, the were defined in pci.h, but pci.h includes pci-bridge.h
before the relevant #defines. This means the definitions are absent
if pci.h is included before pci-bridge.h. This occurs in some drivers.
So, move the definitons now, and move them back when we remove the shim.

Anything that wants the defines would have had to include pci.h, and
since pci.h includes pci-bridge.h, nothing will lose access to the
defines.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Better commit message
 - Use phb in favour of hose
 - Make shim name match ppc_md name, not pci_controller_ops name.
---
 arch/powerpc/include/asm/pci-bridge.h | 18 ++++++++++++++++++
 arch/powerpc/include/asm/pci.h        |  5 -----
 arch/powerpc/kernel/pci-common.c      |  4 ++--
 arch/powerpc/kernel/pci-hotplug.c     |  3 +--
 arch/powerpc/kernel/pci_of_scan.c     |  3 +--
 5 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 44305ac..65ffc16 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -12,6 +12,11 @@
 #include <linux/ioport.h>
 #include <asm-generic/pci-bridge.h>
 
+/* Return values for pci_controller_ops.probe_mode function */
+#define PCI_PROBE_NONE		-1	/* Don't look at this bus at all */
+#define PCI_PROBE_NORMAL	0	/* Do normal PCI probing */
+#define PCI_PROBE_DEVTREE	1	/* Instantiate from device tree */
+
 struct device_node;
 
 /*
@@ -20,6 +25,8 @@ struct device_node;
 struct pci_controller_ops {
 	void		(*dma_dev_setup)(struct pci_dev *dev);
 	void		(*dma_bus_setup)(struct pci_bus *bus);
+
+	int		(*probe_mode)(struct pci_bus *);
 };
 
 /*
@@ -290,5 +297,16 @@ static inline void pci_dma_bus_setup(struct pci_bus *bus)
 		ppc_md.pci_dma_bus_setup(bus);
 }
 
+static inline int pci_probe_mode(struct pci_bus *bus)
+{
+	struct pci_controller *phb = pci_bus_to_host(bus);
+
+	if (phb->controller_ops.probe_mode)
+		return phb->controller_ops.probe_mode(bus);
+	if (ppc_md.pci_probe_mode)
+		return ppc_md.pci_probe_mode(bus);
+	return PCI_PROBE_NORMAL;
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 1b0739b..8745067 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -22,11 +22,6 @@
 
 #include <asm-generic/pci-dma-compat.h>
 
-/* Return values for ppc_md.pci_probe_mode function */
-#define PCI_PROBE_NONE		-1	/* Don't look at this bus at all */
-#define PCI_PROBE_NORMAL	0	/* Do normal PCI probing */
-#define PCI_PROBE_DEVTREE	1	/* Instantiate from device tree */
-
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
 
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 317ed00..977859e 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1622,8 +1622,8 @@ void pcibios_scan_phb(struct pci_controller *hose)
 
 	/* Get probe mode and perform scan */
 	mode = PCI_PROBE_NORMAL;
-	if (node && ppc_md.pci_probe_mode)
-		mode = ppc_md.pci_probe_mode(bus);
+	if (node)
+		mode = pci_probe_mode(bus);
 	pr_debug("    probe mode: %d\n", mode);
 	if (mode == PCI_PROBE_DEVTREE)
 		of_scan_bus(node, bus);
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 5b78917..2cc9ccb 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -78,8 +78,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
 	eeh_add_device_tree_early(dn);
 
 	mode = PCI_PROBE_NORMAL;
-	if (ppc_md.pci_probe_mode)
-		mode = ppc_md.pci_probe_mode(bus);
+	mode = pci_probe_mode(bus);
 
 	if (mode == PCI_PROBE_DEVTREE) {
 		/* use ofdt-based probe */
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index e6245e9..25f8c57 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -287,8 +287,7 @@ void of_scan_pci_bridge(struct pci_dev *dev)
 	pr_debug("    bus name: %s\n", bus->name);
 
 	mode = PCI_PROBE_NORMAL;
-	if (ppc_md.pci_probe_mode)
-		mode = ppc_md.pci_probe_mode(bus);
+	mode = pci_probe_mode(bus);
 	pr_debug("    probe mode: %d\n", mode);
 
 	if (mode == PCI_PROBE_DEVTREE)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 07/19] powerpc: Create pci_controller_ops.enable_device_hook and shim
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (5 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 06/19] powerpc: Create pci_controller_ops.probe_mode " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 08/19] powerpc: Create pci_controller_ops.window_alignment " Daniel Axtens
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Add pci_controller_ops.enable_device_hook,
shadowing ppc_md.pcibios_enable_device_hook.
Add a shim, and changes the callsites to use the shim.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Better commit message
 - Use phb in favour of hose
 - Make shim name match ppc_md name, not pci_controller_ops name.
---
 arch/powerpc/include/asm/pci-bridge.h | 15 +++++++++++++++
 arch/powerpc/kernel/pci-common.c      |  5 ++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 65ffc16..ece38e2 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -27,6 +27,10 @@ struct pci_controller_ops {
 	void		(*dma_bus_setup)(struct pci_bus *bus);
 
 	int		(*probe_mode)(struct pci_bus *);
+
+	/* Called when pci_enable_device() is called. Returns true to
+	 * allow assignment/enabling of the device. */
+	bool		(*enable_device_hook)(struct pci_dev *);
 };
 
 /*
@@ -308,5 +312,16 @@ static inline int pci_probe_mode(struct pci_bus *bus)
 	return PCI_PROBE_NORMAL;
 }
 
+static inline bool pcibios_enable_device_hook(struct pci_dev *dev)
+{
+	struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+	if (phb->controller_ops.enable_device_hook)
+		return phb->controller_ops.enable_device_hook(dev);
+	if (ppc_md.pcibios_enable_device_hook)
+		return ppc_md.pcibios_enable_device_hook(dev);
+	return true;
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 977859e..fe8c893 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1448,9 +1448,8 @@ EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus);
 
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
-	if (ppc_md.pcibios_enable_device_hook)
-		if (!ppc_md.pcibios_enable_device_hook(dev))
-			return -EINVAL;
+	if (!pcibios_enable_device_hook(dev))
+		return -EINVAL;
 
 	return pci_enable_resources(dev, mask);
 }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 08/19] powerpc: Create pci_controller_ops.window_alignment and shim
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (6 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 07/19] powerpc: Create pci_controller_ops.enable_device_hook " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 09/19] powerpc: Create pci_controller_ops.reset_secondary_bus " Daniel Axtens
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Add pci_controller_ops.window_alignment,
shadowing ppc_md.pcibios_window_alignment.
Add a shim, and changes the callsites to use the shim.

Here, we use pci_window_alignment, as pcibios_window_alignment is
already taken.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Better commit message
 - Use phb in favour of hose
---
 arch/powerpc/include/asm/pci-bridge.h | 21 +++++++++++++++++++++
 arch/powerpc/kernel/pci-common.c      | 10 +---------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index ece38e2..cc91bc0 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -31,6 +31,9 @@ struct pci_controller_ops {
 	/* Called when pci_enable_device() is called. Returns true to
 	 * allow assignment/enabling of the device. */
 	bool		(*enable_device_hook)(struct pci_dev *);
+
+	/* Called during PCI resource reassignment */
+	resource_size_t (*window_alignment)(struct pci_bus *, unsigned long type);
 };
 
 /*
@@ -323,5 +326,23 @@ static inline bool pcibios_enable_device_hook(struct pci_dev *dev)
 	return true;
 }
 
+static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
+						   unsigned long type)
+{
+	struct pci_controller *phb = pci_bus_to_host(bus);
+
+	if (phb->controller_ops.window_alignment)
+		return phb->controller_ops.window_alignment(bus, type);
+	if (ppc_md.pcibios_window_alignment)
+		return ppc_md.pcibios_window_alignment(bus, type);
+
+	/*
+	 * PCI core will figure out the default
+	 * alignment: 4KiB for I/O and 1MiB for
+	 * memory window.
+	 */
+	return 1;
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index fe8c893..f1512b5 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -109,15 +109,7 @@ void pcibios_free_controller(struct pci_controller *phb)
 resource_size_t pcibios_window_alignment(struct pci_bus *bus,
 					 unsigned long type)
 {
-	if (ppc_md.pcibios_window_alignment)
-		return ppc_md.pcibios_window_alignment(bus, type);
-
-	/*
-	 * PCI core will figure out the default
-	 * alignment: 4KiB for I/O and 1MiB for
-	 * memory window.
-	 */
-	return 1;
+	return pci_window_alignment(bus, type);
 }
 
 void pcibios_reset_secondary_bus(struct pci_dev *dev)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 09/19] powerpc: Create pci_controller_ops.reset_secondary_bus and shim
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (7 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 08/19] powerpc: Create pci_controller_ops.window_alignment " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 10/19] powerpc: dart_iommu: optionally populate controller_ops on init Daniel Axtens
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Add pci_controller_ops.reset_secondary_bus,
shadowing ppc_md.pcibios_reset_secondary_bus.
Add a shim, and changes the callsites to use the shim.

Use pcibios_reset_secondary_bus_shim, as both
pcibios_reset_secondary_bus and pci_reset_secondary_bus
are already taken.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Better commit message
 - Use phb in favour of hose
 - Make shim name namespaced, not the raw pci_controller_ops name.
---
 arch/powerpc/include/asm/pci-bridge.h | 17 +++++++++++++++++
 arch/powerpc/kernel/pci-common.c      |  7 +------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index cc91bc0..d2cba2f 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -34,6 +34,7 @@ struct pci_controller_ops {
 
 	/* Called during PCI resource reassignment */
 	resource_size_t (*window_alignment)(struct pci_bus *, unsigned long type);
+	void		(*reset_secondary_bus)(struct pci_dev *dev);
 };
 
 /*
@@ -344,5 +345,21 @@ static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
 	return 1;
 }
 
+static inline void pcibios_reset_secondary_bus_shim(struct pci_dev *dev)
+{
+	struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+	if (phb->controller_ops.reset_secondary_bus)
+		phb->controller_ops.reset_secondary_bus(dev);
+	else if (ppc_md.pcibios_reset_secondary_bus)
+		ppc_md.pcibios_reset_secondary_bus(dev);
+	else
+		/*
+		 * Fallback to the generic function if no
+		 * platform-specific one is provided
+		 */
+		pci_reset_secondary_bus(dev);
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index f1512b5..8b3616a 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -114,12 +114,7 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
 
 void pcibios_reset_secondary_bus(struct pci_dev *dev)
 {
-	if (ppc_md.pcibios_reset_secondary_bus) {
-		ppc_md.pcibios_reset_secondary_bus(dev);
-		return;
-	}
-
-	pci_reset_secondary_bus(dev);
+	pcibios_reset_secondary_bus_shim(dev);
 }
 
 static resource_size_t pcibios_io_size(const struct pci_controller *hose)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 10/19] powerpc: dart_iommu: optionally populate controller_ops on init
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (8 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 09/19] powerpc: Create pci_controller_ops.reset_secondary_bus " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 11/19] powerpc/powermac: Move controller ops from ppc_md to controller_ops Daniel Axtens
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

If a pci_controller_ops struct is provided to iommu_init_early_dart,
populate that with the DMA setup ops, rather than ppc_md. If NULL is
provided, populate ppc_md as before.

This also patches the call sites for Maple and Power Mac to pass
NULL, so existing behaviour is preserved.

The benefit of making this optional is that it means we don't have
to change dart, Maple and Power Mac over to the controller_ops
system in one fell swoop.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/include/asm/iommu.h        |  3 ++-
 arch/powerpc/platforms/maple/setup.c    |  2 +-
 arch/powerpc/platforms/powermac/setup.c |  2 +-
 arch/powerpc/sysdev/dart_iommu.c        | 16 ++++++++++++----
 4 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index f1ea597..0be7d9e 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -29,6 +29,7 @@
 #include <linux/bitops.h>
 #include <asm/machdep.h>
 #include <asm/types.h>
+#include <asm/pci-bridge.h>
 
 #define IOMMU_PAGE_SHIFT_4K      12
 #define IOMMU_PAGE_SIZE_4K       (ASM_CONST(1) << IOMMU_PAGE_SHIFT_4K)
@@ -169,7 +170,7 @@ extern void iommu_unmap_page(struct iommu_table *tbl, dma_addr_t dma_handle,
 			     struct dma_attrs *attrs);
 
 extern void iommu_init_early_pSeries(void);
-extern void iommu_init_early_dart(void);
+extern void iommu_init_early_dart(struct pci_controller_ops *controller_ops);
 extern void iommu_init_early_pasemi(void);
 
 extern void alloc_dart_table(void);
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 56b85cd..3bf2e03 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -203,7 +203,7 @@ static void __init maple_init_early(void)
 {
 	DBG(" -> maple_init_early\n");
 
-	iommu_init_early_dart();
+	iommu_init_early_dart(NULL);
 
 	DBG(" <- maple_init_early\n");
 }
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index efe172d..71a353c 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -473,7 +473,7 @@ static void __init pmac_init_early(void)
 	udbg_adb_init(!!strstr(boot_command_line, "btextdbg"));
 
 #ifdef CONFIG_PPC64
-	iommu_init_early_dart();
+	iommu_init_early_dart(NULL);
 #endif
 
 	/* SMP Init has to be done early as we need to patch up
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 9e5353f..120e96a 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -369,7 +369,7 @@ static int dart_dma_set_mask(struct device *dev, u64 dma_mask)
 	return 0;
 }
 
-void __init iommu_init_early_dart(void)
+void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
 {
 	struct device_node *dn;
 
@@ -395,15 +395,23 @@ void __init iommu_init_early_dart(void)
 	if (dart_is_u4)
 		ppc_md.dma_set_mask = dart_dma_set_mask;
 
-	ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_dart;
-	ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_dart;
-
+	if (controller_ops) {
+		controller_ops->dma_dev_setup = pci_dma_dev_setup_dart;
+		controller_ops->dma_bus_setup = pci_dma_bus_setup_dart;
+	} else {
+		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_dart;
+		ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_dart;
+	}
 	/* Setup pci_dma ops */
 	set_pci_dma_ops(&dma_iommu_ops);
 	return;
 
  bail:
 	/* If init failed, use direct iommu and null setup functions */
+	if (controller_ops) {
+		controller_ops->dma_dev_setup = NULL;
+		controller_ops->dma_bus_setup = NULL;
+	}
 	ppc_md.pci_dma_dev_setup = NULL;
 	ppc_md.pci_dma_bus_setup = NULL;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 11/19] powerpc/powermac: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (9 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 10/19] powerpc: dart_iommu: optionally populate controller_ops on init Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 12/19] powerpc/pseries: " Daniel Axtens
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the Power Mac platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/platforms/powermac/pci.c   | 17 +++++++++++++++--
 arch/powerpc/platforms/powermac/pmac.h  |  5 +----
 arch/powerpc/platforms/powermac/setup.c |  4 +---
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 9c89fd2..59ab16f 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -27,6 +27,8 @@
 #include <asm/grackle.h>
 #include <asm/ppc-pci.h>
 
+#include "pmac.h"
+
 #undef DEBUG
 
 #ifdef DEBUG
@@ -798,6 +800,7 @@ static int __init pmac_add_bridge(struct device_node *dev)
 		return -ENOMEM;
 	hose->first_busno = bus_range ? bus_range[0] : 0;
 	hose->last_busno = bus_range ? bus_range[1] : 0xff;
+	hose->controller_ops = pmac_pci_controller_ops;
 
 	disp_name = NULL;
 
@@ -942,7 +945,7 @@ void __init pmac_pci_init(void)
 }
 
 #ifdef CONFIG_PPC32
-bool pmac_pci_enable_device_hook(struct pci_dev *dev)
+static bool pmac_pci_enable_device_hook(struct pci_dev *dev)
 {
 	struct device_node* node;
 	int updatecfg = 0;
@@ -1225,7 +1228,7 @@ static void fixup_u4_pcie(struct pci_dev* dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie);
 
 #ifdef CONFIG_PPC64
-int pmac_pci_probe_mode(struct pci_bus *bus)
+static int pmac_pci_probe_mode(struct pci_bus *bus)
 {
 	struct device_node *node = pci_bus_to_OF_node(bus);
 
@@ -1240,3 +1243,13 @@ int pmac_pci_probe_mode(struct pci_bus *bus)
 	return PCI_PROBE_DEVTREE;
 }
 #endif /* CONFIG_PPC64 */
+
+struct pci_controller_ops pmac_pci_controller_ops = {
+#ifdef CONFIG_PPC64
+	.probe_mode		= pmac_pci_probe_mode,
+#endif
+#ifdef CONFIG_PPC32
+	.enable_device_hook	= pmac_pci_enable_device_hook,
+#endif
+};
+
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index b8d5721..e7f8163 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -25,7 +25,6 @@ extern void pmac_pci_init(void);
 extern void pmac_nvram_update(void);
 extern unsigned char pmac_nvram_read_byte(int addr);
 extern void pmac_nvram_write_byte(int addr, unsigned char val);
-extern bool pmac_pci_enable_device_hook(struct pci_dev *dev);
 extern void pmac_pcibios_after_init(void);
 extern int of_show_percpuinfo(struct seq_file *m, int i);
 
@@ -39,8 +38,6 @@ extern void low_cpu_die(void) __attribute__((noreturn));
 extern int pmac_nvram_init(void);
 extern void pmac_pic_init(void);
 
-#ifdef CONFIG_PPC64
-extern int pmac_pci_probe_mode(struct pci_bus *bus);
-#endif
+extern struct pci_controller_ops pmac_pci_controller_ops;
 
 #endif /* __PMAC_H__ */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 71a353c..8dd78f4 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -473,7 +473,7 @@ static void __init pmac_init_early(void)
 	udbg_adb_init(!!strstr(boot_command_line, "btextdbg"));
 
 #ifdef CONFIG_PPC64
-	iommu_init_early_dart(NULL);
+	iommu_init_early_dart(&pmac_pci_controller_ops);
 #endif
 
 	/* SMP Init has to be done early as we need to patch up
@@ -656,12 +656,10 @@ define_machine(powermac) {
 	.feature_call		= pmac_do_feature_call,
 	.progress		= udbg_progress,
 #ifdef CONFIG_PPC64
-	.pci_probe_mode		= pmac_pci_probe_mode,
 	.power_save		= power4_idle,
 	.enable_pmcs		= power4_enable_pmcs,
 #endif /* CONFIG_PPC64 */
 #ifdef CONFIG_PPC32
-	.pcibios_enable_device_hook = pmac_pci_enable_device_hook,
 	.pcibios_after_init	= pmac_pcibios_after_init,
 	.phys_mem_access_prot	= pci_phys_mem_access_prot,
 #endif
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 12/19] powerpc/pseries: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (10 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 11/19] powerpc/powermac: Move controller ops from ppc_md to controller_ops Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-04-02  3:21   ` [PATCH v3 " Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 13/19] powerpc/powernv: " Daniel Axtens
                   ` (7 subsequent siblings)
  19 siblings, 1 reply; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the pSeries platform to use the pci_controller_ops structure,
rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/platforms/pseries/iommu.c   | 9 +++++----
 arch/powerpc/platforms/pseries/pseries.h | 2 ++
 arch/powerpc/platforms/pseries/setup.c   | 6 +++++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 7803a19..61d5a17 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -49,6 +49,7 @@
 #include <asm/mmzone.h>
 #include <asm/plpar_wrappers.h>
 
+#include "pseries.h"
 
 static void tce_invalidate_pSeries_sw(struct iommu_table *tbl,
 				      __be64 *startp, __be64 *endp)
@@ -1307,16 +1308,16 @@ void iommu_init_early_pSeries(void)
 			ppc_md.tce_free	 = tce_free_pSeriesLP;
 		}
 		ppc_md.tce_get   = tce_get_pSeriesLP;
-		ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
+		pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
+		pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
 		ppc_md.dma_set_mask = dma_set_mask_pSeriesLP;
 		ppc_md.dma_get_required_mask = dma_get_required_mask_pSeriesLP;
 	} else {
 		ppc_md.tce_build = tce_build_pSeries;
 		ppc_md.tce_free  = tce_free_pSeries;
 		ppc_md.tce_get   = tce_get_pseries;
-		ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeries;
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeries;
+		pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeries;
+		pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeries;
 	}
 
 
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 1796c54..cd64672 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -65,6 +65,8 @@ extern int dlpar_detach_node(struct device_node *);
 struct pci_host_bridge;
 int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
 
+extern struct pci_controller_ops pseries_pci_controller_ops;
+
 unsigned long pseries_memory_block_size(void);
 
 #endif /* _PSERIES_PSERIES_H */
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 1a5f884..328e318 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -478,6 +478,7 @@ static void __init find_and_init_phbs(void)
 		rtas_setup_phb(phb);
 		pci_process_bridge_OF_ranges(phb, node, 0);
 		isa_bridge_find_early(phb);
+		phb->controller_ops = pseries_pci_controller_ops;
 	}
 
 	of_node_put(root);
@@ -840,6 +841,10 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
 void pSeries_final_fixup(void) { }
 #endif
 
+struct pci_controller_ops pseries_pci_controller_ops = {
+	.probe_mode		= pSeries_pci_probe_mode,
+};
+
 define_machine(pseries) {
 	.name			= "pSeries",
 	.probe			= pSeries_probe,
@@ -848,7 +853,6 @@ define_machine(pseries) {
 	.show_cpuinfo		= pSeries_show_cpuinfo,
 	.log_error		= pSeries_log_error,
 	.pcibios_fixup		= pSeries_final_fixup,
-	.pci_probe_mode		= pSeries_pci_probe_mode,
 	.restart		= rtas_restart,
 	.halt			= rtas_halt,
 	.panic			= rtas_os_term,
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 13/19] powerpc/powernv: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (11 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 12/19] powerpc/pseries: " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 14/19] powerpc/pasemi: " Daniel Axtens
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the PowerNV platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/platforms/powernv/pci-ioda.c   | 7 ++++---
 arch/powerpc/platforms/powernv/pci-p5ioc2.c | 1 +
 arch/powerpc/platforms/powernv/pci.c        | 5 ++++-
 arch/powerpc/platforms/powernv/powernv.h    | 2 ++
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index c18e191..b4e46bf 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1988,6 +1988,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
 		hose->last_busno = 0xff;
 	}
 	hose->private_data = phb;
+	hose->controller_ops = pnv_pci_controller_ops;
 	phb->hub_id = hub_id;
 	phb->opal_id = phb_id;
 	phb->type = ioda_type;
@@ -2104,9 +2105,9 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
 	 * the child P2P bridges) can form individual PE.
 	 */
 	ppc_md.pcibios_fixup = pnv_pci_ioda_fixup;
-	ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook;
-	ppc_md.pcibios_window_alignment = pnv_pci_window_alignment;
-	ppc_md.pcibios_reset_secondary_bus = pnv_pci_reset_secondary_bus;
+	pnv_pci_controller_ops.enable_device_hook = pnv_pci_enable_device_hook;
+	pnv_pci_controller_ops.window_alignment = pnv_pci_window_alignment;
+	pnv_pci_controller_ops.reset_secondary_bus = pnv_pci_reset_secondary_bus;
 	pci_add_flags(PCI_REASSIGN_ALL_RSRC);
 
 	/* Reset IODA tables to a clean state */
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 6ef6d4d..4729ca7 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -133,6 +133,7 @@ static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np, u64 hub_id,
 	phb->hose->first_busno = 0;
 	phb->hose->last_busno = 0xff;
 	phb->hose->private_data = phb;
+	phb->hose->controller_ops = pnv_pci_controller_ops;
 	phb->hub_id = hub_id;
 	phb->opal_id = phb_id;
 	phb->type = PNV_PHB_P5IOC2;
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index c8939ad..63518b3 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -761,7 +761,6 @@ void __init pnv_pci_init(void)
 	pci_devs_phb_init();
 
 	/* Configure IOMMU DMA hooks */
-	ppc_md.pci_dma_dev_setup = pnv_pci_dma_dev_setup;
 	ppc_md.tce_build = pnv_tce_build_vm;
 	ppc_md.tce_free = pnv_tce_free_vm;
 	ppc_md.tce_build_rm = pnv_tce_build_rm;
@@ -777,3 +776,7 @@ void __init pnv_pci_init(void)
 }
 
 machine_subsys_initcall_sync(powernv, tce_iommu_bus_notifier_init);
+
+struct pci_controller_ops pnv_pci_controller_ops = {
+	.dma_dev_setup = pnv_pci_dma_dev_setup,
+};
diff --git a/arch/powerpc/platforms/powernv/powernv.h b/arch/powerpc/platforms/powernv/powernv.h
index 604c48e..826d2c9 100644
--- a/arch/powerpc/platforms/powernv/powernv.h
+++ b/arch/powerpc/platforms/powernv/powernv.h
@@ -29,6 +29,8 @@ static inline u64 pnv_pci_dma_get_required_mask(struct pci_dev *pdev)
 }
 #endif
 
+extern struct pci_controller_ops pnv_pci_controller_ops;
+
 extern u32 pnv_get_supported_cpuidle_states(void);
 
 extern void pnv_lpc_init(void);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 14/19] powerpc/pasemi: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (12 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 13/19] powerpc/powernv: " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 15/19] powerpc/maple: " Daniel Axtens
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the PaSemi platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/platforms/pasemi/iommu.c  | 6 ++++--
 arch/powerpc/platforms/pasemi/pasemi.h | 1 +
 arch/powerpc/platforms/pasemi/pci.c    | 5 +++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
index 2e576f2..b8f567b 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -27,6 +27,8 @@
 #include <asm/machdep.h>
 #include <asm/firmware.h>
 
+#include "pasemi.h"
+
 #define IOBMAP_PAGE_SHIFT	12
 #define IOBMAP_PAGE_SIZE	(1 << IOBMAP_PAGE_SHIFT)
 #define IOBMAP_PAGE_MASK	(IOBMAP_PAGE_SIZE - 1)
@@ -248,8 +250,8 @@ void __init iommu_init_early_pasemi(void)
 
 	iob_init(NULL);
 
-	ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pasemi;
-	ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pasemi;
+	pasemi_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pasemi;
+	pasemi_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pasemi;
 	ppc_md.tce_build = iobmap_build;
 	ppc_md.tce_free  = iobmap_free;
 	set_pci_dma_ops(&dma_iommu_ops);
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
index ea65bf0..11f230a 100644
--- a/arch/powerpc/platforms/pasemi/pasemi.h
+++ b/arch/powerpc/platforms/pasemi/pasemi.h
@@ -30,5 +30,6 @@ static inline void restore_astate(int cpu)
 }
 #endif
 
+extern struct pci_controller_ops pasemi_pci_controller_ops;
 
 #endif /* _PASEMI_PASEMI_H */
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index aa86271..f3a68a0 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -31,6 +31,8 @@
 
 #include <asm/ppc-pci.h>
 
+#include "pasemi.h"
+
 #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
 
 static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
@@ -199,6 +201,7 @@ static int __init pas_add_bridge(struct device_node *dev)
 
 	hose->first_busno = 0;
 	hose->last_busno = 0xff;
+	hose->controller_ops = pasemi_pci_controller_ops;
 
 	setup_pa_pxp(hose);
 
@@ -239,3 +242,5 @@ void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
 
 	return (void __iomem *)pa_pxp_cfg_addr(hose, dev->bus->number, dev->devfn, offset);
 }
+
+struct pci_controller_ops pasemi_pci_controller_ops;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 15/19] powerpc/maple: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (13 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 14/19] powerpc/pasemi: " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 16/19] powerpc: fsl_pci, swiotlb: " Daniel Axtens
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the Maple platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/platforms/maple/maple.h | 2 ++
 arch/powerpc/platforms/maple/pci.c   | 4 ++++
 arch/powerpc/platforms/maple/setup.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/maple/maple.h b/arch/powerpc/platforms/maple/maple.h
index c6911dd..eecfa18 100644
--- a/arch/powerpc/platforms/maple/maple.h
+++ b/arch/powerpc/platforms/maple/maple.h
@@ -10,3 +10,5 @@ extern void maple_calibrate_decr(void);
 extern void maple_pci_init(void);
 extern void maple_pci_irq_fixup(struct pci_dev *dev);
 extern int maple_pci_get_legacy_ide_irq(struct pci_dev *dev, int channel);
+
+extern struct pci_controller_ops maple_pci_controller_ops;
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index d3a1306..a923230 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -510,6 +510,7 @@ static int __init maple_add_bridge(struct device_node *dev)
 		return -ENOMEM;
 	hose->first_busno = bus_range ? bus_range[0] : 0;
 	hose->last_busno = bus_range ? bus_range[1] : 0xff;
+	hose->controller_ops = maple_pci_controller_ops;
 
 	disp_name = NULL;
 	if (of_device_is_compatible(dev, "u3-agp")) {
@@ -660,3 +661,6 @@ static void quirk_ipr_msi(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
 			quirk_ipr_msi);
+
+struct pci_controller_ops maple_pci_controller_ops = {
+};
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 3bf2e03..a837188 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -203,7 +203,7 @@ static void __init maple_init_early(void)
 {
 	DBG(" -> maple_init_early\n");
 
-	iommu_init_early_dart(NULL);
+	iommu_init_early_dart(&maple_pci_controller_ops);
 
 	DBG(" <- maple_init_early\n");
 }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 16/19] powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (14 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 15/19] powerpc/maple: " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-04-10  0:11   ` [PATCH v3 " Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 17/19] powerpc/cell: " Daniel Axtens
                   ` (3 subsequent siblings)
  19 siblings, 1 reply; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Moves the setup out of swiotlb's subsys init call, and into an new
structure.

fsl_pci.c is the only thing that checks the ppc_swiotlb_enable global,
so we can be confident that patching it will cover all the PCI
implementations affected by the changes to dma-swiotlb.c.

We do have to make sure we do the changes late in the function, after
setup_pci_atmu, because that can change ppc_swiotlb_enable.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Move the setup call to after setup_pci_atmu().
---
 arch/powerpc/kernel/dma-swiotlb.c | 11 ++++-------
 arch/powerpc/sysdev/fsl_pci.c     | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 7359797..6e8d764 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -116,16 +116,13 @@ void __init swiotlb_detect_4g(void)
 	}
 }
 
-static int __init swiotlb_late_init(void)
+static int __init check_swiotlb_enabled(void)
 {
-	if (ppc_swiotlb_enable) {
+	if (ppc_swiotlb_enable)
 		swiotlb_print_info();
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	} else {
+	else
 		swiotlb_free();
-	}
 
 	return 0;
 }
-subsys_initcall(swiotlb_late_init);
+subsys_initcall(check_swiotlb_enabled);
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4b74c27..b124e17 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -111,6 +111,22 @@ static struct pci_ops fsl_indirect_pcie_ops =
 #define MAX_PHYS_ADDR_BITS	40
 static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS;
 
+#ifdef CONFIG_SWIOTLB
+static struct pci_controller_ops swiotlb_pci_controller_ops = {
+	.dma_dev_setup = pci_dma_dev_setup_swiotlb,
+};
+
+static void setup_swiotlb_ops(struct pci_controller *hose)
+{
+	if (ppc_swiotlb_enable) {
+		hose->controller_ops = swiotlb_pci_controller_ops;
+		set_pci_dma_ops(&swiotlb_dma_ops);
+	}
+}
+#else
+static inline void setup_swiotlb_ops(struct pci_controller *hose) {}
+#endif
+
 static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
 {
 	if (!dev->dma_mask || !dma_supported(dev, dma_mask))
@@ -548,6 +564,9 @@ int fsl_add_bridge(struct platform_device *pdev, int is_primary)
 	/* Setup PEX window registers */
 	setup_pci_atmu(hose);
 
+	/* Set up controller operations */
+	setup_swiotlb_ops(hose);
+
 	return 0;
 
 no_bridge:
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 17/19] powerpc/cell: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (15 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 16/19] powerpc: fsl_pci, swiotlb: " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 18/19] powerpc: Remove shims for pci_controller_ops operations Daniel Axtens
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the Cell platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

This depends on the patch to drop celleb support:
http://patchwork.ozlabs.org/patch/451730/
---
 arch/powerpc/platforms/cell/cell.h  | 24 ++++++++++++++++++++++++
 arch/powerpc/platforms/cell/iommu.c |  7 ++++---
 arch/powerpc/platforms/cell/setup.c |  5 +++++
 3 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 arch/powerpc/platforms/cell/cell.h

diff --git a/arch/powerpc/platforms/cell/cell.h b/arch/powerpc/platforms/cell/cell.h
new file mode 100644
index 0000000..ef143df
--- /dev/null
+++ b/arch/powerpc/platforms/cell/cell.h
@@ -0,0 +1,24 @@
+/*
+ * Cell Platform common data structures
+ *
+ * Copyright 2015, Daniel Axtens, IBM Corporation
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef CELL_H
+#define CELL_H
+
+#include <asm/pci-bridge.h>
+
+extern struct pci_controller_ops cell_pci_controller_ops;
+
+#endif
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 31b1a67..4cb120f 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -39,6 +39,7 @@
 #include <asm/firmware.h>
 #include <asm/cell-regs.h>
 
+#include "cell.h"
 #include "interrupt.h"
 
 /* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages
@@ -857,7 +858,7 @@ static int __init cell_iommu_init_disabled(void)
 	cell_dma_direct_offset += base;
 
 	if (cell_dma_direct_offset != 0)
-		ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
+		cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
 
 	printk("iommu: disabled, direct DMA offset is 0x%lx\n",
 	       cell_dma_direct_offset);
@@ -1197,8 +1198,8 @@ static int __init cell_iommu_init(void)
 		if (cell_iommu_init_disabled() == 0)
 			goto bail;
 
-	/* Setup various ppc_md. callbacks */
-	ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
+	/* Setup various callbacks */
+	cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
 	ppc_md.dma_get_required_mask = cell_dma_get_required_mask;
 	ppc_md.tce_build = tce_build_cell;
 	ppc_md.tce_free = tce_free_cell;
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index d62aa98..d1be268 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -54,6 +54,7 @@
 #include <asm/cell-regs.h>
 #include <asm/io-workarounds.h>
 
+#include "cell.h"
 #include "interrupt.h"
 #include "pervasive.h"
 #include "ras.h"
@@ -131,6 +132,8 @@ static int cell_setup_phb(struct pci_controller *phb)
 	if (model == NULL || strcmp(np->name, "pci"))
 		return 0;
 
+	phb->controller_ops = cell_pci_controller_ops;
+
 	/* Setup workarounds for spider */
 	if (strcmp(model, "Spider"))
 		return 0;
@@ -279,3 +282,5 @@ define_machine(cell) {
 	.init_IRQ       	= cell_init_irq,
 	.pci_setup_phb		= cell_setup_phb,
 };
+
+struct pci_controller_ops cell_pci_controller_ops;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 18/19] powerpc: Remove shims for pci_controller_ops operations
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (16 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 17/19] powerpc/cell: " Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-03-31  5:00 ` [PATCH v2 19/19] powerpc: dart_iommu: Remove check for controller_ops == NULL case Daniel Axtens
  2015-04-07  7:51 ` [PATCH v2 00/19] Refactor PCI controller operations Arnd Bergmann
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Remove shims, patch callsites to use pci_controller_ops
versions instead.

Also move back the probe mode defines, as explained in the patch
for pci_probe_mode.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Squash all the shim removal.
 - Prefer phb to hose.
---
 arch/powerpc/include/asm/machdep.h    | 14 ------
 arch/powerpc/include/asm/pci-bridge.h | 84 -----------------------------------
 arch/powerpc/include/asm/pci.h        |  5 +++
 arch/powerpc/kernel/pci-common.c      | 43 ++++++++++++++----
 arch/powerpc/kernel/pci-hotplug.c     |  6 ++-
 arch/powerpc/kernel/pci_of_scan.c     |  6 ++-
 arch/powerpc/sysdev/dart_iommu.c      |  5 ---
 7 files changed, 50 insertions(+), 113 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 9d4a067..92b085b 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -103,9 +103,6 @@ struct machdep_calls {
 #endif
 #endif /* CONFIG_PPC64 */
 
-	void		(*pci_dma_dev_setup)(struct pci_dev *dev);
-	void		(*pci_dma_bus_setup)(struct pci_bus *bus);
-
 	/* Platform set_dma_mask and dma_get_required_mask overrides */
 	int		(*dma_set_mask)(struct device *dev, u64 dma_mask);
 	u64		(*dma_get_required_mask)(struct device *dev);
@@ -127,7 +124,6 @@ struct machdep_calls {
 	/* PCI stuff */
 	/* Called after scanning the bus, before allocating resources */
 	void		(*pcibios_fixup)(void);
-	int		(*pci_probe_mode)(struct pci_bus *);
 	void		(*pci_irq_fixup)(struct pci_dev *dev);
 	int		(*pcibios_root_bridge_prepare)(struct pci_host_bridge
 				*bridge);
@@ -237,19 +233,9 @@ struct machdep_calls {
 	/* Called for each PCI bus in the system when it's probed */
 	void (*pcibios_fixup_bus)(struct pci_bus *);
 
-	/* Called when pci_enable_device() is called. Returns true to
-	 * allow assignment/enabling of the device. */
-	bool (*pcibios_enable_device_hook)(struct pci_dev *);
-
 	/* Called after scan and before resource survey */
 	void (*pcibios_fixup_phb)(struct pci_controller *hose);
 
-	/* Called during PCI resource reassignment */
-	resource_size_t (*pcibios_window_alignment)(struct pci_bus *, unsigned long type);
-
-	/* Reset the secondary bus of bridge */
-	void  (*pcibios_reset_secondary_bus)(struct pci_dev *dev);
-
 	/* Called to shutdown machine specific hardware not already controlled
 	 * by other drivers.
 	 */
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index d2cba2f..4f39ef9 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -12,11 +12,6 @@
 #include <linux/ioport.h>
 #include <asm-generic/pci-bridge.h>
 
-/* Return values for pci_controller_ops.probe_mode function */
-#define PCI_PROBE_NONE		-1	/* Don't look at this bus at all */
-#define PCI_PROBE_NORMAL	0	/* Do normal PCI probing */
-#define PCI_PROBE_DEVTREE	1	/* Instantiate from device tree */
-
 struct device_node;
 
 /*
@@ -282,84 +277,5 @@ static inline int pcibios_vaddr_is_ioport(void __iomem *address)
 }
 #endif	/* CONFIG_PCI */
 
-/*
- * Shims to prefer pci_controller version over ppc_md where available.
- */
-static inline void pci_dma_dev_setup(struct pci_dev *dev)
-{
-	struct pci_controller *phb = pci_bus_to_host(dev->bus);
-
-	if (phb->controller_ops.dma_dev_setup)
-		phb->controller_ops.dma_dev_setup(dev);
-	else if (ppc_md.pci_dma_dev_setup)
-		ppc_md.pci_dma_dev_setup(dev);
-}
-
-static inline void pci_dma_bus_setup(struct pci_bus *bus)
-{
-	struct pci_controller *phb = pci_bus_to_host(bus);
-
-	if (phb->controller_ops.dma_bus_setup)
-		phb->controller_ops.dma_bus_setup(bus);
-	else if (ppc_md.pci_dma_bus_setup)
-		ppc_md.pci_dma_bus_setup(bus);
-}
-
-static inline int pci_probe_mode(struct pci_bus *bus)
-{
-	struct pci_controller *phb = pci_bus_to_host(bus);
-
-	if (phb->controller_ops.probe_mode)
-		return phb->controller_ops.probe_mode(bus);
-	if (ppc_md.pci_probe_mode)
-		return ppc_md.pci_probe_mode(bus);
-	return PCI_PROBE_NORMAL;
-}
-
-static inline bool pcibios_enable_device_hook(struct pci_dev *dev)
-{
-	struct pci_controller *phb = pci_bus_to_host(dev->bus);
-
-	if (phb->controller_ops.enable_device_hook)
-		return phb->controller_ops.enable_device_hook(dev);
-	if (ppc_md.pcibios_enable_device_hook)
-		return ppc_md.pcibios_enable_device_hook(dev);
-	return true;
-}
-
-static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
-						   unsigned long type)
-{
-	struct pci_controller *phb = pci_bus_to_host(bus);
-
-	if (phb->controller_ops.window_alignment)
-		return phb->controller_ops.window_alignment(bus, type);
-	if (ppc_md.pcibios_window_alignment)
-		return ppc_md.pcibios_window_alignment(bus, type);
-
-	/*
-	 * PCI core will figure out the default
-	 * alignment: 4KiB for I/O and 1MiB for
-	 * memory window.
-	 */
-	return 1;
-}
-
-static inline void pcibios_reset_secondary_bus_shim(struct pci_dev *dev)
-{
-	struct pci_controller *phb = pci_bus_to_host(dev->bus);
-
-	if (phb->controller_ops.reset_secondary_bus)
-		phb->controller_ops.reset_secondary_bus(dev);
-	else if (ppc_md.pcibios_reset_secondary_bus)
-		ppc_md.pcibios_reset_secondary_bus(dev);
-	else
-		/*
-		 * Fallback to the generic function if no
-		 * platform-specific one is provided
-		 */
-		pci_reset_secondary_bus(dev);
-}
-
 #endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 8745067..4aef8d6 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -22,6 +22,11 @@
 
 #include <asm-generic/pci-dma-compat.h>
 
+/* Return values for pci_controller_ops.probe_mode function */
+#define PCI_PROBE_NONE		-1	/* Don't look at this bus at all */
+#define PCI_PROBE_NORMAL	0	/* Do normal PCI probing */
+#define PCI_PROBE_DEVTREE	1	/* Instantiate from device tree */
+
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
 
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 8b3616a..95c717d 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -109,12 +109,29 @@ void pcibios_free_controller(struct pci_controller *phb)
 resource_size_t pcibios_window_alignment(struct pci_bus *bus,
 					 unsigned long type)
 {
-	return pci_window_alignment(bus, type);
+	struct pci_controller *phb = pci_bus_to_host(bus);
+
+	if (phb->controller_ops.window_alignment)
+		return phb->controller_ops.window_alignment(bus, type);
+
+	/*
+	 * PCI core will figure out the default
+	 * alignment: 4KiB for I/O and 1MiB for
+	 * memory window.
+	 */
+	return 1;
 }
 
 void pcibios_reset_secondary_bus(struct pci_dev *dev)
 {
-	pcibios_reset_secondary_bus_shim(dev);
+	struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+	if (phb->controller_ops.reset_secondary_bus) {
+		phb->controller_ops.reset_secondary_bus(dev);
+		return;
+	}
+
+	pci_reset_secondary_bus(dev);
 }
 
 static resource_size_t pcibios_io_size(const struct pci_controller *hose)
@@ -929,6 +946,8 @@ static void pcibios_fixup_bridge(struct pci_bus *bus)
 
 void pcibios_setup_bus_self(struct pci_bus *bus)
 {
+	struct pci_controller *phb;
+
 	/* Fix up the bus resources for P2P bridges */
 	if (bus->self != NULL)
 		pcibios_fixup_bridge(bus);
@@ -940,11 +959,14 @@ void pcibios_setup_bus_self(struct pci_bus *bus)
 		ppc_md.pcibios_fixup_bus(bus);
 
 	/* Setup bus DMA mappings */
-	pci_dma_bus_setup(bus);
+	phb = pci_bus_to_host(bus);
+	if (phb->controller_ops.dma_bus_setup)
+		phb->controller_ops.dma_bus_setup(bus);
 }
 
 static void pcibios_setup_device(struct pci_dev *dev)
 {
+	struct pci_controller *phb;
 	/* Fixup NUMA node as it may not be setup yet by the generic
 	 * code and is needed by the DMA init
 	 */
@@ -955,7 +977,9 @@ static void pcibios_setup_device(struct pci_dev *dev)
 	set_dma_offset(&dev->dev, PCI_DRAM_OFFSET);
 
 	/* Additional platform DMA/iommu setup */
-	pci_dma_dev_setup(dev);
+	phb = pci_bus_to_host(dev->bus);
+	if (phb->controller_ops.dma_dev_setup)
+		phb->controller_ops.dma_dev_setup(dev);
 
 	/* Read default IRQs and fixup if necessary */
 	pci_read_irq_line(dev);
@@ -1435,8 +1459,11 @@ EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus);
 
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
-	if (!pcibios_enable_device_hook(dev))
-		return -EINVAL;
+	struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+	if (phb->controller_ops.enable_device_hook)
+		if (!phb->controller_ops.enable_device_hook(dev))
+			return -EINVAL;
 
 	return pci_enable_resources(dev, mask);
 }
@@ -1608,8 +1635,8 @@ void pcibios_scan_phb(struct pci_controller *hose)
 
 	/* Get probe mode and perform scan */
 	mode = PCI_PROBE_NORMAL;
-	if (node)
-		mode = pci_probe_mode(bus);
+	if (node && hose->controller_ops.probe_mode)
+		mode = hose->controller_ops.probe_mode(bus);
 	pr_debug("    probe mode: %d\n", mode);
 	if (mode == PCI_PROBE_DEVTREE)
 		of_scan_bus(node, bus);
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 2cc9ccb..52b3a5d 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -73,12 +73,16 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
 {
 	int slotno, mode, pass, max;
 	struct pci_dev *dev;
+	struct pci_controller *phb;
 	struct device_node *dn = pci_bus_to_OF_node(bus);
 
 	eeh_add_device_tree_early(dn);
 
+	phb = pci_bus_to_host(bus);
+
 	mode = PCI_PROBE_NORMAL;
-	mode = pci_probe_mode(bus);
+	if (phb->controller_ops.probe_mode)
+		mode = phb->controller_ops.probe_mode(bus);
 
 	if (mode == PCI_PROBE_DEVTREE) {
 		/* use ofdt-based probe */
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 25f8c57..28a41d1 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -207,6 +207,7 @@ void of_scan_pci_bridge(struct pci_dev *dev)
 {
 	struct device_node *node = dev->dev.of_node;
 	struct pci_bus *bus;
+	struct pci_controller *phb;
 	const __be32 *busrange, *ranges;
 	int len, i, mode;
 	struct pci_bus_region region;
@@ -286,8 +287,11 @@ void of_scan_pci_bridge(struct pci_dev *dev)
 		bus->number);
 	pr_debug("    bus name: %s\n", bus->name);
 
+	phb = pci_bus_to_host(bus);
+
 	mode = PCI_PROBE_NORMAL;
-	mode = pci_probe_mode(bus);
+	if (phb->controller_ops.probe_mode)
+		mode = phb->controller_ops.probe_mode(bus);
 	pr_debug("    probe mode: %d\n", mode);
 
 	if (mode == PCI_PROBE_DEVTREE)
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 120e96a..87b8000 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -398,9 +398,6 @@ void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
 	if (controller_ops) {
 		controller_ops->dma_dev_setup = pci_dma_dev_setup_dart;
 		controller_ops->dma_bus_setup = pci_dma_bus_setup_dart;
-	} else {
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_dart;
-		ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_dart;
 	}
 	/* Setup pci_dma ops */
 	set_pci_dma_ops(&dma_iommu_ops);
@@ -412,8 +409,6 @@ void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
 		controller_ops->dma_dev_setup = NULL;
 		controller_ops->dma_bus_setup = NULL;
 	}
-	ppc_md.pci_dma_dev_setup = NULL;
-	ppc_md.pci_dma_bus_setup = NULL;
 
 	/* Setup pci_dma ops */
 	set_pci_dma_ops(&dma_direct_ops);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 19/19] powerpc: dart_iommu: Remove check for controller_ops == NULL case
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (17 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 18/19] powerpc: Remove shims for pci_controller_ops operations Daniel Axtens
@ 2015-03-31  5:00 ` Daniel Axtens
  2015-04-07  7:51 ` [PATCH v2 00/19] Refactor PCI controller operations Arnd Bergmann
  19 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-03-31  5:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Now that we have ported the calls to iommu_init_early_dart to always
supply a pci_controller_ops struct, we can safely drop the check.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/sysdev/dart_iommu.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 87b8000..d00a566 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -395,20 +395,17 @@ void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
 	if (dart_is_u4)
 		ppc_md.dma_set_mask = dart_dma_set_mask;
 
-	if (controller_ops) {
-		controller_ops->dma_dev_setup = pci_dma_dev_setup_dart;
-		controller_ops->dma_bus_setup = pci_dma_bus_setup_dart;
-	}
+	controller_ops->dma_dev_setup = pci_dma_dev_setup_dart;
+	controller_ops->dma_bus_setup = pci_dma_bus_setup_dart;
+
 	/* Setup pci_dma ops */
 	set_pci_dma_ops(&dma_iommu_ops);
 	return;
 
  bail:
 	/* If init failed, use direct iommu and null setup functions */
-	if (controller_ops) {
-		controller_ops->dma_dev_setup = NULL;
-		controller_ops->dma_bus_setup = NULL;
-	}
+	controller_ops->dma_dev_setup = NULL;
+	controller_ops->dma_bus_setup = NULL;
 
 	/* Setup pci_dma ops */
 	set_pci_dma_ops(&dma_direct_ops);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v3 12/19] powerpc/pseries: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 ` [PATCH v2 12/19] powerpc/pseries: " Daniel Axtens
@ 2015-04-02  3:21   ` Daniel Axtens
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-04-02  3:21 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

This moves the pSeries platform to use the pci_controller_ops structure,
rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---
 v2 --> v3: Add a hotplug case in pci_dlpar.c
---
 arch/powerpc/platforms/pseries/iommu.c     | 9 +++++----
 arch/powerpc/platforms/pseries/pci_dlpar.c | 3 +++
 arch/powerpc/platforms/pseries/pseries.h   | 2 ++
 arch/powerpc/platforms/pseries/setup.c     | 6 +++++-
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 7803a19..61d5a17 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -49,6 +49,7 @@
 #include <asm/mmzone.h>
 #include <asm/plpar_wrappers.h>
 
+#include "pseries.h"
 
 static void tce_invalidate_pSeries_sw(struct iommu_table *tbl,
 				      __be64 *startp, __be64 *endp)
@@ -1307,16 +1308,16 @@ void iommu_init_early_pSeries(void)
 			ppc_md.tce_free	 = tce_free_pSeriesLP;
 		}
 		ppc_md.tce_get   = tce_get_pSeriesLP;
-		ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
+		pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
+		pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
 		ppc_md.dma_set_mask = dma_set_mask_pSeriesLP;
 		ppc_md.dma_get_required_mask = dma_get_required_mask_pSeriesLP;
 	} else {
 		ppc_md.tce_build = tce_build_pSeries;
 		ppc_md.tce_free  = tce_free_pSeries;
 		ppc_md.tce_get   = tce_get_pseries;
-		ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeries;
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeries;
+		pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeries;
+		pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeries;
 	}
 
 
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 89e2381..c8c37f9 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -32,6 +32,8 @@
 #include <asm/firmware.h>
 #include <asm/eeh.h>
 
+#include "pseries.h"
+
 static struct pci_bus *
 find_bus_among_children(struct pci_bus *bus,
                         struct device_node *dn)
@@ -75,6 +77,7 @@ struct pci_controller *init_phb_dynamic(struct device_node *dn)
 		return NULL;
 	rtas_setup_phb(phb);
 	pci_process_bridge_OF_ranges(phb, dn, 0);
+	phb->controller_ops = pseries_pci_controller_ops;
 
 	pci_devs_phb_init_dynamic(phb);
 
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 1796c54..cd64672 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -65,6 +65,8 @@ extern int dlpar_detach_node(struct device_node *);
 struct pci_host_bridge;
 int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
 
+extern struct pci_controller_ops pseries_pci_controller_ops;
+
 unsigned long pseries_memory_block_size(void);
 
 #endif /* _PSERIES_PSERIES_H */
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 1a5f884..328e318 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -478,6 +478,7 @@ static void __init find_and_init_phbs(void)
 		rtas_setup_phb(phb);
 		pci_process_bridge_OF_ranges(phb, node, 0);
 		isa_bridge_find_early(phb);
+		phb->controller_ops = pseries_pci_controller_ops;
 	}
 
 	of_node_put(root);
@@ -840,6 +841,10 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
 void pSeries_final_fixup(void) { }
 #endif
 
+struct pci_controller_ops pseries_pci_controller_ops = {
+	.probe_mode		= pSeries_pci_probe_mode,
+};
+
 define_machine(pseries) {
 	.name			= "pSeries",
 	.probe			= pSeries_probe,
@@ -848,7 +853,6 @@ define_machine(pseries) {
 	.show_cpuinfo		= pSeries_show_cpuinfo,
 	.log_error		= pSeries_log_error,
 	.pcibios_fixup		= pSeries_final_fixup,
-	.pci_probe_mode		= pSeries_pci_probe_mode,
 	.restart		= rtas_restart,
 	.halt			= rtas_halt,
 	.panic			= rtas_os_term,
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
  2015-03-31  5:00 ` [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim Daniel Axtens
@ 2015-04-02 14:13     ` Arnd Bergmann
  0 siblings, 0 replies; 35+ messages in thread
From: Arnd Bergmann @ 2015-04-02 14:13 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens, wangyijing, linux-pci

On Tuesday 31 March 2015 16:00:42 Daniel Axtens wrote:
> Introduces the pci_controller_ops structure.
> Add pci_controller_ops.dma_dev_setup, shadowing ppc_md.pci_dma_dev_setup.
> Add a shim, and change the callsites to use the shim.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> 
> ---
> 
> v1 --> v2:
>  - Better commit message
>  - Use phb in favour of hose
>  - Make shim name match ppc_md name, not pci_controller_ops name.
> ---
>  arch/powerpc/include/asm/pci-bridge.h | 21 +++++++++++++++++++++
>  arch/powerpc/kernel/pci-common.c      |  3 +--
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
> index 546d036..347d49d 100644
> --- a/arch/powerpc/include/asm/pci-bridge.h
> +++ b/arch/powerpc/include/asm/pci-bridge.h
> @@ -15,6 +15,13 @@
>  struct device_node;
>  
>  /*
> + * PCI controller operations
> + */
> +struct pci_controller_ops {
> +       void            (*dma_dev_setup)(struct pci_dev *dev);
> +};
> +
> +/*

Please see https://patchwork.ozlabs.org/patch/431333/ for related work.

I think it would be better not to introduce another architecture-specific
pci host bridge operations structure, but instead consolidate into
the one that is already there. We are also adding a generic way to set up
PCI DMA, so it would seems reasonable to hook into that place.

	Arnd

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
@ 2015-04-02 14:13     ` Arnd Bergmann
  0 siblings, 0 replies; 35+ messages in thread
From: Arnd Bergmann @ 2015-04-02 14:13 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: wangyijing, linux-pci, Daniel Axtens

On Tuesday 31 March 2015 16:00:42 Daniel Axtens wrote:
> Introduces the pci_controller_ops structure.
> Add pci_controller_ops.dma_dev_setup, shadowing ppc_md.pci_dma_dev_setup.
> Add a shim, and change the callsites to use the shim.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> 
> ---
> 
> v1 --> v2:
>  - Better commit message
>  - Use phb in favour of hose
>  - Make shim name match ppc_md name, not pci_controller_ops name.
> ---
>  arch/powerpc/include/asm/pci-bridge.h | 21 +++++++++++++++++++++
>  arch/powerpc/kernel/pci-common.c      |  3 +--
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
> index 546d036..347d49d 100644
> --- a/arch/powerpc/include/asm/pci-bridge.h
> +++ b/arch/powerpc/include/asm/pci-bridge.h
> @@ -15,6 +15,13 @@
>  struct device_node;
>  
>  /*
> + * PCI controller operations
> + */
> +struct pci_controller_ops {
> +       void            (*dma_dev_setup)(struct pci_dev *dev);
> +};
> +
> +/*

Please see https://patchwork.ozlabs.org/patch/431333/ for related work.

I think it would be better not to introduce another architecture-specific
pci host bridge operations structure, but instead consolidate into
the one that is already there. We are also adding a generic way to set up
PCI DMA, so it would seems reasonable to hook into that place.

	Arnd

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
  2015-04-02 14:13     ` Arnd Bergmann
@ 2015-04-07  0:31       ` Daniel Axtens
  -1 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-04-07  0:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev, wangyijing, linux-pci

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

> Please see https://patchwork.ozlabs.org/patch/431333/ for related work.
> 
I'm familiar with that patch series - I've been helping Yijing get it up
to speed on PowerPC.


> I think it would be better not to introduce another architecture-specific
> pci host bridge operations structure, but instead consolidate into
> the one that is already there. We are also adding a generic way to set up
> PCI DMA, so it would seems reasonable to hook into that place.
I see what you're getting at, and I agree that we want to move towards
generic operations. 

However, I think this should go in as is at this point, for two main
reasons:

1) This is a good midpoint that makes it easier to move to a generic
structure. Our arch specific stuff is quirky and difficult. This patch
series does a lot to reduce the complexity, and would make it very easy
to move these ops into a generic structure at some future point. 

2) Trying to go generic at this point risks making the change set so
complex and wide ranging that it will really struggle to get in. For
example, Yijing's patch set, despite not changing any of the quirky
stuff in PowerPC, is already quite long, and will require agreement from
a lot of people before it can go in.

Much as I would like to have everything as generic as possible, if we
were to try to do the whole job in one go, it'd become a big, difficult,
messy patch set, and would be less likely to happen than if we were to
do it in two steps.

Regards,
Daniel



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 860 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
@ 2015-04-07  0:31       ` Daniel Axtens
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-04-07  0:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: wangyijing, linux-pci, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

> Please see https://patchwork.ozlabs.org/patch/431333/ for related work.
> 
I'm familiar with that patch series - I've been helping Yijing get it up
to speed on PowerPC.


> I think it would be better not to introduce another architecture-specific
> pci host bridge operations structure, but instead consolidate into
> the one that is already there. We are also adding a generic way to set up
> PCI DMA, so it would seems reasonable to hook into that place.
I see what you're getting at, and I agree that we want to move towards
generic operations. 

However, I think this should go in as is at this point, for two main
reasons:

1) This is a good midpoint that makes it easier to move to a generic
structure. Our arch specific stuff is quirky and difficult. This patch
series does a lot to reduce the complexity, and would make it very easy
to move these ops into a generic structure at some future point. 

2) Trying to go generic at this point risks making the change set so
complex and wide ranging that it will really struggle to get in. For
example, Yijing's patch set, despite not changing any of the quirky
stuff in PowerPC, is already quite long, and will require agreement from
a lot of people before it can go in.

Much as I would like to have everything as generic as possible, if we
were to try to do the whole job in one go, it'd become a big, difficult,
messy patch set, and would be less likely to happen than if we were to
do it in two steps.

Regards,
Daniel



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 860 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
  2015-04-07  0:31       ` Daniel Axtens
@ 2015-04-07  7:44         ` Arnd Bergmann
  -1 siblings, 0 replies; 35+ messages in thread
From: Arnd Bergmann @ 2015-04-07  7:44 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev, wangyijing, linux-pci

On Tuesday 07 April 2015 10:31:36 Daniel Axtens wrote:
> > Please see https://patchwork.ozlabs.org/patch/431333/ for related work.
> > 
> I'm familiar with that patch series - I've been helping Yijing get it up
> to speed on PowerPC.
> 
> 
> > I think it would be better not to introduce another architecture-specific
> > pci host bridge operations structure, but instead consolidate into
> > the one that is already there. We are also adding a generic way to set up
> > PCI DMA, so it would seems reasonable to hook into that place.
> I see what you're getting at, and I agree that we want to move towards
> generic operations. 
> 
> However, I think this should go in as is at this point, for two main
> reasons:
> 
> 1) This is a good midpoint that makes it easier to move to a generic
> structure. Our arch specific stuff is quirky and difficult. This patch
> series does a lot to reduce the complexity, and would make it very easy
> to move these ops into a generic structure at some future point. 
> 
> 2) Trying to go generic at this point risks making the change set so
> complex and wide ranging that it will really struggle to get in. For
> example, Yijing's patch set, despite not changing any of the quirky
> stuff in PowerPC, is already quite long, and will require agreement from
> a lot of people before it can go in.
> 
> Much as I would like to have everything as generic as possible, if we
> were to try to do the whole job in one go, it'd become a big, difficult,
> messy patch set, and would be less likely to happen than if we were to
> do it in two steps.

Ok, fair enough. Let's do this one first then.

	Arnd

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
@ 2015-04-07  7:44         ` Arnd Bergmann
  0 siblings, 0 replies; 35+ messages in thread
From: Arnd Bergmann @ 2015-04-07  7:44 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: wangyijing, linux-pci, linuxppc-dev

On Tuesday 07 April 2015 10:31:36 Daniel Axtens wrote:
> > Please see https://patchwork.ozlabs.org/patch/431333/ for related work.
> > 
> I'm familiar with that patch series - I've been helping Yijing get it up
> to speed on PowerPC.
> 
> 
> > I think it would be better not to introduce another architecture-specific
> > pci host bridge operations structure, but instead consolidate into
> > the one that is already there. We are also adding a generic way to set up
> > PCI DMA, so it would seems reasonable to hook into that place.
> I see what you're getting at, and I agree that we want to move towards
> generic operations. 
> 
> However, I think this should go in as is at this point, for two main
> reasons:
> 
> 1) This is a good midpoint that makes it easier to move to a generic
> structure. Our arch specific stuff is quirky and difficult. This patch
> series does a lot to reduce the complexity, and would make it very easy
> to move these ops into a generic structure at some future point. 
> 
> 2) Trying to go generic at this point risks making the change set so
> complex and wide ranging that it will really struggle to get in. For
> example, Yijing's patch set, despite not changing any of the quirky
> stuff in PowerPC, is already quite long, and will require agreement from
> a lot of people before it can go in.
> 
> Much as I would like to have everything as generic as possible, if we
> were to try to do the whole job in one go, it'd become a big, difficult,
> messy patch set, and would be less likely to happen than if we were to
> do it in two steps.

Ok, fair enough. Let's do this one first then.

	Arnd

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 00/19] Refactor PCI controller operations
  2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
                   ` (18 preceding siblings ...)
  2015-03-31  5:00 ` [PATCH v2 19/19] powerpc: dart_iommu: Remove check for controller_ops == NULL case Daniel Axtens
@ 2015-04-07  7:51 ` Arnd Bergmann
  19 siblings, 0 replies; 35+ messages in thread
From: Arnd Bergmann @ 2015-04-07  7:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

On Tuesday 31 March 2015 16:00:38 Daniel Axtens wrote:
> This patch set moves some PCI controller operations out of ppc_md and
> into a new pci_controller_ops struct.
> 
> This is desirable for systems with more than one type of PCI
> controller. In particular, it's intended that this new interface will
> be used by the CXL (aka CAPI) driver.
> 
> The design tries to balance a desire to avoid having yet another
> abstraction layer with a desire to make it easy for vendor kernels to
> pull in as little or as much as they are comfortable with.

I looked over the whole series again now, and with my previous concern
withdrawn, everything looks good to me. Nice work!

	Arnd

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
  2015-04-07  7:44         ` Arnd Bergmann
@ 2015-04-08  3:31           ` Michael Ellerman
  -1 siblings, 0 replies; 35+ messages in thread
From: Michael Ellerman @ 2015-04-08  3:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Daniel Axtens, wangyijing, linux-pci, linuxppc-dev

On Tue, 2015-04-07 at 09:44 +0200, Arnd Bergmann wrote:
> On Tuesday 07 April 2015 10:31:36 Daniel Axtens wrote:
> > > Please see https://patchwork.ozlabs.org/patch/431333/ for related work.
> > > 
> > I'm familiar with that patch series - I've been helping Yijing get it up
> > to speed on PowerPC.
> > 
> > 
> > > I think it would be better not to introduce another architecture-specific
> > > pci host bridge operations structure, but instead consolidate into
> > > the one that is already there. We are also adding a generic way to set up
> > > PCI DMA, so it would seems reasonable to hook into that place.
> > I see what you're getting at, and I agree that we want to move towards
> > generic operations. 
> > 
> > However, I think this should go in as is at this point, for two main
> > reasons:
> > 
> > 1) This is a good midpoint that makes it easier to move to a generic
> > structure. Our arch specific stuff is quirky and difficult. This patch
> > series does a lot to reduce the complexity, and would make it very easy
> > to move these ops into a generic structure at some future point. 
> > 
> > 2) Trying to go generic at this point risks making the change set so
> > complex and wide ranging that it will really struggle to get in. For
> > example, Yijing's patch set, despite not changing any of the quirky
> > stuff in PowerPC, is already quite long, and will require agreement from
> > a lot of people before it can go in.
> > 
> > Much as I would like to have everything as generic as possible, if we
> > were to try to do the whole job in one go, it'd become a big, difficult,
> > messy patch set, and would be less likely to happen than if we were to
> > do it in two steps.
> 
> Ok, fair enough. Let's do this one first then.

Thanks Arnd.

cheers



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim
@ 2015-04-08  3:31           ` Michael Ellerman
  0 siblings, 0 replies; 35+ messages in thread
From: Michael Ellerman @ 2015-04-08  3:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: wangyijing, linux-pci, linuxppc-dev, Daniel Axtens

On Tue, 2015-04-07 at 09:44 +0200, Arnd Bergmann wrote:
> On Tuesday 07 April 2015 10:31:36 Daniel Axtens wrote:
> > > Please see https://patchwork.ozlabs.org/patch/431333/ for related work.
> > > 
> > I'm familiar with that patch series - I've been helping Yijing get it up
> > to speed on PowerPC.
> > 
> > 
> > > I think it would be better not to introduce another architecture-specific
> > > pci host bridge operations structure, but instead consolidate into
> > > the one that is already there. We are also adding a generic way to set up
> > > PCI DMA, so it would seems reasonable to hook into that place.
> > I see what you're getting at, and I agree that we want to move towards
> > generic operations. 
> > 
> > However, I think this should go in as is at this point, for two main
> > reasons:
> > 
> > 1) This is a good midpoint that makes it easier to move to a generic
> > structure. Our arch specific stuff is quirky and difficult. This patch
> > series does a lot to reduce the complexity, and would make it very easy
> > to move these ops into a generic structure at some future point. 
> > 
> > 2) Trying to go generic at this point risks making the change set so
> > complex and wide ranging that it will really struggle to get in. For
> > example, Yijing's patch set, despite not changing any of the quirky
> > stuff in PowerPC, is already quite long, and will require agreement from
> > a lot of people before it can go in.
> > 
> > Much as I would like to have everything as generic as possible, if we
> > were to try to do the whole job in one go, it'd become a big, difficult,
> > messy patch set, and would be less likely to happen than if we were to
> > do it in two steps.
> 
> Ok, fair enough. Let's do this one first then.

Thanks Arnd.

cheers

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH v3 16/19] powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
  2015-03-31  5:00 ` [PATCH v2 16/19] powerpc: fsl_pci, swiotlb: " Daniel Axtens
@ 2015-04-10  0:11   ` Daniel Axtens
  2015-04-10  1:28     ` Scott Wood
  2015-04-10  3:15     ` [PATCH v4 " Daniel Axtens
  0 siblings, 2 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-04-10  0:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

Moves the setup out of swiotlb's subsys init call, and into an new
structure.

fsl_pci.c is the only thing that checks the ppc_swiotlb_enable global,
so we can be confident that patching it will cover all the PCI
implementations affected by the changes to dma-swiotlb.c.

We do have to make sure we do the changes late in the function, after
setup_pci_atmu, because that can change ppc_swiotlb_enable.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Move the setup call to after setup_pci_atmu().

v2 --> v3:
 - Only set the affected op, not the entire structure. Thanks mpe.
---
 arch/powerpc/kernel/dma-swiotlb.c | 11 ++++-------
 arch/powerpc/sysdev/fsl_pci.c     | 15 +++++++++++++++
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 7359797..6e8d764 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -116,16 +116,13 @@ void __init swiotlb_detect_4g(void)
 	}
 }
 
-static int __init swiotlb_late_init(void)
+static int __init check_swiotlb_enabled(void)
 {
-	if (ppc_swiotlb_enable) {
+	if (ppc_swiotlb_enable)
 		swiotlb_print_info();
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	} else {
+	else
 		swiotlb_free();
-	}
 
 	return 0;
 }
-subsys_initcall(swiotlb_late_init);
+subsys_initcall(check_swiotlb_enabled);
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4b74c27..9a8fcf0 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -111,6 +111,18 @@ static struct pci_ops fsl_indirect_pcie_ops =
 #define MAX_PHYS_ADDR_BITS	40
 static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS;
 
+#ifdef CONFIG_SWIOTLB
+static void setup_swiotlb_ops(struct pci_controller *hose)
+{
+	if (ppc_swiotlb_enable) {
+		hose->controller_ops.dma_dev_setup = pci_dma_dev_setup_swiotlb;
+		set_pci_dma_ops(&swiotlb_dma_ops);
+	}
+}
+#else
+static inline void setup_swiotlb_ops(struct pci_controller *hose) {}
+#endif
+
 static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
 {
 	if (!dev->dma_mask || !dma_supported(dev, dma_mask))
@@ -548,6 +560,9 @@ int fsl_add_bridge(struct platform_device *pdev, int is_primary)
 	/* Setup PEX window registers */
 	setup_pci_atmu(hose);
 
+	/* Set up controller operations */
+	setup_swiotlb_ops(hose);
+
 	return 0;
 
 no_bridge:
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH v3 16/19] powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
  2015-04-10  0:11   ` [PATCH v3 " Daniel Axtens
@ 2015-04-10  1:28     ` Scott Wood
  2015-04-10  2:36       ` Daniel Axtens
  2015-04-10  3:15     ` [PATCH v4 " Daniel Axtens
  1 sibling, 1 reply; 35+ messages in thread
From: Scott Wood @ 2015-04-10  1:28 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev

On Fri, 2015-04-10 at 10:11 +1000, Daniel Axtens wrote:
> Moves the setup out of swiotlb's subsys init call, and into an new
> structure.

"a new"

> fsl_pci.c is the only thing that checks the ppc_swiotlb_enable global,
> so we can be confident that patching it will cover all the PCI
> implementations affected by the changes to dma-swiotlb.c.

Do you mean the only thing that sets ppc_swiotlb_enable (fsl_pci.c
doesn't check it)?  It's also set by swiotlb_detect_4g().

Where is the rest of this patchset?  What is the problem being solved?

-Scott

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v3 16/19] powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
  2015-04-10  1:28     ` Scott Wood
@ 2015-04-10  2:36       ` Daniel Axtens
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Axtens @ 2015-04-10  2:36 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]

Hi Scott,

This is part of the larger set to move controller ops into a generic
structure. The original cover letter is at
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-March/126837.html

The commit message should have been reworded when I sent out version 2.
Apologies. Here's a more accurate summary, which will appear in v4.

powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to
controller_ops

Move the installation of DMA operations out of swiotlb's subsys
initcall, and into the generic PCI controller operations struct.

These ops are installed conditionally, based on the ppc_swiotlb_enable
global. The global can be set in two places:
 - swiotlb_detect_4g, which is always called at the arch initcall level
 - setup_pci_atmu, which is called as part of the fsl_add_bridge and
fsl_pci_syscore_do_resume. fsl_pci_syscore_do_resume is called late
enough that any changes as a result of that call will have no effect.

As such, if we test the global and set the operations as part of
fsl_add_bridge, after the call to setup_pci_atmu, we can be confident
that it will cover all the PCI implementations affected by the changes
to dma-swiotlb.c.

Regards,
Daniel

On Thu, 2015-04-09 at 20:28 -0500, Scott Wood wrote:
> On Fri, 2015-04-10 at 10:11 +1000, Daniel Axtens wrote:
> > Moves the setup out of swiotlb's subsys init call, and into an new
> > structure.
> 
> "a new"
> 
> > fsl_pci.c is the only thing that checks the ppc_swiotlb_enable global,
> > so we can be confident that patching it will cover all the PCI
> > implementations affected by the changes to dma-swiotlb.c.
> 
> Do you mean the only thing that sets ppc_swiotlb_enable (fsl_pci.c
> doesn't check it)?  It's also set by swiotlb_detect_4g().
> 
> Where is the rest of this patchset?  What is the problem being solved?
> 
> -Scott
> 
> 


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 860 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH v4 16/19] powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
  2015-04-10  0:11   ` [PATCH v3 " Daniel Axtens
  2015-04-10  1:28     ` Scott Wood
@ 2015-04-10  3:15     ` Daniel Axtens
  2015-04-10  3:18       ` Scott Wood
  1 sibling, 1 reply; 35+ messages in thread
From: Daniel Axtens @ 2015-04-10  3:15 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Scott Wood, Daniel Axtens

Move the installation of DMA operations out of swiotlb's subsys
initcall, and into the generic PCI controller operations struct.

These ops are installed conditionally, based on the ppc_swiotlb_enable
global. The global can be set in two places:
 - swiotlb_detect_4g, which is always called at the arch initcall level
 - setup_pci_atmu, which is called as part of the fsl_add_bridge and
fsl_pci_syscore_do_resume.

fsl_pci_syscore_do_resume is called late enough that any changes as a
result of that call will have no effect.

As such, if we test the global and set the operations as part of
fsl_add_bridge, after the call to setup_pci_atmu, we can be confident
that it will cover all the PCI implementations affected by the changes
to dma-swiotlb.c.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

v1 --> v2:
 - Move the setup call to after setup_pci_atmu().

v2 --> v3:
 - Only set the affected op, not the entire structure. Thanks mpe.

v3 --> v4:
 - Improved commit message, thanks Scott Wood.
---
 arch/powerpc/kernel/dma-swiotlb.c | 11 ++++-------
 arch/powerpc/sysdev/fsl_pci.c     | 15 +++++++++++++++
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 7359797..6e8d764 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -116,16 +116,13 @@ void __init swiotlb_detect_4g(void)
 	}
 }
 
-static int __init swiotlb_late_init(void)
+static int __init check_swiotlb_enabled(void)
 {
-	if (ppc_swiotlb_enable) {
+	if (ppc_swiotlb_enable)
 		swiotlb_print_info();
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	} else {
+	else
 		swiotlb_free();
-	}
 
 	return 0;
 }
-subsys_initcall(swiotlb_late_init);
+subsys_initcall(check_swiotlb_enabled);
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4b74c27..9a8fcf0 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -111,6 +111,18 @@ static struct pci_ops fsl_indirect_pcie_ops =
 #define MAX_PHYS_ADDR_BITS	40
 static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS;
 
+#ifdef CONFIG_SWIOTLB
+static void setup_swiotlb_ops(struct pci_controller *hose)
+{
+	if (ppc_swiotlb_enable) {
+		hose->controller_ops.dma_dev_setup = pci_dma_dev_setup_swiotlb;
+		set_pci_dma_ops(&swiotlb_dma_ops);
+	}
+}
+#else
+static inline void setup_swiotlb_ops(struct pci_controller *hose) {}
+#endif
+
 static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
 {
 	if (!dev->dma_mask || !dma_supported(dev, dma_mask))
@@ -548,6 +560,9 @@ int fsl_add_bridge(struct platform_device *pdev, int is_primary)
 	/* Setup PEX window registers */
 	setup_pci_atmu(hose);
 
+	/* Set up controller operations */
+	setup_swiotlb_ops(hose);
+
 	return 0;
 
 no_bridge:
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 16/19] powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
  2015-04-10  3:15     ` [PATCH v4 " Daniel Axtens
@ 2015-04-10  3:18       ` Scott Wood
  0 siblings, 0 replies; 35+ messages in thread
From: Scott Wood @ 2015-04-10  3:18 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev

On Fri, 2015-04-10 at 13:15 +1000, Daniel Axtens wrote:
> Move the installation of DMA operations out of swiotlb's subsys
> initcall, and into the generic PCI controller operations struct.
> 
> These ops are installed conditionally, based on the ppc_swiotlb_enable
> global. The global can be set in two places:
>  - swiotlb_detect_4g, which is always called at the arch initcall level
>  - setup_pci_atmu, which is called as part of the fsl_add_bridge and
> fsl_pci_syscore_do_resume.
> 
> fsl_pci_syscore_do_resume is called late enough that any changes as a
> result of that call will have no effect.
> 
> As such, if we test the global and set the operations as part of
> fsl_add_bridge, after the call to setup_pci_atmu, we can be confident
> that it will cover all the PCI implementations affected by the changes
> to dma-swiotlb.c.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> 
> ---
> 
> v1 --> v2:
>  - Move the setup call to after setup_pci_atmu().
> 
> v2 --> v3:
>  - Only set the affected op, not the entire structure. Thanks mpe.
> 
> v3 --> v4:
>  - Improved commit message, thanks Scott Wood.
> ---
>  arch/powerpc/kernel/dma-swiotlb.c | 11 ++++-------
>  arch/powerpc/sysdev/fsl_pci.c     | 15 +++++++++++++++
>  2 files changed, 19 insertions(+), 7 deletions(-)

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2015-04-10  3:18 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31  5:00 [PATCH v2 00/19] Refactor PCI controller operations Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 01/19] powerpc: move find_and_init_phbs() to pSeries specific code Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 02/19] powerpc/powermac: move pmac_pci_probe_mode from setup.c to pci.c Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 03/19] powerpc: pcibios_enable_device_hook: return bool rather than int Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 04/19] powerpc: Create pci_controller_ops.dma_dev_setup and shim Daniel Axtens
2015-04-02 14:13   ` Arnd Bergmann
2015-04-02 14:13     ` Arnd Bergmann
2015-04-07  0:31     ` Daniel Axtens
2015-04-07  0:31       ` Daniel Axtens
2015-04-07  7:44       ` Arnd Bergmann
2015-04-07  7:44         ` Arnd Bergmann
2015-04-08  3:31         ` Michael Ellerman
2015-04-08  3:31           ` Michael Ellerman
2015-03-31  5:00 ` [PATCH v2 05/19] powerpc: Create pci_controller_ops.dma_bus_setup " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 06/19] powerpc: Create pci_controller_ops.probe_mode " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 07/19] powerpc: Create pci_controller_ops.enable_device_hook " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 08/19] powerpc: Create pci_controller_ops.window_alignment " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 09/19] powerpc: Create pci_controller_ops.reset_secondary_bus " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 10/19] powerpc: dart_iommu: optionally populate controller_ops on init Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 11/19] powerpc/powermac: Move controller ops from ppc_md to controller_ops Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 12/19] powerpc/pseries: " Daniel Axtens
2015-04-02  3:21   ` [PATCH v3 " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 13/19] powerpc/powernv: " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 14/19] powerpc/pasemi: " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 15/19] powerpc/maple: " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 16/19] powerpc: fsl_pci, swiotlb: " Daniel Axtens
2015-04-10  0:11   ` [PATCH v3 " Daniel Axtens
2015-04-10  1:28     ` Scott Wood
2015-04-10  2:36       ` Daniel Axtens
2015-04-10  3:15     ` [PATCH v4 " Daniel Axtens
2015-04-10  3:18       ` Scott Wood
2015-03-31  5:00 ` [PATCH v2 17/19] powerpc/cell: " Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 18/19] powerpc: Remove shims for pci_controller_ops operations Daniel Axtens
2015-03-31  5:00 ` [PATCH v2 19/19] powerpc: dart_iommu: Remove check for controller_ops == NULL case Daniel Axtens
2015-04-07  7:51 ` [PATCH v2 00/19] Refactor PCI controller operations Arnd Bergmann

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.