Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1648763rwl; Wed, 5 Apr 2023 22:03:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZRbaDHccSTegjzPQPQ+/lArB2vG6EPpL+DWWGHW1i+E8+U6NvizTqrgYFW8TI1hjZQl09m X-Received: by 2002:a17:907:20bb:b0:93d:cffb:80ba with SMTP id pw27-20020a17090720bb00b0093dcffb80bamr5228037ejb.66.1680757438576; Wed, 05 Apr 2023 22:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680757438; cv=none; d=google.com; s=arc-20160816; b=C26GiUPo/Kd1OoeJFMxA5tsmlEh6jSORSLNbb+hMRKvn1jOMWEatEbxyj55A6+NMz/ HM7Fm5vL/JSmUsa4cpHLplSyanSFK1SY1T8vpqUici2mldU5JWMv6IaaZjJUwVHutuxC g78qIibLDD3+Tx9CTcquzSvly9Z4EQfyKFjALxIVjBuq2LXPpTlK6Oi5LG3MxlldGAmT NrPpVYbh1doQUsuKx3yYRwt7fe6z9bg2Tr1+rWs3IjJE8hman/uC2OUM1YwXDBqma5HJ VfIbXYrY/7liTlEp8wG/f/IMYVegU2XMamTSPOppaD7TAbbU6i5kj7HUcBQvQJABhPlP Hjqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O2u4n+8zw5dAPgyvRl+8cHb6XpQzJgf2QeoojA7fbkw=; b=C+xEZZWGZWOaVjSJQLjM1PbOKpYTiELGXulSKNW71Hp+GwBav3HX722E/ALL66VyOm AYJPtaQRdA4pbxhLdX8ATuEgq7m+ksDOFHrD1q/03+nBynZr2zp+7OadYq0evcI6zkfq kBTw77aoJ8jxVaLPGrKYmEfPGt6ckwbSN7yscLS03z1bYpbamSkJLDb2XdBC9i9yUqqJ 87ux6ohOW1fKGLO7K9aqNs1Na1CEIDwtEAr03orlOuNpM28QVJY8VFa1WPdE1JFtVhbi 6xBALguBd4ZTyH4ZMFSXKdGemKSobLZGyWdzRATPi5mgQgQ9kZivjeyQdinZbt8ffXBa GOfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="A87TQ/3n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb37-20020a1709071ca500b008d6b51de6bcsi632115ejc.32.2023.04.05.22.03.31; Wed, 05 Apr 2023 22:03:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="A87TQ/3n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233910AbjDFFBr (ORCPT + 99 others); Thu, 6 Apr 2023 01:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233603AbjDFFBq (ORCPT ); Thu, 6 Apr 2023 01:01:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1759B8A6F; Wed, 5 Apr 2023 22:01:45 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 905DC6432C; Thu, 6 Apr 2023 05:01:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D1ACC433EF; Thu, 6 Apr 2023 05:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680757304; bh=XN/KRAdjSBdeqgfcMqrTsnTfe3Vagj/AOgBnYovfOyE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A87TQ/3nKu7dpkq29cB6AZUxd0BatdWJoOS/V+abIZyKjUJt3UGdQSOc0G+Tqps1x 4/awB5hY3qpUgQ+ASW+2u6M5LsP2YSWU6hiLUPIadfU72iw06YHioY21KbEuxL8lYM QfhNdjKdR4Orqi8JhtfA3UiCbq49QLF9797gHYKU= Date: Thu, 6 Apr 2023 07:01:40 +0200 From: Greg Kroah-Hartman To: Rob Herring Cc: Geert Uytterhoeven , Mark Brown , devicetree@vger.kernel.org, Pengutronix Kernel Team , Saravana Kannan , Ivan Bornyakov , 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: References: <168072737082.449372.6122824582508382689.robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <168072737082.449372.6122824582508382689.robh@kernel.org> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 03:42:52PM -0500, Rob Herring wrote: > > 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! Oops, I thought I had to take this. I'll go drop it from my tree... thanks, greg k-h