From patchwork Fri Dec 15 17:12:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 13494724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFBB1C46CC6 for ; Fri, 15 Dec 2023 17:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oI6ZFC7UAMJfgSc1hWu3+HOYeE4fDRMebfbvWh7Ij3A=; b=fHcgoJhzc7PlnJ cX1l9E7vtEixc1MnUqlL3880JkSNA51Wg6ioyqfTEjBjP8Ii1ZkTGC6bK6tMcyjzPnAGkkajlmuvj 4bO6OOE4Sd4V/SFdi9mTJqhakx18kdzhPl1HurXkZu+E4xV/Zzu7d2+0okP7n4Hsiad1xt20y+U9a VOyyrKH7b6OY0FTyqh29jFBIX0EjHhaDVBE/z+kZFnP73JFnCDZWw6IwiH3n3OAmiYtx5TiPi+WqG oWEeKlwfGNdJl4RvhGevx637Y2YHzcauzRmetpnFJBJfzudxoy54xQon4DwJyQUYDofqbwm0dZCMY ndNJ7WtfZ2MY3vFP/h+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEBkU-0040iu-1P; Fri, 15 Dec 2023 17:13:18 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEBk9-0040QV-1o for linux-arm-kernel@lists.infradead.org; Fri, 15 Dec 2023 17:12:59 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id DAA06C0005; Fri, 15 Dec 2023 17:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702660376; 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=6acbIxUaygwdBAtcndMa1MEIHVnUPv1H6l3Q0oeoTb8=; b=kltrZKiSAvQwP+ota8LHc3U+65OeMlfKlBC4ccwoQ4jPPSeKlYmStIXg6TvPVi5AjyTm+u JvO6UZ2ExzsujhGJXmbVHcpadK95FHA98eWZ531St5iNvXCKINbSkpoSZmbLu3UZl6Gh0s eHB3ORRqSA05sKQVme7+w0GFgWH68/3P1EHxLluUT7rXxUO2a9cLdgCGg4iyN7u4EK79gV 3ZMgcVb/ZScXFk0Me2it/K0dA1/y4EPvYBxbb/V7E7F51kc1mS2Z3G2ET2YQCp3Kb+ypqq Sf2tx0M8wLaBFvYwWhTohhyAMng+lD1CqeQi8wQlsnbHAfQ4mDl4haQWQrRkVg== 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_Maincent?= , Jesse Brandeburg , Jonathan Corbet , =?utf-8?q?Marek_Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?utf-8?q?Nicol=C3=B2_Veronese?= Subject: [PATCH net-next v4 11/13] net: ethtool: cable-test: Target the command to the requested PHY Date: Fri, 15 Dec 2023 18:12:33 +0100 Message-ID: <20231215171237.1152563-12-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231215171237.1152563-1-maxime.chevallier@bootlin.com> References: <20231215171237.1152563-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231215_091258_581652_F6AF736B X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Cable testing is a PHY-specific command. Instead of targeting the command towards dev->phydev, use the request to pick the targeted PHY. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn --- V4: No changes V3: No changes V2: New patch net/ethtool/cabletest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c index 06a151165c31..6b00d0800f23 100644 --- a/net/ethtool/cabletest.c +++ b/net/ethtool/cabletest.c @@ -69,7 +69,7 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info) return ret; dev = req_info.dev; - if (!dev->phydev) { + if (!req_info.phydev) { ret = -EOPNOTSUPP; goto out_dev_put; } @@ -85,12 +85,12 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info) if (ret < 0) goto out_rtnl; - ret = ops->start_cable_test(dev->phydev, info->extack); + ret = ops->start_cable_test(req_info.phydev, info->extack); ethnl_ops_complete(dev); if (!ret) - ethnl_cable_test_started(dev->phydev, + ethnl_cable_test_started(req_info.phydev, ETHTOOL_MSG_CABLE_TEST_NTF); out_rtnl: @@ -321,7 +321,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info) return ret; dev = req_info.dev; - if (!dev->phydev) { + if (!req_info.phydev) { ret = -EOPNOTSUPP; goto out_dev_put; } @@ -342,12 +342,12 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info) if (ret < 0) goto out_rtnl; - ret = ops->start_cable_test_tdr(dev->phydev, info->extack, &cfg); + ret = ops->start_cable_test_tdr(req_info.phydev, info->extack, &cfg); ethnl_ops_complete(dev); if (!ret) - ethnl_cable_test_started(dev->phydev, + ethnl_cable_test_started(req_info.phydev, ETHTOOL_MSG_CABLE_TEST_TDR_NTF); out_rtnl: