From patchwork Fri Aug 12 05:49:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 658531 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s9YyQ0CHgz9s2Q for ; Fri, 12 Aug 2016 15:55:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ciDUEkdq; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s9YyP6DmFzDrhF for ; Fri, 12 Aug 2016 15:55:25 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ciDUEkdq; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s9Yqv2zmqzDr6W for ; Fri, 12 Aug 2016 15:49:47 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ciDUEkdq; dkim-atps=neutral Received: by mail-pa0-x244.google.com with SMTP id vy10so915549pac.0 for ; Thu, 11 Aug 2016 22:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=l/A5elB4sjuaOJvWykizsfXHyRIc37uHswlVqpsejoM=; b=ciDUEkdq4jEfoE/zFX68FmZGbyFrVLP08Bmxj6a90/B6hjafA85zV+XCx+Q+xUtxeT ncYPd1bjjQ1GVtCt+fTG0WjJHbQbKSupWxFpP54Rus1OitnYfhLksXoABzr+QV85ueSg GGIWcbUhE6wmFuEP6xG7kfiqAJgcTVdKd0vA8IWBlKR74E9NdG2ode/Ncjy+0dEZC48L ucjHFwLl3g4y0w45ic+DyGMqsekN2Q03D9k3B6rVxlkSOthZpgTmkaPk3OyhFodfUsZc 7EuoOtJFeGnNsyvF4A4IWPA6pQFmTarTlp5SXyOtplIkVzgixbapP8wSq/osor7Ixpjp pqMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=l/A5elB4sjuaOJvWykizsfXHyRIc37uHswlVqpsejoM=; b=JhVV/mHYHif+a2FR+LnvbjBtaxkxVsKYdbgDc2WWYWE0XJkUbYFKkZNVrjVzQemPbX GdqllxxLFD2TpsAIXzBYRzV8ENJxvgp3GdoxQvTGQtQ2j5x5sBVfTKlqcGCpKV9jqdcT iGtn853fCcljh1Nw6GiNQaaBEzP6YCQqNWz3BsX+bvTGvtFin5tOT/rmPGRiS0engM9+ mysNR1Kb/69czbF3xgaVHA5z8tLcyMzMEhfItVG6s77EkPfwwGn6l9Ux+YYhbkgXTEib 2Cu9MtLKlNnLrW9SFZJTMFsgIL2eMfnWHINlg1s7ZP0Jr0XUvz3IQo3Wqk5EToMz1vwW XgpA== X-Gm-Message-State: AEkoousqP1tVAe8vA1axA/Q2I8WGrM7yf1ngs6iAIfmQeyNxQtbyDIuilGAHYQ2NYdpVxg== X-Received: by 10.66.80.2 with SMTP id n2mr24066397pax.134.1470980985568; Thu, 11 Aug 2016 22:49:45 -0700 (PDT) Received: from pek-khao-d1 (unknown-178-22.windriver.com. [147.11.178.22]) by smtp.gmail.com with ESMTPSA id k78sm9360645pfa.78.2016.08.11.22.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 22:49:44 -0700 (PDT) Date: Fri, 12 Aug 2016 13:49:34 +0800 From: Kevin Hao To: Michael Ellerman Subject: Re: [PATCH] powerpc: populate the default bus with machine_arch_initcall Message-ID: <20160812054934.GJ17275@pek-khao-d1> References: <1470913781-9204-1-git-send-email-haokexin@gmail.com> <87k2fmtxbv.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87k2fmtxbv.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Kefeng Wang , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Aug 12, 2016 at 02:39:32PM +1000, Michael Ellerman wrote: > Kevin Hao 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 > > --- > > 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 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 --- 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) {