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: 179455 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9443219dys; Fri, 15 Dec 2023 09:25:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IH304hYqt/HHCAP4u51JQO4wFZoo8M/f291dcDE33huCWNqCGttyd3kqbGglXCg90eF9N9G X-Received: by 2002:a05:6a21:18c:b0:18b:c96b:a433 with SMTP id le12-20020a056a21018c00b0018bc96ba433mr16876900pzb.56.1702661118991; Fri, 15 Dec 2023 09:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702661118; cv=none; d=google.com; s=arc-20160816; b=F1Y9yujuoFTP04BUYEiMYi+mh7L3+5h/zanHOh++zn+2u4mx5Oy08fObZwtR8ZWnXq 9bhgNdu5zmz1nHeDl+FAyWpFkcMb+BSGYG5AZElGzkncdj0y8XkmwNoomhXHuhOa+lvi e4IGQp4iQ/2StTljAUL/FeUvU+gH6doe4WB/IsyK+OuZs1WpPlMTgpnoDgiLUHnLf14x Hb1iaIbD5QES6ZvQn9c5WxixmCz10FJBQIyRPJ4of2u+gf247EdJ5w52OFayiPgGVVh0 HxhHSWK+1udu/e94jjYWhZ30PNsR8idFQcSGca7duJ2xLwZneaQyWQUHJWoaboBxx9Ma nxBw== ARC-Message-Signature: i=1; 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=6acbIxUaygwdBAtcndMa1MEIHVnUPv1H6l3Q0oeoTb8=; fh=01/i7K9ues3Vkkz8uyECvnCPITXmGs/30yOh5FbyFgY=; b=PPiTnNrqqjnp2dI+KuPeBueehSvPnC+ebGLX1/jqWjHxEF+s4BwguDqK9FcGKW/CdZ coHdQ0zMhTOCM2cpMuPjKZwZHA5MBkegjUv2T4VPyvkCrcsMCULgXQ8RE2ElolD9uBcf XKhjyXAzX1/A9BBeoOjTDDflMVAlwHkpCnYYWgqS536tuaZtGjEt8kZYH1p9YeuJewFx XWTinBuWQdSPDaieLTTzCE0lnbfeFG0GuumnTQUG3fmXOyPDuoNoH6lgtcrSA8abJHod gD7dQskOZVbpe7f08eeS08ON/Q8HH2PSVhZUfUAv6iJS2NNzgbSe1eRpgQXYpjYS5UX3 +JCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=kltrZKiS; spf=pass (google.com: domain of linux-kernel+bounces-1403-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1403-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u10-20020a056a00124a00b006ce63e17f29si13485532pfi.341.2023.12.15.09.25.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 09:25:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1403-ouuuleilei=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=kltrZKiS; spf=pass (google.com: domain of linux-kernel+bounces-1403-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1403-ouuuleilei=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 C1A3A2869F4 for ; Fri, 15 Dec 2023 17:25:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED0507EFDF; Fri, 15 Dec 2023 17:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="kltrZKiS" X-Original-To: linux-kernel@vger.kernel.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 9F26570989; Fri, 15 Dec 2023 17:12:57 +0000 (UTC) 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 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785369585524640327 X-GMAIL-MSGID: 1785369585524640327 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: