* Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall [not found] ` <87k2fmtxbv.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> @ 2016-08-12 5:49 ` Kevin Hao 2016-08-12 19:30 ` Rob Herring 0 siblings, 1 reply; 5+ messages in thread From: Kevin Hao @ 2016-08-12 5:49 UTC (permalink / raw) To: Michael Ellerman Cc: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ, Kefeng Wang, Rob Herring, devicetree-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 5228 bytes --] On Fri, Aug 12, 2016 at 02:39:32PM +1000, Michael Ellerman wrote: > Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > > > 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. > > > > Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > --- > > 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 +- > > 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 <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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. Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- drivers/of/platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 8aa197691074..f39ccd5aa701 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -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) { -- 2.8.1 Thanks, Kevin [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall 2016-08-12 5:49 ` [PATCH] powerpc: populate the default bus with machine_arch_initcall Kevin Hao @ 2016-08-12 19:30 ` Rob Herring [not found] ` <CAL_Jsq+_K-uU7bFkSm-tq-Q0DPhQt4j=f84OzQSCJFEC29O-8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Rob Herring @ 2016-08-12 19:30 UTC (permalink / raw) To: Kevin Hao Cc: Michael Ellerman, linuxppc-dev, Kefeng Wang, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Fri, Aug 12, 2016 at 12:49 AM, Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > On Fri, Aug 12, 2016 at 02:39:32PM +1000, Michael Ellerman wrote: >> Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: [...] >> 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 <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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. > > Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAL_Jsq+_K-uU7bFkSm-tq-Q0DPhQt4j=f84OzQSCJFEC29O-8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall [not found] ` <CAL_Jsq+_K-uU7bFkSm-tq-Q0DPhQt4j=f84OzQSCJFEC29O-8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2016-08-14 21:21 ` Benjamin Herrenschmidt [not found] ` <1471209670.12231.60.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Benjamin Herrenschmidt @ 2016-08-14 21:21 UTC (permalink / raw) To: Rob Herring, Kevin Hao Cc: Kefeng Wang, linuxppc-dev, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Fri, 2016-08-12 at 14:30 -0500, Rob Herring wrote: > > > 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. > > > > Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > --- > > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1471209670.12231.60.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>]
* Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall [not found] ` <1471209670.12231.60.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> @ 2016-08-14 22:42 ` Rob Herring [not found] ` <CAL_Jsq+JLvThaz3ZTy80yVW23waPjqfw_JC-EJF-QuCk21=eJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Rob Herring @ 2016-08-14 22:42 UTC (permalink / raw) To: Benjamin Herrenschmidt Cc: Kevin Hao, Kefeng Wang, linuxppc-dev, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Sun, Aug 14, 2016 at 4:21 PM, Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> wrote: > On Fri, 2016-08-12 at 14:30 -0500, Rob Herring wrote: >> >> > 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. >> > >> > Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > --- >> > 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. ? 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAL_Jsq+JLvThaz3ZTy80yVW23waPjqfw_JC-EJF-QuCk21=eJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall [not found] ` <CAL_Jsq+JLvThaz3ZTy80yVW23waPjqfw_JC-EJF-QuCk21=eJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2016-08-14 23:54 ` Benjamin Herrenschmidt 0 siblings, 0 replies; 5+ messages in thread From: Benjamin Herrenschmidt @ 2016-08-14 23:54 UTC (permalink / raw) To: Rob Herring Cc: Kevin Hao, Kefeng Wang, linuxppc-dev, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Sun, 2016-08-14 at 17:42 -0500, Rob Herring wrote: > > 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. 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-14 23:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1470913781-9204-1-git-send-email-haokexin@gmail.com>
[not found] ` <87k2fmtxbv.fsf@concordia.ellerman.id.au>
[not found] ` <87k2fmtxbv.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
2016-08-12 5:49 ` [PATCH] powerpc: populate the default bus with machine_arch_initcall Kevin Hao
2016-08-12 19:30 ` Rob Herring
[not found] ` <CAL_Jsq+_K-uU7bFkSm-tq-Q0DPhQt4j=f84OzQSCJFEC29O-8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-14 21:21 ` Benjamin Herrenschmidt
[not found] ` <1471209670.12231.60.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2016-08-14 22:42 ` Rob Herring
[not found] ` <CAL_Jsq+JLvThaz3ZTy80yVW23waPjqfw_JC-EJF-QuCk21=eJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-14 23:54 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).