Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1168225rdb; Fri, 1 Dec 2023 08:38:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdEhV4oENLbdhwKySocfAPXwO1LF9CWwzanM6bk2COiQBO67twnkpNdxgJrCSCBx3rz9d2 X-Received: by 2002:a05:6a21:6d9f:b0:187:4fd9:b9bc with SMTP id wl31-20020a056a216d9f00b001874fd9b9bcmr31043280pzb.34.1701448690808; Fri, 01 Dec 2023 08:38:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701448690; cv=none; d=google.com; s=arc-20160816; b=pBhjVOlMOWsBx+7eHC4m7A8eFHBG2ZUVi8Ax7L4Nq5CWC5xO3XctMuJC8tbozieLwx sK6pO+WHYCoKrycilTYnjWryM7SmwTNbmmS/zYrgAucnbLLtNaeXe6eExJD77VPVX3Bf WQWvVEKa81YKJ+W123BiBB1mdnTOor+yl8zkcytBZSeK5/fpt28JpJHTVBnXOqCsMinG VvaHDOw2QM6H75UkKtWikVPAkxEH+Yc0awX1YfDpL4Oa0/kz89KKm2mcd88LSUa1QiB5 35XOzyfbK+TaQdYDZgrV0UyGVVemqQAeEwWcMRzt13UJO/J/5WYuZKkgS/Nt9AsEf3Bf IOLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IrIqVHTv4OFpjH8swPAPtlm1OVsBZBIxDm7JNwM2hes=; fh=01/i7K9ues3Vkkz8uyECvnCPITXmGs/30yOh5FbyFgY=; b=uolc+dxqzq3vEJ0uEsjMXPX+g8LuELgzWD1Ia5/MNBgrKAep+l82Dprjz68Bx9+KCA Wv6RIcqv2LGyvlvU+zkZ8GyvcSE5hjM9pPCzyrqqbfRTUcuMtrrpyTOwCyvY6OTznvL2 eGA82YLKPCKolPiexjePo+ZlFoWhz4W6SjHD5hRTKaMCXMQdOCr95tT8SxLdcJ8GtZEb B1dVU7ZSXB9gsQU2FMdfjbyBkv57KFeySr8+tTSXjQBUhTebemOlYKV84p8ad/5yJhsM ArR41u6U8scMwo11NPEsJi9rHYrSAThyuryhEjrHnZG+tWWVXCzovsdpMiB0uW4OGWWW 98Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DowcDovD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i19-20020a63d453000000b0059beadab759si3669463pgj.652.2023.12.01.08.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:38:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DowcDovD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EEE428129AE6; Fri, 1 Dec 2023 08:38:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378803AbjLAQhv (ORCPT + 99 others); Fri, 1 Dec 2023 11:37:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378448AbjLAQh3 (ORCPT ); Fri, 1 Dec 2023 11:37:29 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74B21173A; Fri, 1 Dec 2023 08:37:24 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E913EC000E; Fri, 1 Dec 2023 16:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701448643; 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=IrIqVHTv4OFpjH8swPAPtlm1OVsBZBIxDm7JNwM2hes=; b=DowcDovDfXhbCr83jjB6+e7vCvtHLWw+3yqvIj8oZU1U0KnCUh8eJ6SZcQv1B80liC7gQ4 VnIikbXDRGHTlL/9OIYmyydIer/u5RE8jXn+MPtZ96JT0ROkwyAjy87cGAfWTmtbPmAzgZ SkZ2hjw5KQS+rbXvQLZzG2uTuevCsaWMj1kApe609ZFEyJp2T9tTes0lAI/PJS0w3VY1jT 7sFcU5hqDulKniBa3Z93qCjqFWrusADdrMNHUEWgSzYWO9Wl3nKZx0C9F7KrjWnqNXrhxS J7Q3oRa+nZC0l4LgqafpwL2DywD3wPRM/QEpWfrsWGW3FKJYjEws4sN8/I5ELg== 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: [RFC PATCH net-next v3 11/13] net: ethtool: cable-test: Target the command to the requested PHY Date: Fri, 1 Dec 2023 17:37:01 +0100 Message-ID: <20231201163704.1306431-12-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231201163704.1306431-1-maxime.chevallier@bootlin.com> References: <20231201163704.1306431-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: maxime.chevallier@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 08:38:09 -0800 (PST) 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 --- 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.42.0