Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp603700rdb; Fri, 17 Nov 2023 07:40:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqc2tS67jEVEDPVaSAIyrgGQenKIap34jbQRXjB4A2ztwqOJA8v1ha+SPakWUnpDhG2hmF X-Received: by 2002:a17:903:41cc:b0:1ce:6693:d711 with SMTP id u12-20020a17090341cc00b001ce6693d711mr4865ple.16.1700235652187; Fri, 17 Nov 2023 07:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700235652; cv=none; d=google.com; s=arc-20160816; b=S6fhac1x7uc0LhYaQIUHK8HKk2/16mMytV4UOZl0mQCOHVnzrLYVFUGx30GZNif1b6 xHYMFktMpo3o/vDxY8CwHXKT89JFOyjgU7tQ2Fw9qOfHdU5X3n4qZP0BxWv/Dpf0FKwF eawLZoNjHlmFGjMkJAJmeaNKtX75ySS6yEgDE/CAaQT4HhKJr5hS1ptTVryG9RQ6JotO ipqaWWrk5iv28gCzSZtF4974QjKvrwfkmO7hxgsMOedS03RcNTvZUJrUG1BBwKsafbyp FsH4uEXcXxnvBFAJ3ql96WoCBJnVG/ICCckipprXJn0Izd4gga28eV4FzF8SBjaQQ0z9 lzjg== 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=m2+rY8uZYdxjl8tssWKAYCzjgSzumnM1Z1aVzBnQkVM=; fh=1WRQxG55ASsvt/9NxVDhUbJ1aQecLyVglFoTAx66NyA=; b=UQ1MxzDLxnYi1VlZeYDQ6MwB0G9ocNl7puog/XcEVtBReH5YSDroUbDwdTYntI/z7x u7Jj63r7LFxScWIy1UQL5o6Gdtt8ugK8Nxtd91CtQxieiMFBLxirvF13VbPdqyRWmBP5 nBJrcfdSUd36IKCIZavimzZgg4ZEjBV2KkRZ+mec2ZMYanuBe6cO05ZlPsAZ9tLqvZIo UHKZ8seY3HHIP/Du/FsbLiLfmHIWcFWldRgdgRIuVX4Ubd91fHVfzTQ+hc+Qqv2ryGxI 6E/2GQlYGFB9/LWGbLQFU6kN7jBl2jiA8n0AnXgmKf32Wib04VIhFwoL0sXuH/8kHO6a iWkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=e0kItRtr; 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 u6-20020a17090341c600b001ce665363absi85208ple.623.2023.11.17.07.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 07:40:52 -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=e0kItRtr; 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 AB5E9827FFA5; Fri, 17 Nov 2023 07:40:49 -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 S231546AbjKQPkn (ORCPT + 99 others); Fri, 17 Nov 2023 10:40:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346040AbjKQPkc (ORCPT ); Fri, 17 Nov 2023 10:40:32 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7753211D; Fri, 17 Nov 2023 07:40:27 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1CC401BF204; Fri, 17 Nov 2023 15:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700235625; 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=m2+rY8uZYdxjl8tssWKAYCzjgSzumnM1Z1aVzBnQkVM=; b=e0kItRtr9WgR4t9hvwrQA9gzRCvFYqf0gh3Fdm7EoY0ZnsICZ9GDbFcVOi11hJsdU8zM8g n3y14Sd3LlGbycEFa0g7aafBQYP6jjNAMNb7pBXoDupWi71V5iFYTflQE1iToqhXoNKYDS oeNaj3REahJxU9s/S4p7ZcWTRO0cH4z0XRm5pXR7wiJTHtFX5/sQE35YHtSjGbZdhJmpZR Jkfjk26sFCcw/i/VQrXjoCytUQh7Ssy8Ec7M3U0izdwBKrtpijAU5nvSg5lfnDTbCF9vjT ibebjq3VQU5EahsFXJ8xE279klWCJFCsMDC2FGOS+EB7oWPzuAFKnoAWAkg4kA== 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 Subject: [RFC PATCH net-next v2 09/10] net: ethtool: cable-test: Target the command to the requested PHY Date: Fri, 17 Nov 2023 17:23:20 +0100 Message-ID: <20231117162323.626979-10-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231117162323.626979-1-maxime.chevallier@bootlin.com> References: <20231117162323.626979-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, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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, 17 Nov 2023 07:40:49 -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 --- 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.41.0