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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4CBCC4167D for ; Tue, 14 Nov 2023 07:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232248AbjKNHq7 (ORCPT ); Tue, 14 Nov 2023 02:46:59 -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 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.41.0