From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6FDD2C7619A for ; Mon, 27 Mar 2023 03:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZK+AkBkNHnHSgKR6CO0fKmiLCKmusliKg5RlYbrb7iU=; b=1q2y6hz6YB9BjA T1L5JOQjJFqNoASFyG7im7bfWQHCUkmQHKFKtXAIi9QFQqbnRCBsTS5qFjwK5IzCM1HYkN9u+Ll5p B4739M4VyhWvuvCsdup9NXcn9Zr3JIXQ16/it2gQ8yztmi96/Y29lKONolZWG9LYhQTPBiFAZQKgn OLy2osKSNugOxCbZzZmhkOi2D+e30ylF3avAElQ2L3VDg2T+F1tWKiXf9ys874oXphPleQr0b5RmE 6u2j+N9RBbDRMU9vCRh9t3pAZA6IryMg6VrnZ7y/uIMfSgnPMocWAOUEmmn0iXyYtSGoDTJghtnrs Beot58ZRA3qXIlvugAmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgd7t-009b2Q-0P; Mon, 27 Mar 2023 03:02:29 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgd7o-009b1n-2N for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 03:02:27 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E1FACB80DA3; Mon, 27 Mar 2023 03:02:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52A44C433D2; Mon, 27 Mar 2023 03:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679886141; bh=ro2qYTrcUU+cYhFXYtbYc9UeqCUWNKAZPvp1734oaxE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aLZt7NmN7dW3zHYBppahDR1suBSqRyBNY6gEku33VIEE8YNRasAVWE8W8XUqsIArJ Ci3xKcKUIEDN9Q9djm7qkK7Nevf4zuoXQNzQjVlU8h7p3Kk/wJr0ULzeYnh/pENXEW DJR8ZlP3LOyo9VoX103xUNM2I0mlKX+iROjSK7fPMx2SqJeRAoTrUpneH2kpeh91g8 uBCf9kZ0aQ4FlVpRAEXDeS1jLsr1hUXRBXoxeim4u6cc/Cs6qZuegxhPD+dekgmtcy vUdAL7AAJClbM04zLcsuGXUwuL5yIFVdpm9xkxVQkgN8kRGHj68oz7vPEpw8RicxIH Lk3zOs4Oh+5RA== Date: Mon, 27 Mar 2023 11:02:13 +0800 From: Shawn Guo To: Geert Uytterhoeven , Ivan Bornyakov Cc: Greg Kroah-Hartman , Saravana Kannan , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Wolfram Sang , Rob Herring , Frank Rowand , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] treewide: Fix instantiation of devices in DT overlays Message-ID: <20230327030213.GJ3364759@dragon> References: <240155f20aae47e9f7461e2b7416120ba6238886.1679650087.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <240155f20aae47e9f7461e2b7416120ba6238886.1679650087.git.geert+renesas@glider.be> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_200224_921601_D35D10CF X-CRM114-Status: GOOD ( 22.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org + Ivan On Fri, Mar 24, 2023 at 10:30:39AM +0100, Geert Uytterhoeven wrote: > When loading a DT overlay that creates a device, the device is not > instantiated, unless the DT overlay is unloaded and reloaded again. > > Saravana explains: > Basically for all overlays (I hope the function is only used for > overlays) we assume all nodes are NOT devices until they actually > get added as a device. > > Based on a patch by Saravana Kannan, which covered only platform and spi > devices. > > Fixes: 4a032827daa89350 ("of: property: Simplify of_link_to_phandle()") > Link: https://lore.kernel.org/r/CAGETcx_+rhHvaC_HJXGrr5_WAd2+k5f=rWYnkCZ6z5bGX-wj4w@mail.gmail.com > Signed-off-by: Geert Uytterhoeven > Acked-by: Mark Brown > --- > v2: > - Add Acked-by, > - Drop RFC. > --- > drivers/bus/imx-weim.c | 1 + > drivers/i2c/i2c-core-of.c | 1 + > drivers/of/dynamic.c | 1 + > drivers/of/platform.c | 1 + > drivers/spi/spi.c | 1 + > 5 files changed, 5 insertions(+) > > diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c > index 36d42484142aede2..898e23a4231400fa 100644 > --- a/drivers/bus/imx-weim.c > +++ b/drivers/bus/imx-weim.c > @@ -329,6 +329,7 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action, > "Failed to setup timing for '%pOF'\n", rd->dn); > > if (!of_node_check_flag(rd->dn, OF_POPULATED)) { > + rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE; > if (!of_platform_device_create(rd->dn, NULL, &pdev->dev)) { > dev_err(&pdev->dev, > "Failed to create child device '%pOF'\n", Ivan, so you were aware of that the device is not instantiated before this change? Shawn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel