Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp804502lqb; Wed, 17 Apr 2024 11:07:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIdw+B467y6MwK7XwtXjzEyKuyP3wwPreZSEVZzPpxEabixLDemsyYA3uwpEKsduRujJ5LN2kXazPj9cB2oFrIYE8bnJORjMzRACqFtQ== X-Google-Smtp-Source: AGHT+IHYkiW/uE+nzLrTyQ5xa5pltUa1STEFx5r+NwqEcEeOeKs9RkQPIcdtnWhhSbL4O0/YUSZW X-Received: by 2002:a9d:5f0f:0:b0:6ea:2b3a:f389 with SMTP id f15-20020a9d5f0f000000b006ea2b3af389mr255005oti.29.1713377263498; Wed, 17 Apr 2024 11:07:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713377263; cv=pass; d=google.com; s=arc-20160816; b=E9OLVB3OANOoGPhKl4dcOZPk0wA3Wj1LKQVj3ogJILkP/OxR0QI64HyCmyuPPdwEQ+ b35LEtLmXaVK+IAMHsZODwbdpFMmZRZPA5228zCa3fr9EJv9hWZsgWnw23LsXQxdQJaS CjAoDNmA3Slny8Ewcm5bq5k+8AxkiSdk6AAd3xZ0LHMVc0oeR3LUSt0Bf46LiZYHrCau UIH8FVClXTE5yOxCD6/suLSye/9SSf9uJB+15SoSdGozqiT4TH6YST5B6r9YxdkBQ5sd 9IqNsuUFETHukc/TT6hNkwD090DBuU08qiMW+8mWTJXIU6mrDI+8GO7na6TYGFqNVIhz NsKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aHhdzh+236wkGL8hUiPC0RC92WzDlpIrjmCSUf8X/ww=; fh=ygSZoIl28KXZMqxc62ATcSCqyue1uO417yv9dfz2J6E=; b=T6SQntvwkjKHe290g750gOef3VkWYoPvdT34vlheoV7vp2EiKyuOeRraKATSyXe8AG QdvH0vGQKCZJ5GeCxhKbUdZZwjzK+6AZ7XvP/IwfvklYyI2NiLTtfPFL7xSEhIjh3JgI dqYMfInV34AFmXm02Zv99Cm9+MRu13pjs7c5Mm801BgQgOT9LjxpV+dl9sjnryfFXm/U yKCfKB/F0nxzHrQOLnLfI7qRHJSiI2zCb6AEmfroXAJB4bf8JPEY/tuIjUWud7zdzKv4 aOBhzj6zcpCUxzTUczpDJFhvDas3OPyyNQyKPTldjP9CHjusO2OAty0QrgvEIE01k7v+ I9kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GbJEYXxa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-149032-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h29-20020a056102209d00b004787207b10fsi2395990vsr.13.2024.04.17.11.07.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 11:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149032-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=@kernel.org header.s=k20201202 header.b=GbJEYXxa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-149032-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 E1C421C23BC8 for ; Wed, 17 Apr 2024 18:07:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49737173326; Wed, 17 Apr 2024 18:07:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GbJEYXxa" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 699B318C19; Wed, 17 Apr 2024 18:07:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713377246; cv=none; b=LnzOPOWL9dqv+IzkNFF2geiCdFb4eDMBrAOh8Zfs6plecbJwe2U1bDj0plpfovqvrOrbwQarpe76gUFd1Q2uCq2QHg44hW9y73PbS/qMH7f3Oe5+9X5R9O5XqC+CNjHTP74Ro5idQCQz7EhbC+c2GbvFcrW+3KFGO2MR8ZDy77A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713377246; c=relaxed/simple; bh=TOQT+ROLVGODSZZzDLrHzeqr30Nr45aSCcdnwYTfuis=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PeqNPZnPSAh+oAQ/RnlSUV8XQzA9WsJMLwUCC9PQPhPOkhkgkV31KM+DivHg+XDp1vKkbFhwQ8y3v9Gs/QXzTTxX+zCdftvLdwMTV82RvilnZIJ6tALhAGhU9zE4dpsdl5YMy4cURQXyJei8YCghoJoEwq4DSwFsXHPe1V+TQSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GbJEYXxa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E391EC072AA; Wed, 17 Apr 2024 18:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713377244; bh=TOQT+ROLVGODSZZzDLrHzeqr30Nr45aSCcdnwYTfuis=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GbJEYXxaVWv2RmvjdIC015OQ+Tiz7UNUBsJ9fcR+MgxN7rX+cVopikvhM5L+lIl4v aZnRDFniuJB6eJdEIgmF6cgMP2bbeLEA4yFeRsk8NWKhB1nn7rnZxT4kY+AhY5oLCA Ezgg/r54tYzKk9p/ikaizbVHkaBzpIH7rJJ/yRBM3sKYQ0q0IUEFChWdhlqbp+38Wl VVV29KlNRDflMk8FNtO/dP8BY6P/oVpxREKkid+Ph7zK1injZTfUzGXPyZD6zTZ3NV xnYjb94kJqK++VJF0hdba/OPb28FZtRyGO5TWQcLqfOSBOZ0x3xQ+78/8vgYTvWxYF +9fUCqWj4iaEQ== Date: Wed, 17 Apr 2024 11:07:21 -0700 From: Nathan Chancellor To: Maxime Chevallier Cc: davem@davemloft.net, 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 , =?iso-8859-1?Q?K=F6ry?= Maincent , Jesse Brandeburg , Marek =?iso-8859-1?Q?Beh=FAn?= , Piergiorgio Beruto , Oleksij Rempel , =?iso-8859-1?Q?Nicol=F2?= Veronese , Simon Horman , mwojtas@chromium.org, Antoine Tenart Subject: Re: [PATCH net-next] net: phy: link_topology: Don't stub-away the topology creation Message-ID: <20240417180721.GA3212605@dev-arch.thelio-3990X> References: <20240417142707.2082523-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240417142707.2082523-1-maxime.chevallier@bootlin.com> Hi Maxime, On Wed, Apr 17, 2024 at 04:27:05PM +0200, Maxime Chevallier wrote: > 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. No worries, thanks for continuing to take a look. Unfortunately, this patch fails to build during the linking stage for me with my configuration: x86_64-linux-ld: vmlinux.o: in function `free_netdev': net/core/dev.c:11060:(.text+0xb14030): undefined reference to `phy_link_topo_destroy' x86_64-linux-ld: vmlinux.o: in function `alloc_netdev_mqs': net/core/dev.c:10966:(.text+0xb142d6): undefined reference to `phy_link_topo_create' > 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 >