Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp660991lqb; Wed, 17 Apr 2024 07:27:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1W4i8uHCf7L84GIi2OlLg/hHq7DRVuLMjOhJvdqWrUrjyEMfWnmWMaDNau3VLV0SwfbZNAvmA1sRPOsAa6dxVQV2EUbJ//kGFlAPPTg== X-Google-Smtp-Source: AGHT+IEvGAQgQnwQaxPIHBMfqV5bY1ZD9W/04Hk33R8NmuX32oUEaD+KuH2NvyOPgfoaxiAnguCb X-Received: by 2002:a05:620a:167a:b0:78e:d140:c2c3 with SMTP id d26-20020a05620a167a00b0078ed140c2c3mr14872514qko.54.1713364056277; Wed, 17 Apr 2024 07:27:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713364056; cv=pass; d=google.com; s=arc-20160816; b=iRqsH/UJnrAxWyihiO+BoIqNRcJDWLD+Tptja92Jqv2ChPE+wpOfzcRRU2RLxLoSo3 u8hfk3qf58VaXa7wh6Qr1oyO87m308CHoGtxYR6f3Q+d0tXuuGkywrkc9r6QoJwSiLlS /t5BZu7Ac5K0e0NFXQqeffPtiyFO4uVnGSKL1373r6VA1ik7BofFwyutMGqYMGmu56Il CurCZ5NvmzhnDbEypBPXEhmdcg9jbO7nMIbwmp77FjA9xxe5EH19sqgNePtbuUZGChud 4+QfC28oJ7Aws+K3JZcFhPE9DLRDFry5Z5dWPWiq9IzYhpROOFyTGbSs5UN+X0jwnAUM qcRQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=+gblB2roJbwC6k0Ap41QA3FYglfv4FFJz0F7EnAebFE=; fh=Dinp91LF2KcnzfyOXGg1vCezYXJAYX+8GKPCxLQjq1Q=; b=BuGHE5Tpyk8FojAI9CBYpfavCnsGFfdnTyYKWvGs4fpD+ky2YAhMEuopmQ0MYjhrJy xO9Gtr3KwdCimXPzr4TOEyhpwVkFzRDVpRHW7LyXFHr81APoNligkp6+wUHQ9P2jbaIk Old8PQdO6QOta156bY5+A5UcQzIaaF3plUQwu+Tih6N2CkgKCl7J3Tx1DshcymLGdZbA 1xtNwzIvo9SCVKGT8qwzG/6ffF/1sKu62SYi9+afy0q5tCuTv/3Ckx0RmddlwGNqCBZH MyyAHe1D8qRRiIUVCzshcH5bQu23Hdi8Xl16yW/AASB1r/pNPZ2BP9iUy8ra2w0/emnq SFqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=XCQvZbM4; 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-148673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t27-20020a05620a0b1b00b0078d6cab4f55si14878605qkg.571.2024.04.17.07.27.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 07:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=XCQvZbM4; 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-148673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148673-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 071971C20D47 for ; Wed, 17 Apr 2024 14:27:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97B781419A2; Wed, 17 Apr 2024 14:27:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="XCQvZbM4" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 27117140397; Wed, 17 Apr 2024 14:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713364049; cv=none; b=fPVfzLUyIICJC2WLNwsRQaGbFnjDDQxwpw3oSIILQPngbTeue28Ks0d6P+gw4kL9qotPRL/vfaJpGc1urikuIjSyREdP0zjB/1FTssfCEsqZFzwjHLFRvWyC8eFfl3RAnbu2hwQuOKaeJI+ZwJMplV6MuuEqt39DAfCG5Xw+Le8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713364049; c=relaxed/simple; bh=K+f/3Fw0l/IbMbZkGP+l5j+8E9MRO2mxZSVM7HRjjgU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Tho4BYbHbMpkme1FZrnPq35Y75vHQBMoD1jYLIape1Uq02nIaxJ8caBbOiKUxk1BtKCKYR4hHlhvR9IZWAdtvO4TPUnP6pnEVBbXRf7IrrEt4zTeYEJQS/lMCmfPFUMYz9kMD9yeuNwe9QzsxQnRNmme0K2iX++2yfnatAuuny0= 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=XCQvZbM4; arc=none smtp.client-ip=217.70.183.198 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 ESMTPSA id 4F879C0011; Wed, 17 Apr 2024 14:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713364044; 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=+gblB2roJbwC6k0Ap41QA3FYglfv4FFJz0F7EnAebFE=; b=XCQvZbM4nqNpj6mMFURbYjC7Sp/+tvMg/HEtaMxlh0cCcgU3JtIHPxNUETADzJzzbISEUG CwbRAHSEthGj0nEzp1Ab6SSx0aRONpZkAf6zrALy0SOA/d35LpzEiU55ZtmAsbfGCJu3AS 8x33SC7ycOCYTD9XSUvlGipx1+lFMbdavNFj2hp57pzYBUsdeRuwkZe+jkGOKCuukXpBlb WMOt/ByIdnwRdgLm71mwRbFK2v4NDejcZh9Gh7rqQfro20z8PhhEHNHiaisDcLLCPF9u6l +iSysDrG9ODCQSLJCVUgpJ8qZ/flJ93DOGL0YStli+0eiXVTEFJBZp39bnBOjA== From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?q?K=C3=B6ry=20Maincent?= , Jesse Brandeburg , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart Subject: [PATCH net-next] net: phy: link_topology: Don't stub-away the topology creation Date: Wed, 17 Apr 2024 16:27:05 +0200 Message-ID: <20240417142707.2082523-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.44.0 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: maxime.chevallier@bootlin.com Some of the phy_link_topology operations are protected by IS_REACHABLE, which can lead to scenarios where the consumer, built as modules, sees the topology unstubbed, whereas the initialization didn't occur. Don't stub away the creation of the topology, it has no dependency on any other parts like phylib, so we can make it always available. Signed-off-by: Maxime Chevallier Closes: https://lore.kernel.org/netdev/2e11b89d-100f-49e7-9c9a-834cc0b82f97@gmail.com/ Closes: https://lore.kernel.org/netdev/20240409201553.GA4124869@dev-arch.thelio-3990X/ --- Hi Nathan, Heiner, I'm currently at EOSS, so I'm sending this patch without having been able to properly test it (build-tested only), but as this addresses an issue for people using -next, I'm sending this anyway, sorry about that. Hopefully it can address the issue for now, I haven't given-up on your idea to introduce a config option Heiner :) Thanks, Maxime include/linux/phy_link_topology_core.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/linux/phy_link_topology_core.h b/include/linux/phy_link_topology_core.h index 0a6479055745..61e2592f24ac 100644 --- a/include/linux/phy_link_topology_core.h +++ b/include/linux/phy_link_topology_core.h @@ -4,22 +4,7 @@ struct phy_link_topology; -#if IS_REACHABLE(CONFIG_PHYLIB) - struct phy_link_topology *phy_link_topo_create(struct net_device *dev); void phy_link_topo_destroy(struct phy_link_topology *topo); -#else - -static inline struct phy_link_topology *phy_link_topo_create(struct net_device *dev) -{ - return NULL; -} - -static inline void phy_link_topo_destroy(struct phy_link_topology *topo) -{ -} - -#endif - #endif /* __PHY_LINK_TOPOLOGY_CORE_H */ -- 2.44.0