Skip to contentSkip to conversation

powerpc: populate the default bus with machine_arch_initcall

PATCH In review Kevin Hao 6 participants 9 messages Aug 11, 2016 – Aug 14, 2016 4 messages not in the archive

Subsystems (6)
lore
Share & tools
lore

Kevin Hao

author
#0 lore raw

PATCH 1/1 powerpc: populate the default bus with machine_arch_initcall

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. This will override the arch specific population of default bus which run at a lower level than arch_initcall_sync. Since not all powerpc specific buses are added to the of_default_bus_match_table[], this causes some powerpc specific bus are not probed. Fix this by using a more preceding initcall.

---
Of course we can adjust the powerpc arch codes to use the of_platform_default_populate_init(), but it has high risk to break other boards given the complicated powerpc specific buses. So I would like just to fix the broken boards in the current release, and cook a patch to change to of_platform_default_populate_init() for linux-next.

Only boot test on a mpc8315erdb board.

 arch/powerpc/platforms/40x/ep405.c               | 2 +-
 arch/powerpc/platforms/40x/ppc40x_simple.c       | 2 +-
 arch/powerpc/platforms/40x/virtex.c              | 2 +-
 arch/powerpc/platforms/40x/walnut.c              | 2 +-
 arch/powerpc/platforms/44x/canyonlands.c         | 2 +-
 arch/powerpc/platforms/44x/ebony.c               | 2 +-
 arch/powerpc/platforms/44x/iss4xx.c              | 2 +-
 arch/powerpc/platforms/44x/ppc44x_simple.c       | 2 +-
 arch/powerpc/platforms/44x/ppc476.c              | 2 +-
 arch/powerpc/platforms/44x/sam440ep.c            | 2 +-
 arch/powerpc/platforms/44x/virtex.c              | 2 +-
 arch/powerpc/platforms/44x/warp.c                | 2 +-
 arch/powerpc/platforms/82xx/ep8248e.c            | 2 +-
 arch/powerpc/platforms/82xx/km82xx.c             | 2 +-
 arch/powerpc/platforms/82xx/mpc8272_ads.c        | 2 +-
 arch/powerpc/platforms/82xx/pq2fads.c            | 2 +-
 arch/powerpc/platforms/83xx/mpc831x_rdb.c        | 2 +-
 arch/powerpc/platforms/83xx/mpc834x_itx.c        | 2 +-
 arch/powerpc/platforms/85xx/ppa8548.c            | 2 +-
 arch/powerpc/platforms/8xx/adder875.c            | 2 +-
 arch/powerpc/platforms/8xx/ep88xc.c              | 2 +-
 arch/powerpc/platforms/8xx/mpc86xads_setup.c     | 2 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c     | 2 +-
 arch/powerpc/platforms/8xx/tqm8xx_setup.c        | 2 +-
 arch/powerpc/platforms/cell/setup.c              | 2 +-
 arch/powerpc/platforms/embedded6xx/gamecube.c    | 2 +-
 arch/powerpc/platforms/embedded6xx/linkstation.c | 2 +-
 arch/powerpc/platforms/embedded6xx/mvme5100.c    | 2 +-
 arch/powerpc/platforms/embedded6xx/storcenter.c  | 2 +-
 arch/powerpc/platforms/embedded6xx/wii.c         | 2 +-
 arch/powerpc/platforms/pasemi/setup.c            | 2 +-
 31 files changed, 31 insertions(+), 31 deletions(-)
arch/powerpc/platforms/40x/ep405.c +1 -1
index 1c8aec6e9bb7..1328cb38e5d7 100644
@@ -62,7 +62,7 @@ static int __init ep405_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(ep405, ep405_device_probe);
+machine_arch_initcall(ep405, ep405_device_probe);
 
 static void __init ep405_init_bcsr(void)
 {
arch/powerpc/platforms/40x/ppc40x_simple.c +1 -1
index 2a050007bbae..50dce54e6b3b 100644
@@ -39,7 +39,7 @@ static int __init ppc40x_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
+machine_arch_initcall(ppc40x_simple, ppc40x_device_probe);
 
 /* This is the list of boards that can be supported by this simple
  * platform code.  This does _not_ mean the boards are compatible,
arch/powerpc/platforms/40x/virtex.c +1 -1
index 91a08ea758a8..d262696b3cbc 100644
@@ -33,7 +33,7 @@ static int __init virtex_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(virtex, virtex_device_probe);
+machine_arch_initcall(virtex, virtex_device_probe);
 
 static int __init virtex_probe(void)
 {
arch/powerpc/platforms/40x/walnut.c +1 -1
index e5797815e2f1..9a9c0bccba47 100644
@@ -42,7 +42,7 @@ static int __init walnut_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(walnut, walnut_device_probe);
+machine_arch_initcall(walnut, walnut_device_probe);
 
 static int __init walnut_probe(void)
 {
arch/powerpc/platforms/44x/canyonlands.c +1 -1
index 157f4ce46386..681fa66ff194 100644
@@ -47,7 +47,7 @@ static int __init ppc460ex_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(canyonlands, ppc460ex_device_probe);
+machine_arch_initcall(canyonlands, ppc460ex_device_probe);
 
 /* Using this code only for the Canyonlands board.  */
 
arch/powerpc/platforms/44x/ebony.c +1 -1
index 1070225f5f9b..fa3838fd67bc 100644
@@ -42,7 +42,7 @@ static int __init ebony_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(ebony, ebony_device_probe);
+machine_arch_initcall(ebony, ebony_device_probe);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
arch/powerpc/platforms/44x/iss4xx.c +1 -1
index 5f296dd6b1c0..39cea8e5a6ab 100644
@@ -47,7 +47,7 @@ static int __init iss4xx_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(iss4xx, iss4xx_device_probe);
+machine_arch_initcall(iss4xx, iss4xx_device_probe);
 
 /* We can have either UICs or MPICs */
 static void __init iss4xx_init_irq(void)
arch/powerpc/platforms/44x/ppc44x_simple.c +1 -1
index 8d6e4da9dfbe..5ea921ae080b 100644
@@ -38,7 +38,7 @@ static int __init ppc44x_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(ppc44x_simple, ppc44x_device_probe);
+machine_arch_initcall(ppc44x_simple, ppc44x_device_probe);
 
 /* This is the list of boards that can be supported by this simple
  * platform code.  This does _not_ mean the boards are compatible,
arch/powerpc/platforms/44x/ppc476.c +1 -1
index e55933f9cd55..d19ba31aa442 100644
@@ -118,7 +118,7 @@ static int __init ppc47x_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(ppc47x, ppc47x_device_probe);
+machine_arch_initcall(ppc47x, ppc47x_device_probe);
 
 static void __init ppc47x_init_irq(void)
 {
arch/powerpc/platforms/44x/sam440ep.c +1 -1
index 688ffeab0699..13014efb1abb 100644
@@ -42,7 +42,7 @@ static int __init sam440ep_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(sam440ep, sam440ep_device_probe);
+machine_arch_initcall(sam440ep, sam440ep_device_probe);
 
 static int __init sam440ep_probe(void)
 {
arch/powerpc/platforms/44x/virtex.c +1 -1
index a7e08026097a..cbd8d73ae5ba 100644
@@ -39,7 +39,7 @@ static int __init virtex_device_probe(void)
 
 	return 0;
 }
-machine_device_initcall(virtex, virtex_device_probe);
+machine_arch_initcall(virtex, virtex_device_probe);
 
 static int __init virtex_probe(void)
 {
arch/powerpc/platforms/44x/warp.c +1 -1
index 5ecce543103e..3ea5a5d92a00 100644
@@ -40,7 +40,7 @@ static int __init warp_device_probe(void)
 	of_platform_bus_probe(NULL, warp_of_bus, NULL);
 	return 0;
 }
-machine_device_initcall(warp, warp_device_probe);
+machine_arch_initcall(warp, warp_device_probe);
 
 static int __init warp_probe(void)
 {
arch/powerpc/platforms/82xx/ep8248e.c +1 -1
index cdab847749e6..1394022574c9 100644
@@ -302,7 +302,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(ep8248e, declare_of_platform_devices);
+machine_arch_initcall(ep8248e, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
arch/powerpc/platforms/82xx/km82xx.c +1 -1
index 28860e40b5db..87925209bf52 100644
@@ -191,7 +191,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(km82xx, declare_of_platform_devices);
+machine_arch_initcall(km82xx, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
arch/powerpc/platforms/82xx/mpc8272_ads.c +1 -1
index d23c10a96bde..518b57dab431 100644
@@ -194,7 +194,7 @@ static int __init declare_of_platform_devices(void)
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
+machine_arch_initcall(mpc8272_ads, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
arch/powerpc/platforms/82xx/pq2fads.c +1 -1
index 6c654dc74a4b..b22d8bdd6848 100644
@@ -180,7 +180,7 @@ static int __init declare_of_platform_devices(void)
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-machine_device_initcall(pq2fads, declare_of_platform_devices);
+machine_arch_initcall(pq2fads, declare_of_platform_devices);
 
 define_machine(pq2fads)
 {
arch/powerpc/platforms/83xx/mpc831x_rdb.c +1 -1
index 40e0d8307b59..a95bdc1b225e 100644
@@ -49,7 +49,7 @@ static int __init mpc831x_rdb_probe(void)
 	return of_device_compatible_match(of_root, board);
 }
 
-machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
+machine_arch_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
 
 define_machine(mpc831x_rdb) {
 	.name			= "MPC831x RDB",
arch/powerpc/platforms/83xx/mpc834x_itx.c +1 -1
index 8fd0c1e8b182..f8738d9cd52c 100644
@@ -48,7 +48,7 @@ static int __init mpc834x_itx_declare_of_platform_devices(void)
 	mpc83xx_declare_of_platform_devices();
 	return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
 }
-machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
+machine_arch_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
 
 /* ************************************************************************
  *
arch/powerpc/platforms/85xx/ppa8548.c +1 -1
index 2410167b290a..0e876090661d 100644
@@ -74,7 +74,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(ppa8548, declare_of_platform_devices);
+machine_arch_initcall(ppa8548, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
arch/powerpc/platforms/8xx/adder875.c +1 -1
index 333dece79394..7b11310f7347 100644
@@ -101,7 +101,7 @@ static int __init declare_of_platform_devices(void)
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-machine_device_initcall(adder875, declare_of_platform_devices);
+machine_arch_initcall(adder875, declare_of_platform_devices);
 
 define_machine(adder875) {
 	.name = "Adder MPC875",
arch/powerpc/platforms/8xx/ep88xc.c +1 -1
index cd0d90f1fb1c..ebd64df848bf 100644
@@ -160,7 +160,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(ep88xc, declare_of_platform_devices);
+machine_arch_initcall(ep88xc, declare_of_platform_devices);
 
 define_machine(ep88xc) {
 	.name = "Embedded Planet EP88xC",
arch/powerpc/platforms/8xx/mpc86xads_setup.c +1 -1
index 8d02f5ff4481..5f6a9051a8f7 100644
@@ -134,7 +134,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
+machine_arch_initcall(mpc86x_ads, declare_of_platform_devices);
 
 define_machine(mpc86x_ads) {
 	.name			= "MPC86x ADS",
arch/powerpc/platforms/8xx/mpc885ads_setup.c +1 -1
index e821a42d5816..911b9c3a98f5 100644
@@ -210,7 +210,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(mpc885_ads, declare_of_platform_devices);
+machine_arch_initcall(mpc885_ads, declare_of_platform_devices);
 
 define_machine(mpc885_ads) {
 	.name			= "Freescale MPC885 ADS",
arch/powerpc/platforms/8xx/tqm8xx_setup.c +1 -1
index 4cea8b1afa44..e0c7a45d0eac 100644
@@ -136,7 +136,7 @@ static int __init declare_of_platform_devices(void)
 
 	return 0;
 }
-machine_device_initcall(tqm8xx, declare_of_platform_devices);
+machine_arch_initcall(tqm8xx, declare_of_platform_devices);
 
 define_machine(tqm8xx) {
 	.name			= "TQM8xx",
arch/powerpc/platforms/cell/setup.c +1 -1
index d3543e68efe8..d4809e7a3f2c 100644
@@ -185,7 +185,7 @@ static int __init cell_publish_devices(void)
 
 	return 0;
 }
-machine_subsys_initcall(cell, cell_publish_devices);
+machine_arch_initcall(cell, cell_publish_devices);
 
 static void __init mpic_init_IRQ(void)
 {
arch/powerpc/platforms/embedded6xx/gamecube.c +1 -1
index 36789cec957c..a6f937552324 100644
@@ -97,5 +97,5 @@ static int __init gamecube_device_probe(void)
 	of_platform_bus_probe(NULL, gamecube_of_bus, NULL);
 	return 0;
 }
-device_initcall(gamecube_device_probe);
+arch_initcall(gamecube_device_probe);
 
arch/powerpc/platforms/embedded6xx/linkstation.c +1 -1
index f29cf29b11f8..01b4566ed2e6 100644
@@ -32,7 +32,7 @@ static int __init declare_of_platform_devices(void)
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-machine_device_initcall(linkstation, declare_of_platform_devices);
+machine_arch_initcall(linkstation, declare_of_platform_devices);
 
 static int __init linkstation_add_bridge(struct device_node *dev)
 {
arch/powerpc/platforms/embedded6xx/mvme5100.c +1 -1
index ed7321d6772e..8b048b708262 100644
@@ -204,7 +204,7 @@ static int __init probe_of_platform_devices(void)
 	return 0;
 }
 
-machine_device_initcall(mvme5100, probe_of_platform_devices);
+machine_arch_initcall(mvme5100, probe_of_platform_devices);
 
 define_machine(mvme5100) {
 	.name			= "MVME5100",
arch/powerpc/platforms/embedded6xx/storcenter.c +1 -1
index 471a50bcd074..521d8882896c 100644
@@ -34,7 +34,7 @@ static int __init storcenter_device_probe(void)
 	of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
 	return 0;
 }
-machine_device_initcall(storcenter, storcenter_device_probe);
+machine_arch_initcall(storcenter, storcenter_device_probe);
 
 
 static int __init storcenter_add_bridge(struct device_node *dev)
arch/powerpc/platforms/embedded6xx/wii.c +1 -1
index 3fd683e40bc9..7c6eef1b8744 100644
@@ -242,5 +242,5 @@ static int __init wii_device_probe(void)
 	of_platform_bus_probe(NULL, wii_of_bus, NULL);
 	return 0;
 }
-device_initcall(wii_device_probe);
+arch_initcall(wii_device_probe);
 
arch/powerpc/platforms/pasemi/setup.c +1 -1
index e86c1bd08f1f..a69a5c108e67 100644
@@ -407,7 +407,7 @@ static int __init pasemi_publish_devices(void)
 
 	return 0;
 }
-machine_device_initcall(pasemi, pasemi_publish_devices);
+machine_arch_initcall(pasemi, pasemi_publish_devices);
 
 
 /*
Signature · 1 line
2.8.1
maintainer
#1 lore raw
Quoted 9 lines · Kevin Hao

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. This will override the arch specific population of default bus which run at a lower level than arch_initcall_sync. Since not all powerpc specific buses are added to the of_default_bus_match_table[], this causes some powerpc specific bus are not probed. Fix this by using a more preceding initcall.

Quoted 7 lines

---
Of course we can adjust the powerpc arch codes to use the of_platform_default_populate_init(), but it has high risk to break other boards given the complicated powerpc specific buses. So I would like just to fix the broken boards in the current release, and cook a patch to change to of_platform_default_populate_init() for linux-next.

The patch that broke things was sitting in -next for some time and no one reported anything. Are all these boards broken?

I'm fine to just disable the default call for PPC instead if there's some chance this does not fix some boards. There could be some other initcall ordering dependencies.

Quoted 2 lines

Only boot test on a mpc8315erdb board.

Curious, what would it take to remove the of_platform_bus_probe and use the default here? We can add additional bus compatibles to match. The difference between of_platform_bus_probe and of_platform_bus_populate is the former will match root nodes with no compatible string. Most platforms should not need that behavior and it would be nice to know which ones.

Rob

author
#2 lore raw
Quoted 18 lines · Rob Herring
Quoted 9 lines · Kevin Hao

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. This will override the arch specific population of default bus which run at a lower level than arch_initcall_sync. Since not all powerpc specific buses are added to the of_default_bus_match_table[], this causes some powerpc specific bus are not probed. Fix this by using a more preceding initcall.

Quoted 7 lines

---
Of course we can adjust the powerpc arch codes to use the of_platform_default_populate_init(), but it has high risk to break other boards given the complicated powerpc specific buses. So I would like just to fix the broken boards in the current release, and cook a patch to change to of_platform_default_populate_init() for linux-next.

Quoted 2 lines

The patch that broke things was sitting in -next for some time and no one reported anything. Are all these boards broken?

At least in theory. :-)
The effect may be different due to what devices are missed. For me, the Gianfar Ethernet on my mpc8315erdb board is malfunction due to the MIDIO bus is not probed.

Quoted 3 lines

I'm fine to just disable the default call for PPC instead if there's some chance this does not fix some boards.

I have tried to cover all the invocation of of_platform_bus_probe() via machine_device_initcall(). Yes, I maybe missed some boards. But won't we want to take this as a step to use the default populate function since it does remove some reduplication codes?

Quoted 8 lines

There could be some other
initcall ordering dependencies.

Quoted 2 lines

Only boot test on a mpc8315erdb board.

Curious, what would it take to remove the of_platform_bus_probe and use the default here? We can add additional bus compatibles to match.

I thought about this. But the bus compatibles list seems a bit longer and it may cause some side effects on some boards due to all these additional buses. So that changes seem a bit aggressive to me. It does seem a feature for linux-next. The following is the compatible buses list which are needed to be added to the default match table if we want fix all the current broken boards:

	{ .compatible = "fsl,ep8248e-bcsr", },
	{ .compatible = "fsl,pq2pro-localbus", },
	{ .compatible = "fsl,qe", },
	{ .compatible = "fsl,srio", },
	{ .compatible = "gianfar", },
	{ .compatible = "gpio-leds", },
	{ .compatible = "hawk-bridge", },
	{ .compatible = "ibm,ebc", },
	{ .compatible = "ibm,opb", },
	{ .compatible = "ibm,plb3", },
	{ .compatible = "ibm,plb4", },
	{ .compatible = "ibm,plb6", },
	{ .compatible = "nintendo,flipper", },
	{ .compatible = "nintendo,hollywood", },
	{ .compatible = "pasemi,localbus", },
	{ .compatible = "pasemi,sdc", },
	{ .compatible = "soc", },
	{ .compatible = "xlnx,compound", },
	{ .compatible = "xlnx,dcr-v29-1.00.a", },
	{ .compatible = "xlnx,opb-v20-1.10.c", },
	{ .compatible = "xlnx,plb-v34-1.01.a", },
	{ .compatible = "xlnx,plb-v34-1.02.a", },
	{ .compatible = "xlnx,plb-v46-1.00.a", },
	{ .compatible = "xlnx,plb-v46-1.02.a", },
	{ .name = "cpm", },
	{ .name = "localbus", },
	{ .name = "soc", },
	{ .type = "axon", },
	{ .type = "ebc", },
	{ .type = "opb", },
	{ .type = "plb4", },
	{ .type = "plb5", },
	{ .type = "qe", },
	{ .type = "soc", },
	{ .type = "spider", },

Of course I can choose to use the default function if all you guys think it is better. :-)

Quoted 4 lines

The difference between of_platform_bus_probe and of_platform_bus_populate is the former will match root nodes with no compatible string. Most platforms should not need that behavior and it would be nice to know which ones.

I don't think this difference would cause any real side effect for these boards.

Thanks,
Kevin

#3 lore raw
In reply to Kevin Hao
Quoted 42 lines · Kevin Hao

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. This will override the arch specific population of default bus which run at a lower level than arch_initcall_sync. Since not all powerpc specific buses are added to the of_default_bus_match_table[], this causes some powerpc specific bus are not probed. Fix this by using a more preceding initcall.

---
Of course we can adjust the powerpc arch codes to use the of_platform_default_populate_init(), but it has high risk to break other boards given the complicated powerpc specific buses. So I would like just to fix the broken boards in the current release, and cook a patch to change to of_platform_default_populate_init() for linux-next.

Only boot test on a mpc8315erdb board.

 arch/powerpc/platforms/40x/ep405.c               | 2 +-
 arch/powerpc/platforms/40x/ppc40x_simple.c       | 2 +-
 arch/powerpc/platforms/40x/virtex.c              | 2 +-
 arch/powerpc/platforms/40x/walnut.c              | 2 +-
 arch/powerpc/platforms/44x/canyonlands.c         | 2 +-
 arch/powerpc/platforms/44x/ebony.c               | 2 +-
 arch/powerpc/platforms/44x/iss4xx.c              | 2 +-
 arch/powerpc/platforms/44x/ppc44x_simple.c       | 2 +-
 arch/powerpc/platforms/44x/ppc476.c              | 2 +-
 arch/powerpc/platforms/44x/sam440ep.c            | 2 +-
 arch/powerpc/platforms/44x/virtex.c              | 2 +-
 arch/powerpc/platforms/44x/warp.c                | 2 +-
 arch/powerpc/platforms/82xx/ep8248e.c            | 2 +-
 arch/powerpc/platforms/82xx/km82xx.c             | 2 +-
 arch/powerpc/platforms/82xx/mpc8272_ads.c        | 2 +-
 arch/powerpc/platforms/82xx/pq2fads.c            | 2 +-
 arch/powerpc/platforms/83xx/mpc831x_rdb.c        | 2 +-
 arch/powerpc/platforms/83xx/mpc834x_itx.c        | 2 +-
 arch/powerpc/platforms/85xx/ppa8548.c            | 2 +-
 arch/powerpc/platforms/8xx/adder875.c            | 2 +-
 arch/powerpc/platforms/8xx/ep88xc.c              | 2 +-
 arch/powerpc/platforms/8xx/mpc86xads_setup.c     | 2 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c     | 2 +-
Quoted 8 lines
 arch/powerpc/platforms/8xx/tqm8xx_setup.c        | 2 +-
 arch/powerpc/platforms/cell/setup.c              | 2 +-
 arch/powerpc/platforms/embedded6xx/gamecube.c    | 2 +-
 arch/powerpc/platforms/embedded6xx/linkstation.c | 2 +-
 arch/powerpc/platforms/embedded6xx/mvme5100.c    | 2 +-
 arch/powerpc/platforms/embedded6xx/storcenter.c  | 2 +-
 arch/powerpc/platforms/embedded6xx/wii.c         | 2 +-
 arch/powerpc/platforms/pasemi/setup.c            | 2 +-

That's not a very minimal fix.

Every one of those initcall changes could be introducing a bug, by changing the order vs other init calls.

Can we just go back to the old behaviour on ppc?

cheers

A message that is not in the archive (sent off-list or not yet received): 87k2fmtxbv.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/[email protected]

#5 lore raw
Quoted 53 lines · Michael Ellerman
Quoted 42 lines · Kevin Hao

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. This will override the arch specific population of default bus which run at a lower level than arch_initcall_sync. Since not all powerpc specific buses are added to the of_default_bus_match_table[], this causes some powerpc specific bus are not probed. Fix this by using a more preceding initcall.

---
Of course we can adjust the powerpc arch codes to use the of_platform_default_populate_init(), but it has high risk to break other boards given the complicated powerpc specific buses. So I would like just to fix the broken boards in the current release, and cook a patch to change to of_platform_default_populate_init() for linux-next.

Only boot test on a mpc8315erdb board.

 arch/powerpc/platforms/40x/ep405.c               | 2 +-
 arch/powerpc/platforms/40x/ppc40x_simple.c       | 2 +-
 arch/powerpc/platforms/40x/virtex.c              | 2 +-
 arch/powerpc/platforms/40x/walnut.c              | 2 +-
 arch/powerpc/platforms/44x/canyonlands.c         | 2 +-
 arch/powerpc/platforms/44x/ebony.c               | 2 +-
 arch/powerpc/platforms/44x/iss4xx.c              | 2 +-
 arch/powerpc/platforms/44x/ppc44x_simple.c       | 2 +-
 arch/powerpc/platforms/44x/ppc476.c              | 2 +-
 arch/powerpc/platforms/44x/sam440ep.c            | 2 +-
 arch/powerpc/platforms/44x/virtex.c              | 2 +-
 arch/powerpc/platforms/44x/warp.c                | 2 +-
 arch/powerpc/platforms/82xx/ep8248e.c            | 2 +-
 arch/powerpc/platforms/82xx/km82xx.c             | 2 +-
 arch/powerpc/platforms/82xx/mpc8272_ads.c        | 2 +-
 arch/powerpc/platforms/82xx/pq2fads.c            | 2 +-
 arch/powerpc/platforms/83xx/mpc831x_rdb.c        | 2 +-
 arch/powerpc/platforms/83xx/mpc834x_itx.c        | 2 +-
 arch/powerpc/platforms/85xx/ppa8548.c            | 2 +-
 arch/powerpc/platforms/8xx/adder875.c            | 2 +-
 arch/powerpc/platforms/8xx/ep88xc.c              | 2 +-
 arch/powerpc/platforms/8xx/mpc86xads_setup.c     | 2 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c     | 2 +-
Quoted 8 lines
 arch/powerpc/platforms/8xx/tqm8xx_setup.c        | 2 +-
 arch/powerpc/platforms/cell/setup.c              | 2 +-
 arch/powerpc/platforms/embedded6xx/gamecube.c    | 2 +-
 arch/powerpc/platforms/embedded6xx/linkstation.c | 2 +-
 arch/powerpc/platforms/embedded6xx/mvme5100.c    | 2 +-
 arch/powerpc/platforms/embedded6xx/storcenter.c  | 2 +-
 arch/powerpc/platforms/embedded6xx/wii.c         | 2 +-
 arch/powerpc/platforms/pasemi/setup.c            | 2 +-
Quoted 6 lines

That's not a very minimal fix.

Every one of those initcall changes could be introducing a bug, by changing the order vs other init calls.

Can we just go back to the old behaviour on ppc?

Sure. How about this one?

From 4362b4cdd8a6198df4cc46c628473f0d44e03fa8 Mon Sep 17 00:00:00 2001
From: Kevin Hao <[email protected]>
Date: Fri, 12 Aug 2016 13:30:03 +0800
Subject: [PATCH v2] of/platform: disable the
of_platform_default_populate_init() for all the ppc boards

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. But a lot of ppc boards use machine_device_initcall() to populate the default bus. This means that the default populate function has higher priority and would override the arch specific population of the bus. The side effect is that some arch specific bus are not probed, then cause various malfunction due to the miss of some devices. Since it is very possible to introduce bugs if we simply change the initcall level for all these boards(about 30+). This just disable this default function for all the ppc boards.

---
 drivers/of/platform.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/of/platform.c +2 -0
index 8aa197691074..f39ccd5aa701 100644
@@ -497,6 +497,7 @@ int of_platform_default_populate(struct device_node *root,
 }
 EXPORT_SYMBOL_GPL(of_platform_default_populate);
 
+#ifndef CONFIG_PPC
 static int __init of_platform_default_populate_init(void)
 {
 	struct device_node *node;
@@ -521,6 +522,7 @@ static int __init of_platform_default_populate_init(void)
 	return 0;
 }
 arch_initcall_sync(of_platform_default_populate_init);
+#endif
 
 static int of_platform_device_destroy(struct device *dev, void *data)
 {
Signature · 4 lines
2.8.1

Thanks,
Kevin
#6 lore raw
Quoted 2 lines · Kevin Hao
Quoted 1 line · Michael Ellerman

Kevin Hao <[email protected]> writes:

[...]

Quoted 25 lines
Quoted 4 lines

Every one of those initcall changes could be introducing a bug, by changing the order vs other init calls.

Can we just go back to the old behaviour on ppc?

Sure. How about this one?

From 4362b4cdd8a6198df4cc46c628473f0d44e03fa8 Mon Sep 17 00:00:00 2001
From: Kevin Hao <[email protected]>
Date: Fri, 12 Aug 2016 13:30:03 +0800
Subject: [PATCH v2] of/platform: disable the
of_platform_default_populate_init() for all the ppc boards

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. But a lot of ppc boards use machine_device_initcall() to populate the default bus. This means that the default populate function has higher priority and would override the arch specific population of the bus. The side effect is that some arch specific bus are not probed, then cause various malfunction due to the miss of some devices. Since it is very possible to introduce bugs if we simply change the initcall level for all these boards(about 30+). This just disable this default function for all the ppc boards.

Quoted 4 lines
---
 drivers/of/platform.c | 2 ++
 1 file changed, 2 insertions(+)

I've applied this one.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAL_Jsq+_K-uU7bFkSm-tq-Q0DPhQt4j=f84OzQSCJFEC29O-8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#8 lore raw
Quoted 21 lines · Rob Herring

Quoted 20 lines

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate
the default bus and this function is invoked at the arch_initcall_sync
level. But a lot of ppc boards use machine_device_initcall() to populate the default bus. This means that the default populate function
has higher priority and would override the arch specific population of
the bus. The side effect is that some arch specific bus are not probed,
then cause various malfunction due to the miss of some devices. Since
it is very possible to introduce bugs if we simply change the initcall
level for all these boards(about 30+). This just disable this default
function for all the ppc boards.

Quoted 6 lines
Quoted 4 lines

---
 drivers/of/platform.c | 2 ++

 1 file changed, 2 insertions(+)

I've applied this one.

Not fan of the hard #ifdef at all... it will make it hard to convert platforms one by one. Why not an arch_want_default_of_probe() or something like this which we can then plumb into ppc_md. ?

Cheers,
Ben.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1471209670.12231.60.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org

#10 lore raw
Quoted 27 lines · Benjamin Herrenschmidt
Quoted 26 lines · Rob Herring
Quoted 25 lines

With the commit 44a7185c2ae6 ("of/platform: Add common method to populate default bus"), a default function is introduced to populate
the default bus and this function is invoked at the arch_initcall_sync
level. But a lot of ppc boards use machine_device_initcall() to populate the default bus. This means that the default populate function
has higher priority and would override the arch specific population of
the bus. The side effect is that some arch specific bus are not probed,
then cause various malfunction due to the miss of some devices. Since
it is very possible to introduce bugs if we simply change the initcall
level for all these boards(about 30+). This just disable this default
function for all the ppc boards.

---
 drivers/of/platform.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 5 lines
Quoted 1 line

I've applied this one.

Not fan of the hard #ifdef at all... it will make it hard to convert platforms one by one. Why not an arch_want_default_of_probe() or something like this which we can then plumb into ppc_md. ?

Yeah, I'm not either really. I didn't propose using IS_ENABLED here either as it does add a needless initcall.

Do you have any idea which platforms are not broken and could be switched over now. If not, I think we should just leave as is for 4.8 and make it per platform selectable for 4.9.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAL_Jsq+JLvThaz3ZTy80yVW23waPjqfw_JC-EJF-QuCk21=eJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#12 lore raw
Quoted 11 lines · Rob Herring
Quoted 1 line

Not fan of the hard #ifdef at all... it will make it hard to

convert

Quoted 2 lines

platforms one by one. Why not an arch_want_default_of_probe() or something like this which we can then plumb into ppc_md. ?

Yeah, I'm not either really. I didn't propose using IS_ENABLED here either as it does add a needless initcall.

Do you have any idea which platforms are not broken and could be switched over now. If not, I think we should just leave as is for 4.8 and make it per platform selectable for 4.9.

Not really... the non-embedded platforms (mac, pseries, etc...) don't really use the OF bus probing iirc, so it's going to be a matter of scrubbing the embedded ones. I agree we can do that in 4.9

Cheers,
Ben.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html