Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp297388pxx; Thu, 29 Oct 2020 02:57:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfitA9IN8oqhD7TvwVQUx7Z/kJAYsGSb3KWIzAvQR030w4Vs/NE8LiGKa6jj7XHjeX3WTi X-Received: by 2002:a17:906:1804:: with SMTP id v4mr3258656eje.201.1603965430217; Thu, 29 Oct 2020 02:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603965430; cv=none; d=google.com; s=arc-20160816; b=JdWdixVwpraoJry1FJv294r3z93zB//Nvey4J8OjJUbUXWQ3FjKqE5AZloE6jMSHA2 m7CNQsF02A0hNQ2sYeOjg7QOUgf1GF6k4irYl3FpO3ksGKevo5t+Ldp6Q33AuuPdWuQr elDCLkETzoEETJ3CsQg5DE8Fa8tP9TCGvBJBhzTrzyOZl66YHlgZ4ExZEm4vj+f3g1/m 6CKVCP4JNmrry9D9TY78KsTp6vtAPWUAqYYQ8a1rHL2rH/ARbjAsdIgAZ57qy/7VCZXW cOBL4f6fQxyKvZQEaThwzIm2S5Ezu9VQMpmyyOkJRKoPBMrf3p4wyPStvLwMfBw2M+Ik SR0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IdgkW86ZEmWFPoDjW/zVR+wm49ZV0ccv/I9W+5ESaho=; b=aAyJPup+mjS6W70j3KFKtyEEiMoDHV88+NN5h8Im0islYofG7nFoFkTIBv66jmwIr0 xNa+E+GyA4GMA4Lk1IQ7TtDfI+s79ckUVtBX+hCv3ZCpIiupqf9AZatCG4mwsZET74qH zFrPSSjgLZKPhJ3FfmYanEd8vdso99NnPtvBsKJ6mmGLIoKqwse9uKrQcL43o5VMpMSE sb6j/HtJM23AFLMsFGKg4BAirAunPdqmcZ81xLvq2yzaX2duouDetF8UUp3YpIWK1JLb HaMUG97a2rtzc/6qS8RdLfDEvgJMnC1lfYLEiO9SsnxHeessSxTuK8HkZBYjLQzrcD19 JeuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uX0CxCQm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si1526076ejl.297.2020.10.29.02.56.48; Thu, 29 Oct 2020 02:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uX0CxCQm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732432AbgJ1WU6 (ORCPT + 99 others); Wed, 28 Oct 2020 18:20:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:60526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731701AbgJ1WRl (ORCPT ); Wed, 28 Oct 2020 18:17:41 -0400 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EEBD24752 for ; Wed, 28 Oct 2020 13:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603891697; bh=0AiJ6MSBrV2gPFEgikjETnPmWhL6QMosoYBf9SDsHoQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uX0CxCQmE4ChbPYlWywtxnXbQGD1Zx5QAn7p9cnuZwe1tVkrr+5/5F94S1CZc/+gL v2M0004jWAffs3DZ1gZaq3Q0otUSTxGADaHrO3E8vQLsmOHBAYn0WPWh7P4sRP8MCQ 8xescS9waMNhyuD8jpE5QYBMHZGz8nvGKiWlqInk= Received: by mail-ot1-f47.google.com with SMTP id f97so4196370otb.7 for ; Wed, 28 Oct 2020 06:28:17 -0700 (PDT) X-Gm-Message-State: AOAM531mS8mpM3I61NCm9kOIopH4ygOeb5V3kzSEsoJjA/GQhpD85So0 xTjfMLPqbeURPKRxDSQnVYRENPHK7JNkq+2zPA== X-Received: by 2002:a9d:7993:: with SMTP id h19mr5250175otm.129.1603891696733; Wed, 28 Oct 2020 06:28:16 -0700 (PDT) MIME-Version: 1.0 References: <1589953889-30955-1-git-send-email-peng.fan@nxp.com> <1589953889-30955-2-git-send-email-peng.fan@nxp.com> In-Reply-To: <1589953889-30955-2-git-send-email-peng.fan@nxp.com> From: Rob Herring Date: Wed, 28 Oct 2020 08:28:05 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 1/3] ARM: imx: use device_initcall for imx_soc_device_init To: Peng Fan Cc: Shawn Guo , Sascha Hauer , linux-arm-kernel , Abel Vesa , Anson Huang , Andrey Smirnov , Fabio Estevam , "linux-kernel@vger.kernel.org" , NXP Linux Team , Sascha Hauer , =?UTF-8?Q?Andr=C3=A9_Draszik?= , Leonard Crestez , Enrico Weigelt , Chris Healy , Allison Randal Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 1:01 AM wrote: > > From: Peng Fan > > This is preparation to move imx_soc_device_init to drivers/soc/imx/ > > There is no reason to must put dt devices under /sys/devices/soc0, > they could also be under /sys/devices/platform, so we could > pass NULL as parent when calling of_platform_default_populate. > > Following soc-imx8.c soc-imx-scu.c using device_initcall, need > to change return type to int type for imx_soc_device_init. > > Signed-off-by: Peng Fan > --- > diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c > index 284bce1112d2..85c084a716ab 100644 > --- a/arch/arm/mach-imx/mach-imx6q.c > +++ b/arch/arm/mach-imx/mach-imx6q.c > @@ -245,21 +245,15 @@ static void __init imx6q_axi_init(void) > > static void __init imx6q_init_machine(void) > { > - struct device *parent; > - > if (cpu_is_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_2_0) > imx_print_silicon_rev("i.MX6QP", IMX_CHIP_REVISION_1_0); > else > imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", > imx_get_soc_revision()); > > - parent = imx_soc_device_init(); > - if (parent == NULL) > - pr_warn("failed to initialize soc device\n"); > - > imx6q_enet_phy_init(); > > - of_platform_default_populate(NULL, NULL, parent); > + of_platform_default_populate(NULL, NULL, NULL); I know this is already applied, but really we want to get rid of of_platform_default_populate calls and let the core code call it. i.MX is one of the last remaining platforms to fix. This one remained mainly because of 'parent'. Looks like there's some initcall ordering issues to fix though. Maybe moving things to init_late works? If not, moving the setup to drivers would be better if there's any ordering issues as with deferred probe, initcalls alone don't guarantee the order. Rob