Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6833357rdb; Fri, 15 Dec 2023 09:24:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8SMItjQMdtQb6EUcZloGFAQZWIfBu8kqzpkhcy072FubjJrh6CK+Q6uQ//+8Q9njE+AkG X-Received: by 2002:ac8:5ad1:0:b0:425:a69f:9780 with SMTP id d17-20020ac85ad1000000b00425a69f9780mr17825788qtd.30.1702661092692; Fri, 15 Dec 2023 09:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702661092; cv=none; d=google.com; s=arc-20160816; b=WuaelQ4BNEek9cwtCoIE3RJyOmPegciAhzMWdOiP5N9mGTqNKXd0Qywc6lCLRIfo3Y WQ6LTOn/f6OjDQ3Uv57byprpfaM/xbbc7LLEx0qFMO5ToLGTE4y90kWv03iDeMA6O4af MulKEvIf1tPvjwb3TqHWSiNprgjk6xLu7Ac06or2yA0EVQ1Fk8sygM9b4o4uLvZK56b7 vFhJJrWzuc2/PRlRUCvEWQwFvnxcvLZIXnvR1e3XaFkOXhujgdXVDQdCd+DvwO0/mYXD pZtBPsz/4BWLzYh5ovp9L1rzgEO3V4MQtlbQqD740Gj8hPcE9QQhjZPI2KRIzzp2ww9d oyHw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1403-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e17-20020ac85991000000b00425a32ed22dsi17884318qte.64.2023.12.15.09.24.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 09:24:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1403-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 645E11C23CD4 for ; Fri, 15 Dec 2023 17:24:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B75723011B; Fri, 15 Dec 2023 17:13:00 +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=20Maincent?= , Jesse Brandeburg , Jonathan Corbet , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= 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 Content-Transfer-Encoding: 8bit X-GND-Sasl: maxime.chevallier@bootlin.com 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 --- 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: -- 2.43.0