From patchwork Tue Nov 14 07:46:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 164747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1705387vqg; Mon, 13 Nov 2023 23:47:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkIA+Z589DYerWlvoInPKFeuhUvXmmY610Nq6PCtV3YN5rFxHIH98AMMjcJLHHSthG/yW8 X-Received: by 2002:a17:90a:2dc9:b0:280:3c60:bd2d with SMTP id q9-20020a17090a2dc900b002803c60bd2dmr7167477pjm.15.1699948029616; Mon, 13 Nov 2023 23:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699948029; cv=none; d=google.com; s=arc-20160816; b=xa9W9biqQpjS5Qovr8OPUN9LCLaXAXyWAtYSud5LD6KT7eQnRSg4y6lNisgzk9esj1 oOrohWXh3TTONLf9UkN3yUzQWAjlNrkifdGpVLo6Z4I7cbOvlsKlmTGDHaJ7FT5adh3T qfLQ0JH2ZpAfU8RjGNHf41RT2dAuO7BpmluP+pUHXpwAyrvmSiSUIyLZF7U0GXs1NGVa SSBkMPwVDQUu6dUJztmoir/wseMPnPpoiwQiWBMNOHGYzNBL/cwfTVKMMPPBytP2OuSA Dfby8FwaDabp1ytbW75EBan5E8v/oLZvpQVUwwdQtPWXWY9xewSCmRncBgIxKbxr+WgE B50g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WSqWkMKT4hlIo0Hft0JXkPwNJp2PZekuBZnXLftRgw4=; fh=YQ+3yFO0Fo6peIMEqgrS60vnAE3S69xOrXlvAB5tsxM=; b=bUy2YZUKH8EVjx2h5VYvWNhuG2Nnjmpau+Iw1r3Sf5sqLv/MayJk/L6tscEerUGo/3 v5YVNuNfZnO1080jvBoO482fCKlMA7mV1PpdybimMBkSS2yhseXf5APkxSxJbYhvA1oi NuJ0G3mjR5zphS/0DScRfyJSBey1x/xLtlCq2WAMXkjLAHjZHtHCpsrKtQmnyG8m7y4q eKLmfSb3hhIUXNVRQtCG/5Jb5KrDtNoA2diQATBqS/xXOi/D0fQlsi0LUN9dSB5YwNch Cova8D/uK3gm+6VqrBh/1bPLQQQjD78tPHH1GuTck2Sz4Q+9owRdTYRUsN1xmfHMPjAt ZDlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OuRD1zr1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id rm11-20020a17090b3ecb00b002764fc15dd3si8191999pjb.37.2023.11.13.23.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 23:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OuRD1zr1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5790C807E51C; Mon, 13 Nov 2023 23:47:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232242AbjKNHq6 (ORCPT + 30 others); Tue, 14 Nov 2023 02:46:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbjKNHq5 (ORCPT ); Tue, 14 Nov 2023 02:46:57 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 740401A3; Mon, 13 Nov 2023 23:46:54 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id B9A7824000A; Tue, 14 Nov 2023 07:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1699948013; 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; bh=WSqWkMKT4hlIo0Hft0JXkPwNJp2PZekuBZnXLftRgw4=; b=OuRD1zr1JHlFhd/s9EKNWu1YgcODmlldoi8th8WmxXzC253V98Yxh3AguSHjJruVVZYzny Nvdyl+hxOQtnqcjJnXIV79evSLByXrnpHRnD1kQPLBI/wSaiG55j1VNODZ9xaTwhqjZg8a BgZmDSVD71zK/zPt+xfBd9XFOBtZeNXgtm/t2iVfvKbp9OgdHuPWcI13pXTY4d0ShrBYMM b6LpCKb/Pi1DCVeYpCMZ7eDor0HMEib3tSFOCQSJagJ25amfJuXfZG9ygOO/jiCkWkls98 4J2JYU9A1TApE9/imXNWDu1Hjvy9eTxDBooyLIG9ei6syummlWk0q7lzkeRurA== From: Herve Codina To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Saravana Kannan Cc: linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Herve Codina , stable@vger.kernel.org Subject: [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device Date: Tue, 14 Nov 2023 08:46:32 +0100 Message-ID: <20231114074632.192858-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 13 Nov 2023 23:47:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782203211537462856 X-GMAIL-MSGID: 1782524704968708636 The commit 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links") introduces the possibility to use the supplier's parent device instead of the supplier itself. In that case the supplier fwnode used is not updated and is no more consistent with the supplier device used. Use the fwnode consistent with the supplier device when checking flags. Fixes: 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links") Cc: stable@vger.kernel.org Signed-off-by: Herve Codina --- Changes v2 -> v3: Do not update the supplier handle in order to keep the original handle for debug traces. Changes v1 -> v2: Remove sup_handle check and related pr_debug() call as sup_handle cannot be invalid if sup_dev is valid. drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 4d8b315c48a1..440b52ec027f 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2082,7 +2082,7 @@ static int fw_devlink_create_devlink(struct device *con, * supplier device indefinitely. */ if (sup_dev->links.status == DL_DEV_NO_DRIVER && - sup_handle->flags & FWNODE_FLAG_INITIALIZED) { + sup_dev->fwnode->flags & FWNODE_FLAG_INITIALIZED) { dev_dbg(con, "Not linking %pfwf - dev might never probe\n", sup_handle);