Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1915161lqg; Mon, 4 Mar 2024 07:33:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVA9LHZ++5W+KA4qzMovq/ddkQcmxOHeQFI78jpzqOewmTY9rXq49RtCkpoBHzF+rkEfgJ8DcAPqRB1oCnfm0iCUf3dcFf3wbXzNvt0IQ== X-Google-Smtp-Source: AGHT+IHN2uSI1+OUGMfQ6R11c1EDQELdLCsP6HDKtQa++pziQ0TuvYind9ohDyG4WRkLQMf63N8p X-Received: by 2002:a05:6a21:3408:b0:1a1:864:65bc with SMTP id yn8-20020a056a21340800b001a1086465bcmr16663322pzb.23.1709566383148; Mon, 04 Mar 2024 07:33:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566383; cv=pass; d=google.com; s=arc-20160816; b=zIBvNJnN6at3kw8JsUtLdABzVP5z2jEB4OuldC+gvrOAeMw+hXeP7jAJ/Jx9MfTU91 aVa5cAEo+4cIHc8isL5Nef3TXfHJCb37kHJ6ER/fwlkJzMszuov/S4hbA1fhqHLwud+P NY8Xlg0GwIS3NxXOs1gUlES9grT7wcSB7RKsy7iwNQwwhnJizrItVXPIABoB0JhTPQ4d p0IOTr2yDCoGxahAdRCqeTOlk3d8L/+gOu1qdKgAAXBLHXfjwDfYboRnHXd5JTirm8fR 6VLQ2adT0MN85HGG5ISJDPv/efZomQSMs7Xf+XjWN/cD/VsrQbef+bATyftuUHwwEcV7 8C3Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=OmCZ8+vUM5DG7x+TAmA4cTrV/kcQNelYUOaYHrZMngk=; fh=1vUu/d1GTjraph6G+ET+Z0z13QVrf6oL/IrrK9zaTF8=; b=v4dyD271KeFWeQ6YbElmkEG/0tPzaFOlVGVkgrAmEsdxZCEKcKhwUeJfW5bQTC5rJP d7Lp1UiDidsAri08th4T7tpptiNEVm+rk5jGieFL6wax+RNpDyVbD5ce5xgPIkT0l3GE hW75EYak7xm1On0+fZX7zyjWxjvH3GnCH2Fba07Ck1X6HKJiagIWDxbKk37+qaIi2VVq l7eIPaXoVI/pCh/wRVcxmftKDB5yVZ9IMNt3B+jDGhbcmOM5iZjFOdQTDVYPwJp3S/Dg h/mgOjxfItvZIB85WsUCiYIdbnArYDEffajXp9kNj7ZarVcoQTWF0TlO2bX3EETZJ7Ey 4wAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jOWFc6YT; 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-90781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90781-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e62-20020a636941000000b005dcbbecab93si8315480pgc.401.2024.03.04.07.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:33:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jOWFc6YT; 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-90781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90781-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 06FC5B2347D for ; Mon, 4 Mar 2024 15:12:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1DBD4F201; Mon, 4 Mar 2024 15:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="jOWFc6YT" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.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 7325F47772; Mon, 4 Mar 2024 15:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709565021; cv=none; b=EvIZklK4N3PJZEKAbViwoCFSlh7nVFmsArkxkt4YF59R+gRYnOtc4ogvxyf+LuuaBqbbtbwnDFPSTyslaHuGyc7dotDLhQNDVbDPf1AhUklRX/QUkjgaKQJp+LJNO+PpDkxleqBU+J9JnuSjNXGD5Tsn2ynlbKpJ/fKFLeENwMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709565021; c=relaxed/simple; bh=pW+1V7YqOhkcLioMl2DX0tOkmXUQtbPF3XcSxdIf7OE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RZy4abN0/KZIu/LWvWwlE15EqXAMiA/BojWlBqLmFjPO8af/rqv2z+BVmCdhzctygoCt2CdKFSGwK1e1E2rnYOZebvoeg3GkScPZn42plsBwEkxRyM4wAluk3epCEfrzo5GluP2uByi/pv6WmgkiJDdvzgB6g6G0zyK3cUEj/Jo= 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=jOWFc6YT; arc=none smtp.client-ip=217.70.183.201 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 4405B1BF20B; Mon, 4 Mar 2024 15:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709565017; 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: in-reply-to:in-reply-to:references:references; bh=OmCZ8+vUM5DG7x+TAmA4cTrV/kcQNelYUOaYHrZMngk=; b=jOWFc6YTA+JqZ8uZMFTD1zxcWx2ZZf7jB1sEU+oTscYmKbqz2oFj3fFqQF4TtGOIrdja5Y Ih949WqcLOaLh4y6ZrMU3x2dGW4pfFyOa/tLtYEH7w9PItt++G4sei7qmVDsjunOL7tqFb yXrggYyFSHiMbLfGiDK7dPF87MJkqo4Nf16x09XaTC1aZhSpidzepVWkA00KblZMgRp6Ep ZUjCwYp9EurDlbd6ZYv9twBz++Jh+g9HIjWf/KKF3L+t0o1SyWPtsyNEgWhjm6ZhLz1poa n3AzhjQFrrlTtdbYfpkbl78+gjzsrAgv/LYMl6zKl9T0fVFPdPGG1Vkb6FK1Hg== 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 , Jonathan Corbet , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman , mwojtas@chromium.org Subject: [PATCH net-next v10 02/13] net: sfp: pass the phy_device when disconnecting an sfp module's PHY Date: Mon, 4 Mar 2024 16:09:58 +0100 Message-ID: <20240304151011.1610175-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240304151011.1610175-1-maxime.chevallier@bootlin.com> References: <20240304151011.1610175-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-Transfer-Encoding: 8bit X-GND-Sasl: maxime.chevallier@bootlin.com Pass the phy_device as a parameter to the sfp upstream .disconnect_phy operation. This is preparatory work to help track phy devices across a net_device's link. Signed-off-by: Maxime Chevallier --- V10: No changes V9: No changes V8: No changes V7: No changes V6: Moved an incorrectly added hunk from the previous series to patch 0003 V5: No changes V4: No changes V3: No changes drivers/net/phy/phylink.c | 3 ++- drivers/net/phy/sfp-bus.c | 4 ++-- include/linux/sfp.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 503fd7c40523..8a34883eb99b 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3385,7 +3385,8 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy) return ret; } -static void phylink_sfp_disconnect_phy(void *upstream) +static void phylink_sfp_disconnect_phy(void *upstream, + struct phy_device *phydev) { phylink_disconnect_phy(upstream); } diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index db39dec7f247..e05013aeecc3 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c @@ -486,7 +486,7 @@ static void sfp_unregister_bus(struct sfp_bus *bus) bus->socket_ops->stop(bus->sfp); bus->socket_ops->detach(bus->sfp); if (bus->phydev && ops && ops->disconnect_phy) - ops->disconnect_phy(bus->upstream); + ops->disconnect_phy(bus->upstream, bus->phydev); } bus->registered = false; } @@ -742,7 +742,7 @@ void sfp_remove_phy(struct sfp_bus *bus) const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus); if (ops && ops->disconnect_phy) - ops->disconnect_phy(bus->upstream); + ops->disconnect_phy(bus->upstream, bus->phydev); bus->phydev = NULL; } EXPORT_SYMBOL_GPL(sfp_remove_phy); diff --git a/include/linux/sfp.h b/include/linux/sfp.h index 9346cd44814d..0573e53b0c11 100644 --- a/include/linux/sfp.h +++ b/include/linux/sfp.h @@ -544,7 +544,7 @@ struct sfp_upstream_ops { void (*link_down)(void *priv); void (*link_up)(void *priv); int (*connect_phy)(void *priv, struct phy_device *); - void (*disconnect_phy)(void *priv); + void (*disconnect_phy)(void *priv, struct phy_device *); }; #if IS_ENABLED(CONFIG_SFP) -- 2.44.0