Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp139390lql; Fri, 12 Apr 2024 06:18:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVly3V/GlIJ5LhOm1a6KkWqHpqe3oKJdtua4DcUuFSs3r9bccj8eII08bDNLr3cTaFxdxuDLOH4saRJHWE4rv7dY0D8aT6ZU/7S5OUMlA== X-Google-Smtp-Source: AGHT+IFvATz6kr/nG/1vY6nbBnwQX3PlaMIjRZBF4cg0ZIPsIjDbIxsi6zjt1YiMDKfssiVdNZsL X-Received: by 2002:a05:6a20:244a:b0:1a7:9b9a:7583 with SMTP id t10-20020a056a20244a00b001a79b9a7583mr7665033pzc.8.1712927916671; Fri, 12 Apr 2024 06:18:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712927916; cv=pass; d=google.com; s=arc-20160816; b=I50H9ndhxyHvREc5Ck2g6ZirIf++Rk8OcVbfA/54UOjpa6s4B8EhANYc2eSq97V4Ec lRq8lQxBcUc6p3lO06fLmVDaZJVEBDFyWK+JbJupVBTZVW/cYUDzhdww0PgR5/d0y7/e tBlKa55gC/MBcd0eCUcpPkYqm+DXXFA/YVlt5F+70rvlI9xUqyFg2bg4LRMavh0re3dL LiIw5nuft8X+cgxNsPUKWJi7VQSSEmFvzTd5Cc3S5ipM1Sx6YdirROsE+KuMd7IgzQjn FwSrNp+JCCDLRUo3jIgk9rM0MGkoXvHE1pbyox6AIUEMAcTWd36fgUeqo2ZkWx7rq2YM 4Yew== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=O5+3+rElzUNybXHG/ZwL7fFM6Iw46bn7txCnEsQ1q2w=; fh=D33VNSUtKG5TfUIck7t+K1qzbshshl73xV5GZZAmvOk=; b=TVjmd+24qNZqKh1wOV3f5Wnd8DuRYdUdr69PzHGMm/6IR7f7x8iGDB8PU2PdAZWR3E J7glYPVAMSDvVwgy5IGTiWDcenq4sC9qTAIV6fUyCmxvDgvVovby5p91IDGsyXiF5CNK IfWgGth4T9Z6CUoCg6yuKx1uwetLowJ8OcVGARllubgOktlliXNzX7Fp+bSA60+yKNan Us0C87E+ePda4mYQbwXXfR/8yDxUCY3+rgeKV11MinEA+vtYPaC19A7WZOvo8GZyT17p 5A1w2A6rZZPfu4ELTSsbjF5WSCcvr6CIHPZU86A3lTMFPgch2WxJm9aL7sVdLqKpBIwE qVRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lT+dK4IB; 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-142704-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f16-20020a63e310000000b005dc42c4775csi3188209pgh.822.2024.04.12.06.18.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 06:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142704-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lT+dK4IB; 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-142704-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142704-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 18DFF2853B0 for ; Fri, 12 Apr 2024 13:17:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 696A069979; Fri, 12 Apr 2024 13:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="lT+dK4IB" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 EC67666B57; Fri, 12 Apr 2024 13:16:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712927815; cv=none; b=mBBMR6Lq5zVpv5aviejGaKEhnAGiYhJ2JD3PeamEi5j3+CpyR5P9nM/nbXrh32YRKuvVWxQfJ7LEFvMKZxo4NDfNuZ/+0Wmj50i3epfMKlgAAYoCYemfNOUl/Y7VlJZzccbzlEbI258J1WgKxMrnW6u/Tms1B7gqvuN9QEXceWA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712927815; c=relaxed/simple; bh=USOM0XCZ0/wu4cKnQkzgmul4MrjCVr2FMP7oVZE2duc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BK0Mk5x2Qnob7xE4loO3u0djxEo6/5O6YMIT77ltKc7vW0Nxc8q2dg9FTQdeKM9Xc0qIW8WbbctNrhrJgQnaVZOIAggDV6db5nTVUD0+ecobObvOsOJlLnq0KBec3DA5Z7EpRPLb7JknN7XTmR/vb2zMsTXpqXd9WQTVTl+5sm8= 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=lT+dK4IB; arc=none smtp.client-ip=217.70.183.193 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 C3A03240004; Fri, 12 Apr 2024 13:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712927811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O5+3+rElzUNybXHG/ZwL7fFM6Iw46bn7txCnEsQ1q2w=; b=lT+dK4IBl81ohQ/NsUOa/zq3G805EZLYGAN0wFqWK2ljT7vjQaRpWC3Qc03ndnkG3TgUpm y5JxQB8JVB0AWSxNHLhB5+9J4mEX3PQHvJKATw9N02+A1o6CzbVSlRScL+Vvw4fEzSikpl Ar+zsj31zbD3D8pmx1BOjkGhR27phYPcPmg5VPaBym1oM8z2jNl5tRBaCzSEBBKeFseFry cllGgnhW1ZjimKFdazfcL24xB0XWJE/p0ext0rfJE3JAPM06bwiaJOyBbVXewadjWe/xwk pCmfiIrcTavpUHqLfiguFM7YV/WI8W9/qJe/FGcWsa2fYLeJkyaFrnrc8r+T2w== Date: Fri, 12 Apr 2024 15:16:48 +0200 From: Maxime Chevallier To: Antoine Tenart 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 , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman , mwojtas@chromium.org, Nathan Chancellor Subject: Re: [PATCH net-next] net: phy: phy_link_topology: Handle NULL topologies Message-ID: <20240412151648.653d41be@device-28.home> In-Reply-To: <171292699033.4917.4025686054785818967@kwain> References: <20240412104615.3779632-1-maxime.chevallier@bootlin.com> <171292699033.4917.4025686054785818967@kwain> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) 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-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com Hi Antoine, On Fri, 12 Apr 2024 15:03:10 +0200 Antoine Tenart wrote: > Hi Maxime, > > Quoting Maxime Chevallier (2024-04-12 12:46:14) > > > > This patch fixes a commit that is in net-next, hence the net-next tag and the > > lack of "Fixes" tag. > > You can use Fixes: on net-next, that still helps to identify which > commit is being fixed (eg. for reviews, while looking at the history, > etc). Won't the tag become invalid when the commit gets merged into an -rc release then ? > > > diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_link_topology.c > > index 985941c5c558..0f3973f07fac 100644 > > --- a/drivers/net/phy/phy_link_topology.c > > +++ b/drivers/net/phy/phy_link_topology.c > > @@ -42,6 +42,9 @@ int phy_link_topo_add_phy(struct phy_link_topology *topo, > > struct phy_device_node *pdn; > > int ret; > > > > + if (!topo) > > + return 0; > > + > > With that phy_sfp_connect_phy does not need to check the topo validity > before calling phy_link_topo_add_phy. The other way around is fine too. > > > @@ -93,7 +96,12 @@ EXPORT_SYMBOL_GPL(phy_link_topo_add_phy); > > void phy_link_topo_del_phy(struct phy_link_topology *topo, > > struct phy_device *phy) > > { > > - struct phy_device_node *pdn = xa_erase(&topo->phys, phy->phyindex); > > + struct phy_device_node *pdn; > > + > > + if (!topo) > > + return; > > + > > + pdn = xa_erase(&topo->phys, phy->phyindex); > > Same here with phy_sfp_disconnect_phy. Ah right, well spotted, thanks ! Maxime > > Thanks! > Antoine