From patchwork Thu Jan 28 08:28:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 373502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50CD9C433E9 for ; Thu, 28 Jan 2021 08:30:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05E2D64DD6 for ; Thu, 28 Jan 2021 08:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231408AbhA1I34 (ORCPT ); Thu, 28 Jan 2021 03:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbhA1I3o (ORCPT ); Thu, 28 Jan 2021 03:29:44 -0500 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A07C06174A for ; Thu, 28 Jan 2021 00:28:57 -0800 (PST) Received: from ramsan.of.borg ([84.195.186.194]) by albert.telenet-ops.be with bizsmtp id N8Up2400H4C55Sk068UpAC; Thu, 28 Jan 2021 09:28:55 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1l52fY-001JNE-RG; Thu, 28 Jan 2021 09:28:48 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1l52fY-009Fsb-6J; Thu, 28 Jan 2021 09:28:48 +0100 From: Geert Uytterhoeven To: Magnus Damm Cc: Rob Herring , Saravana Kannan , Yoshihiro Shimoda , Greg Kroah-Hartman , "Rafael J . Wysocki" , Marc Zyngier , Kevin Hilman , Marek Szyprowski , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] soc: renesas: rcar-sysc: Mark device node OF_POPULATED after init Date: Thu, 28 Jan 2021 09:28:47 +0100 Message-Id: <20210128082847.2205950-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The R-Car System Controller (SYSC) driver registers PM domains from an early_initcall(). It does not use a platform driver, as secondary CPU startup on R-Car H1 needs to control the CPU power domains, before initialization of the driver framework. As fw_devlink only considers devices, it does not know that the System Controller is ready. Hence probing of on-chip devices that are part of the SYSC PM domain fails if fw_devlink is enabled: probe deferral - supplier e6180000.system-controller not ready Fix this by setting the OF_POPULATED flag for the SYSC device node after successful initialization. This will make of_link_to_phandle() ignore the SYSC device node as a dependency, and consumer devices will be probed again. Signed-off-by: Geert Uytterhoeven Reviewed-by: Saravana Kannan --- As this seems to be harmless if commit e590474768f1cc04 ("driver core: Set fw_devlink=on by default") won't make v5.12, I plan to queue this in renesas-devel for v5.12. v2: - Add Reviewed-by, - s/platform devices/devices/, - Drop Fixes tag, - Drop RFC. --- drivers/soc/renesas/rcar-sysc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index d51ddc7d5232b9db..53387a72ca00ce79 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c @@ -434,6 +434,8 @@ static int __init rcar_sysc_pd_init(void) } error = of_genpd_add_provider_onecell(np, &domains->onecell_data); + if (!error) + of_node_set_flag(np, OF_POPULATED); out_put: of_node_put(np);