Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1665460rdb; Tue, 20 Feb 2024 03:25:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVl80Z0BuJynaKcY9jKC/MHDcMsXvkDE4o4QAvg/OKriKWaSBjNivRLJcgvrSI9P1JsbNZWmE/fzB682QJgVDDFqtq5nPJefEp0X782jA== X-Google-Smtp-Source: AGHT+IG1DmQyfhB4XUbUNFBWN+SIp5kZ6+UINoF1RiwDaLkq9MH5wm6pxrlp2/rA+WvHKoopRxa3 X-Received: by 2002:a17:902:8a90:b0:1db:6338:63cf with SMTP id p16-20020a1709028a9000b001db633863cfmr13614808plo.49.1708428315845; Tue, 20 Feb 2024 03:25:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708428315; cv=pass; d=google.com; s=arc-20160816; b=OvFwUgTFNomk/ZkM7GzcTVUwfa8kdONIwOPSAID2tQPAS2LLB9BCGyVq3BAMCLd+l/ 10Rh8dJ8gSbyEsO+OnQvQfF5EnGMdLA9IPMwnbYe+1TArHUwalFsTcJIomOfi23aFXoR 8jZEMptTl488j+CZBgxz0e/CrLAgek2fu3oZU5rVQgkiZIQvQuyQkHt1Qb1J79fmcunx heS0cQOHYO+RCcIlNdnAk5OgFzK1/7VJB1a8By3aRKA1V4Fx25wtvVhPP3XK28Jyu3Gt Q7NXR5uKcJd2dq4eUe6nW4/syB/MNqYiVRL4B24JmIB8BRViVTG9e3P5F0fDgZKarU1y s9kg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dIMzuvrtDamZE0HiEkiJxqOPfEthKIYmnyBT6Ohkkxg=; fh=njSy/rlbAoKk1TdE9G+RzNVawG67mOpp31Vpsfilr4g=; b=inekXfJ7Er5S00x70GlLzbnOItRyri8biRUKZ5c74LPAqLgcH0JgBCwL8DC48vVu72 VPt+7HcNBm2Pe4UhG1OxdYOP9HHzkK8h+TdxvtTxiO1oWbpTS34etbt5rxKwU4NUYmoG 3Tv2VXOz6Uj/t6otYYvG4HYteLhwgjFcT71vzmkcvAg5VAq49rshx9npoPqpUNKtq4hj VTU8HjLs7LZpngJ4Y08/EiVFNWaBmjGlyAJ5O2ZfaUO7MEEw1Uuwu3vmb1XWbdxgPeie P8cvR4WIkJ7WwbJ5j8DucckzI/+ID1YpfemlFixTPwnMMvGjznf7cx5l71ZyyYFk2ZVH XVOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BSSqGygS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-72880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k16-20020a170902ce1000b001dc1284bc01si1337483plg.326.2024.02.20.03.25.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 03:25:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BSSqGygS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-72880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 428DEB233BC for ; Tue, 20 Feb 2024 11:11:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D902267C59; Tue, 20 Feb 2024 11:10:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="BSSqGygS" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7826664CE; Tue, 20 Feb 2024 11:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708427459; cv=none; b=KTZyC14ktQClUCiXAIk0pki1PwXdJAihePlEPannGM0rJiMl9l+vQmjkQ28PwjEiZhMan2eHKHiPj3IcpSKMPfezMe/mMnItlxWsacByzzcFrKil6D6PYM9lCRZeo00tOOiquoY0L22D/qr7vUVbN+QOX1s1l9thJWQT1TgNnXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708427459; c=relaxed/simple; bh=eRdcavBrbS7Z1tgoLtld/S/+yifdcL68SWTMBVmtqiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gdZrQjECEnIgtDZJfEQ4z19X/uhT0LuJp8n+D2dJAv38+KFSzJDvjqZ7hm8Dr7hCXRiFeHiChWP9boLUtdsoste7HM3xYdt+GyWNnUtQTEIUilJbL6He6CiO17pGst2hCMeMFmeqdrSwaqLBQeeZyAXzTHDR0qrSrjuxH9+7vo0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=BSSqGygS; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 8228F1BF211; Tue, 20 Feb 2024 11:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708427455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dIMzuvrtDamZE0HiEkiJxqOPfEthKIYmnyBT6Ohkkxg=; b=BSSqGygS1kfJ6h9uzsvevdfUzDbIxGanc5XtUCMUXQGcdCnf3cnhtH0K7dvIZnvx1o4gv9 pb8b/liLFtzXzfv9QHiHxYs6OKadiTWet707mwjuUUWn+48AZGNzUacFArNfD7qRADz366 CH7XVs+tmLzCYIaR1jRaQEG7WipxeK+paTL9zXrHvGFqFqITUr+onbxt1Z5ZZ6T7Tenksz zNJl2XJlmMUsG4+Ok1TjcDClxVbHO4MsSQ8f0AeKsDJjegLT/08RTNak4iyejl2G4ZRJj7 8CLqxjwkIZXE4ur2TBC4seu3WJnSSrkMS9zlPTkP3GyxV9kpZb9GR2Trg0DJVw== From: Herve Codina To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Frank Rowand , Shawn Guo , Saravana Kannan , Wolfram Sang , Mark Brown Cc: Geert Uytterhoeven , Rob Herring , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Ceresoli , Thomas Petazzoni , Herve Codina , stable@vger.kernel.org Subject: [PATCH 1/2] driver core: Clear FWNODE_FLAG_NOT_DEVICE when a device is added Date: Tue, 20 Feb 2024 12:10:36 +0100 Message-ID: <20240220111044.133776-2-herve.codina@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220111044.133776-1-herve.codina@bootlin.com> References: <20240220111044.133776-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Since commit 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays"), when using device-tree overlays, the FWNODE_FLAG_NOT_DEVICE is set on each overlay nodes. When an overlay contains a node related to a bus (i2c for instance) and its children nodes representing i2c devices, the flag is cleared for the bus node by the OF notifier but the "standard" probe sequence takes place (the same one is performed without an overlay) for the bus and children devices are created simply by walking the children DT nodes without clearing the FWNODE_FLAG_NOT_DEVICE flag for these devices. Clear the FWNODE_FLAG_NOT_DEVICE when the device is added, no matter if an overlay is used or not. Fixes: 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays") Cc: Signed-off-by: Herve Codina --- drivers/base/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index 14d46af40f9a..61d09ac57bfb 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -3619,6 +3619,7 @@ int device_add(struct device *dev) */ if (dev->fwnode && !dev->fwnode->dev) { dev->fwnode->dev = dev; + dev->fwnode->flags &= ~FWNODE_FLAG_NOT_DEVICE; fw_devlink_link_device(dev); } -- 2.43.0