Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp604240rdb; Fri, 17 Nov 2023 07:41:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMAyXY7eR9EOotW/JBzQZQP9TMsvJJvGb5GI1PN8jOZbcwZmay2RfK/AyWcH9Ge75/0odH X-Received: by 2002:a17:902:d345:b0:1ce:5853:1ff3 with SMTP id l5-20020a170902d34500b001ce58531ff3mr4082371plk.38.1700235707531; Fri, 17 Nov 2023 07:41:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700235707; cv=none; d=google.com; s=arc-20160816; b=xKuZ3xODiYf4npu7c0OEKkqaTQht+odr3g6xAlFKbygrLBB2FZL8qnbFZeMSS68Yv/ qeYFmHate8QINNhoFXOyKgdjxszZfAsp2Enlz66WfQ6dvZgk1evX/f3MY8zJr2WMKaGP uOp3SxH6fZAq2g/xGNhS57aXmzNx8dl/GRULYJ18H5rHuJ7SjqRe6vafr9imQDBwjS2r y7w93sjmCcIRdNy9jz8J8hCEY5hf+Ycj80ZZO/LW82KBC0imh2ErM5sMJ5dZmSpWif72 cXq133T4T+qde2XPIjN4Udnd5zIi4wVmWo+aZLgjmCcCA7d3NFWxn/AvnpzFfuBrOjwG mkkQ== 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=ZYDQAQJQ/pdv7XNK0dqa7uzxPDAfbEfBIPQXanwGyRc=; fh=1WRQxG55ASsvt/9NxVDhUbJ1aQecLyVglFoTAx66NyA=; b=qQuVUJHdrhzIaUkzkwTpC4r5suBMZ2nBUR7DBFXbFZquLBShZex9ElLXVxS17jT0xr 31fw7EkvFLAuryxaITfroOX8wrNcUpGz8SsMZQQyoUH+RFy3YR5N9h0goepzDStHzY1w gqcxCB0tSHN1nglrCpGv+lACjQjfnaCGOHzJlMBVrYSxopPT8HeQtCApa2bGoGMSMtIk vWJMT1qr7ENVz06+lYh6OBFtyF+scScqHZdQ9DobrvRuyJJbM98muYBfaqGRQCjH24HT avNHxOLDBDmRvwTohddwWByaMKBPLS4WjAGW65VS3Dq1uBJv0DKainpUcDk9eMdS5gUx 04Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hEcBsYJ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o12-20020a170902bccc00b001bbad1883d5si1932743pls.293.2023.11.17.07.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 07:41:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hEcBsYJ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id E38AF8046461; Fri, 17 Nov 2023 07:41:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346123AbjKQPkv (ORCPT + 99 others); Fri, 17 Nov 2023 10:40:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345949AbjKQPk3 (ORCPT ); Fri, 17 Nov 2023 10:40:29 -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 769221720; Fri, 17 Nov 2023 07:40:25 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3E2931BF216; Fri, 17 Nov 2023 15:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700235624; 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=ZYDQAQJQ/pdv7XNK0dqa7uzxPDAfbEfBIPQXanwGyRc=; b=hEcBsYJ1FPiTFf/NqsoO+kAGRT86Q7J3Vjzf1yx8JBgaC7n7+nvM+fWcorTwlkPgiUpTFo Iwr6tDDkUmCqnMiPkhlBT3V4/QbFyMB1Cg26wy0LRFfAer9GvflHok7h/HIDYkk9M7fF09 3pVrWxb9KAD/+67nKM36epO/c5To636o7sblha7i1tYNBdkIJgf71JgIB7CwxM0wdqsR03 8rNtKt+V21VnF5i43601ltWDnOCluHvLm4LegfJHoxojVF2ive4bzM5WaAGcqfIjkpI90j jyVKvN2xB/+5KYGZMQv8S+S/GSbq3F5/5433vDmH574NNALY6v9nBQgZP3rHMw== 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 07/10] net: ethtool: plca: Target the command to the requested PHY Date: Fri, 17 Nov 2023 17:23:18 +0100 Message-ID: <20231117162323.626979-8-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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 07:41:37 -0800 (PST) PLCA 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/plca.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c index b1e2e3b5027f..2b3e419f4dc2 100644 --- a/net/ethtool/plca.c +++ b/net/ethtool/plca.c @@ -61,7 +61,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_req_info *req_base, int ret; // check that the PHY device is available and connected - if (!dev->phydev) { + if (!req_base->phydev) { ret = -EOPNOTSUPP; goto out; } @@ -80,7 +80,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_req_info *req_base, memset(&data->plca_cfg, 0xff, sizeof_field(struct plca_reply_data, plca_cfg)); - ret = ops->get_plca_cfg(dev->phydev, &data->plca_cfg); + ret = ops->get_plca_cfg(req_base->phydev, &data->plca_cfg); ethnl_ops_complete(dev); out: @@ -141,7 +141,6 @@ const struct nla_policy ethnl_plca_set_cfg_policy[] = { static int ethnl_set_plca(struct ethnl_req_info *req_info, struct genl_info *info) { - struct net_device *dev = req_info->dev; const struct ethtool_phy_ops *ops; struct nlattr **tb = info->attrs; struct phy_plca_cfg plca_cfg; @@ -149,7 +148,7 @@ ethnl_set_plca(struct ethnl_req_info *req_info, struct genl_info *info) int ret; // check that the PHY device is available and connected - if (!dev->phydev) + if (!req_info->phydev) return -EOPNOTSUPP; ops = ethtool_phy_ops; @@ -168,7 +167,7 @@ ethnl_set_plca(struct ethnl_req_info *req_info, struct genl_info *info) if (!mod) return 0; - ret = ops->set_plca_cfg(dev->phydev, &plca_cfg, info->extack); + ret = ops->set_plca_cfg(req_info->phydev, &plca_cfg, info->extack); return ret < 0 ? ret : 1; } @@ -204,7 +203,7 @@ static int plca_get_status_prepare_data(const struct ethnl_req_info *req_base, int ret; // check that the PHY device is available and connected - if (!dev->phydev) { + if (!req_base->phydev) { ret = -EOPNOTSUPP; goto out; } @@ -223,7 +222,7 @@ static int plca_get_status_prepare_data(const struct ethnl_req_info *req_base, memset(&data->plca_st, 0xff, sizeof_field(struct plca_reply_data, plca_st)); - ret = ops->get_plca_status(dev->phydev, &data->plca_st); + ret = ops->get_plca_status(req_base->phydev, &data->plca_st); ethnl_ops_complete(dev); out: return ret; -- 2.41.0