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 9173FC77B6E for ; Wed, 5 Apr 2023 20:43:48 +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=O32jBvCW+53IKR7omtq2ciG1yy3OPw9NcQFnzy+sfX0=; b=P1BrYYZJuuvRPN /JESGvjIiStGpqKXW1R/s3uP89v8WA9Bin/aVIt7Iy96wcqtUuUsONYoxsC2PbRK/CGp6oOQPf3Qp U8RdJQtgDEMn39bah2/ZdKnbjO3l5a3F8zFRULIRHNExzgS9q1HMdm3tcsHoHb/Viy0t/P1SFqSXD 1vfKJ6/iUT5xI88yOuu90+7BhcQlO6D3HKaJnJCZIoiCmkpVHLUcJ4dwPxXPrVshmRY5rt2L6fJOx slN75Cb+00lktlm/9NL1BX5xhizCJ6X/8BKipk8UFJ4sco8fUcJEk6xLh37iQ6sJZS+PCvDwNA1Ce ojcq0+kBUqcT4f/6nqvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk9y8-005fBr-0V; Wed, 05 Apr 2023 20:43:00 +0000 Received: from mail-oa1-f53.google.com ([209.85.160.53]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk9y4-005fAJ-1X for linux-arm-kernel@lists.infradead.org; Wed, 05 Apr 2023 20:42:57 +0000 Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-17786581fe1so39966321fac.10 for ; Wed, 05 Apr 2023 13:42:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680727374; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Fo4KOndYHjMmbpfxHkmhUzVyW73zzbklAEkQD0vmqLg=; b=KFmgMdcg65tpkoThRZyIviTTvjA3EE5SxmdvR4mwThVWods1Oq14O47KDzgFQAYkuw TbJYZun9zjh7vPPY+W4Xcm+WuWRf38Gyoa+gygFNOkqyV/5JkDaDznG9/N7jPTwvWmHC A1vcVjuGWp+H1aiZmwG/yzOf0c1mRTHwEREOd54urw0qi4QHwwvGT0/xvcs4Q/jgWi9/ 2DUVYejKQyhEnQ6BGSVmEI3kBQF08ZxFyvx3La2TXxu+xE1X4i/DW18bFWsTSB1Bw+2Y qxlSDuzv+y7hj0Q+5b16ele3AX79vsO9S0+wr4EEPzGAo+FpUiPFwlzHTvQ0cFeE7PdJ JCAA== X-Gm-Message-State: AAQBX9d9EhZhzCehjtT3TDozqALY0cee4AbfL2hv6MY9G1H75aGkW1Ln kwsbocjogHnXL3m7jejkVw== X-Google-Smtp-Source: AKy350YB2Ilkp1Aoa2VvCKvBjmWi9tDKQH08fmFxNM2UVw2G8NAZ3PpJIJOjMXSbsNNwBzdVZHrk4g== X-Received: by 2002:a05:6870:6023:b0:177:81bb:1b28 with SMTP id t35-20020a056870602300b0017781bb1b28mr4091960oaa.9.1680727373749; Wed, 05 Apr 2023 13:42:53 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id zj27-20020a0568716c9b00b001723a2e84b6sm6361842oab.6.2023.04.05.13.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 13:42:53 -0700 (PDT) Received: (nullmailer pid 449449 invoked by uid 1000); Wed, 05 Apr 2023 20:42:52 -0000 Date: Wed, 5 Apr 2023 15:42:52 -0500 From: Rob Herring To: Geert Uytterhoeven Cc: Mark Brown , devicetree@vger.kernel.org, Pengutronix Kernel Team , Saravana Kannan , Ivan Bornyakov , Greg Kroah-Hartman , Fabio Estevam , linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Frank Rowand , Shawn Guo , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Rob Herring , NXP Linux Team , Sascha Hauer , Wolfram Sang Subject: Re: [PATCH v3] treewide: Fix probing of devices in DT overlays Message-ID: <168072737082.449372.6122824582508382689.robh@kernel.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_134256_509844_43938163 X-CRM114-Status: GOOD ( 24.35 ) 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 On Thu, 30 Mar 2023 15:26:13 +0200, Geert Uytterhoeven wrote: > When loading a DT overlay that creates a device, the device is not > probed, unless the DT overlay is unloaded and reloaded again. > > After the recent refactoring to improve fw_devlink, it no longer depends > on the "compatible" property to identify which device tree nodes will > become struct devices. fw_devlink now picks up dangling consumers > (consumers pointing to descendent device tree nodes of a device that > aren't converted to child devices) when a device is successfully bound > to a driver. See __fw_devlink_pickup_dangling_consumers(). > > However, during DT overlay, a device's device tree node can have > sub-nodes added/removed without unbinding/rebinding the driver. This > difference in behavior between the normal device instantiation and > probing flow vs. the DT overlay flow has a bunch of implications that > are pointed out elsewhere[1]. One of them is that the fw_devlink logic > to pick up dangling consumers is never exercised. > > This patch solves the fw_devlink issue by marking all DT nodes added by > DT overlays with FWNODE_FLAG_NOT_DEVICE (fwnode that won't become > device), and by clearing the flag when a struct device is actually > created for the DT node. This way, fw_devlink knows not to have > consumers waiting on these newly added DT nodes, and to propagate the > dependency to an ancestor DT node that has the corresponding struct > device. > > Based on a patch by Saravana Kannan, which covered only platform and spi > devices. > > [1] https://lore.kernel.org/r/CAGETcx_bkuFaLCiPrAWCPQz+w79ccDp6=9e881qmK=vx3hBMyg@mail.gmail.com > > 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 > Acked-by: Wolfram Sang # for I2C > --- > v3: > - Add Acked-by, > - s/instantiate/probe/, > - Improve commit description, > - Add comment before clearing FWNODE_FLAG_NOT_DEVICE, > > v2: > - Add Acked-by, > - Drop RFC. > --- > drivers/bus/imx-weim.c | 6 ++++++ > drivers/i2c/i2c-core-of.c | 5 +++++ > drivers/of/dynamic.c | 1 + > drivers/of/platform.c | 5 +++++ > drivers/spi/spi.c | 5 +++++ > 5 files changed, 22 insertions(+) > Applied, thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel