LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hao <haokexin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall
Date: Fri, 12 Aug 2016 13:49:34 +0800	[thread overview]
Message-ID: <20160812054934.GJ17275@pek-khao-d1> (raw)
In-Reply-To: <87k2fmtxbv.fsf@concordia.ellerman.id.au>

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

On Fri, Aug 12, 2016 at 02:39:32PM +1000, Michael Ellerman wrote:
> Kevin Hao <haokexin@gmail.com> 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@gmail.com>
> > ---
> > 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@gmail.com>
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@gmail.com>
---
 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 --]

  reply	other threads:[~2016-08-12  5:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 11:09 [PATCH] powerpc: populate the default bus with machine_arch_initcall Kevin Hao
2016-08-11 13:17 ` Rob Herring
2016-08-12  2:32   ` Kevin Hao
2016-08-12  4:39 ` Michael Ellerman
2016-08-12  5:49   ` Kevin Hao [this message]
2016-08-12 19:30     ` Rob Herring
2016-08-14 21:21       ` Benjamin Herrenschmidt
2016-08-14 22:42         ` Rob Herring
2016-08-14 23:54           ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160812054934.GJ17275@pek-khao-d1 \
    --to=haokexin@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=robh@kernel.org \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox