Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp127957lql; Fri, 12 Apr 2024 06:03:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUOV//m8FR+ikNxz5nq6OqZNRV+aSYAf/s8ZRY1FER4kVcAsDmB2lA8BSKDODHuo4LdTzr5jVus+VVDOMuBvvSBeThqnAxRlTVV/lqhGg== X-Google-Smtp-Source: AGHT+IF+MtOArL/ZhRLZsS/81wQIYdJd/8ZBbkZg5OfN6FbyylBRMsnbEDmrt/NwJ/0C/xl+n0Mu X-Received: by 2002:a05:6a21:789e:b0:1a9:6d13:d5b7 with SMTP id bf30-20020a056a21789e00b001a96d13d5b7mr3057069pzc.37.1712927002851; Fri, 12 Apr 2024 06:03:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712927002; cv=pass; d=google.com; s=arc-20160816; b=VqVZQo1vznlTgUr5QzDGNWu0UDR1D4PMn3pars195LStNjN+uzmXGKG1ph1HQhR3do 8pVw2bP6UwsShA7kRbrMfoZCAoR11vG3xIA0LjfjWta6vSyUptSRHomMYx6XLdmA+4FE QL1w+YgwlH0O3h/72b25pjjeJvn1DllqgcCdcF+HnF02Lb25xYij6my2AfvNIZQnKMjj kI6cwPhvAa1EnVvdM/UW1W3XReeOktRgMoMUwrZtRq8rXqIhMfOBmQz1f16nKG2k/J6M NJgKzJfa55x+IcP2WXRUZoYS7ayY+DAGZ6Zn/xLxLaKgHwfKI753aGtLn4gXAk2KSw+H 4SOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=rHbdTEhf++mXGMzATAt0hfMed0fjiDZaFMtdlKaiHbs=; fh=W2MGO9Sf4MlpH8/FAJbC44ceWoCOdQBlRnYZ9D7+9po=; b=cWF7qeTYKTc3oNA+z3Q/b9mE2/uSIhfjC9kV5ck4TOalxl+lNYc1QAjMFWFjaLBar1 ZrpgBbRTpHbld1n/1Oo4vlA19WQOgAmMGLP3amT/gmSkgdZZx5P04uHTNuPZ5EYHTBkD ZwnLlRJLpJLS0OvwsTNRW8lexj2O5ashYyNrZGlYKCRi6L+JNtOGMqx3e3wrgCMl7A4a QTZYhH3BuEWB6+0lXBO7kJPGsYloN53bfKwqXTX6vgsA/ZVhKfNkKCxEgZ4f7anq9i8w WyqPyMUtLnrtJKD2MmWRIWRrR+qdJ62/vjS9LtIa0RqCEXh9DFXDtBq+bu0fE3+WsqTT nyvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=awI6En4B; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-142676-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142676-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id gh1-20020a056a00638100b006eac82aa4f5si3270176pfb.45.2024.04.12.06.03.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 06:03:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142676-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=awI6En4B; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-142676-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142676-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 82C3328210F for ; Fri, 12 Apr 2024 13:03:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87A675C5EE; Fri, 12 Apr 2024 13:03:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="awI6En4B" 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 AEB8A4436E; Fri, 12 Apr 2024 13:03:13 +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=1712926993; cv=none; b=C9VAmy6FvwVm8cpFMuCwCuriCSJ4NryI11XT7/HDCBCU3vhj6lluze7G35Ggb3WrW/KLXL/4i/wgHZztY5SaIHif3ivbZxMbWpJvqP1IAYWh1MzTtX5CZ2FNgGVJFtwJYTLpswO7KKiCYoH7Rnx8aI9ey39iDyK7cV1rnKzR6Lo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712926993; c=relaxed/simple; bh=8wdevPfrdtepk0PCtS0tbraBxnU6ILXWXbU+kfU/aQ0=; h=Content-Type:MIME-Version:In-Reply-To:References:Subject:From:Cc: To:Date:Message-ID; b=l1uMaRBBcHxF8F2RhQbnr0z7H5s841xvQDjmhX+gnzLuLTZl9ovO6eJlTxDxdhqiv8JZU8hOjQ4Q3PVA999QXi18ZhM+cJQqWseXM64Firk0hJZ16WSOj6KsxJW5pqatFdrfij0R2H4Kd/LB9/hi5QSi/RvXxkJM+66IRVUa+Ec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=awI6En4B; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F856C113CC; Fri, 12 Apr 2024 13:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712926993; bh=8wdevPfrdtepk0PCtS0tbraBxnU6ILXWXbU+kfU/aQ0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=awI6En4BnoNZRKhvZawTzXVzsV/D37RfCZWVwb0jDF/U9AMWf1YFeiczSz5Lh/Zl5 V3fWdznlkQSyZeB8AvsmqDewwWXIISMDenlbET0aoLX2zzeWeA1PfTKYh6lcdb/JYi G4UpelDztrOemmvQ+mbH/FjKboE/JfPRBfECavtTL38QibxOLqZMQ40NGUJosK3A8h 1Yy4pXxHAZB9xUayJCyeomyRO8ibLsjrfF2zljJAzqbgAmLDNym2vqjZKxkWBDA0dq f4rmv3QdM/IFJc2wY++J8r+a2bMBhMAcOhnCfLOBzxSvC2R5XTneHc9YLqLNS7XoQO akY2/Eo0aHpRg== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20240412104615.3779632-1-maxime.chevallier@bootlin.com> References: <20240412104615.3779632-1-maxime.chevallier@bootlin.com> Subject: Re: [PATCH net-next] net: phy: phy_link_topology: Handle NULL topologies From: Antoine Tenart 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?= Maincent , Jesse Brandeburg , Marek =?utf-8?q?Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?utf-8?q?Nicol=C3=B2?= Veronese , Simon Horman , mwojtas@chromium.org, Nathan Chancellor To: Maxime Chevallier , davem@davemloft.net Date: Fri, 12 Apr 2024 15:03:10 +0200 Message-ID: <171292699033.4917.4025686054785818967@kwain> Hi Maxime, Quoting Maxime Chevallier (2024-04-12 12:46:14) >=20 > 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). > diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_li= nk_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 *top= o, > struct phy_device_node *pdn; > int ret; > =20 > + 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 =3D xa_erase(&topo->phys, phy->phyind= ex); > + struct phy_device_node *pdn; > + > + if (!topo) > + return; > + > + pdn =3D xa_erase(&topo->phys, phy->phyindex); Same here with phy_sfp_disconnect_phy. Thanks! Antoine