Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp304190rdb; Thu, 21 Dec 2023 09:32:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfbmmzBunGq/GTJVB0niGpJEpZZfxq6tHV9T3kMqYdohwQJrHtnq2St5BJG1dPnmDSEjD5 X-Received: by 2002:a17:907:1de1:b0:a23:6c63:30a3 with SMTP id og33-20020a1709071de100b00a236c6330a3mr42859ejc.32.1703179925253; Thu, 21 Dec 2023 09:32:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703179925; cv=none; d=google.com; s=arc-20160816; b=vpSc16gVS1lTQjnHl77tluoDNGs7XdBg7Wlucdyhho6oOV2RV02wpSmNuwluLmMKkX dSOMojPBY/LuYox97Lazsqq4Cm8Rl+IBh/wvEwQbA9irCeNgCiror2t7nXXpDejZkvhJ 3lLcUzW9gwohPEeNk1Jw9BeqoK9rCS6IU5GkJ43FifPHuu76sSQB/7Vk74dw3cm8CUua xPdEm84IaHqnypOYvwH6c4Z6EGZh1VeBVWqk3pkEuMj/t34CpYeuo8J7HQcPMecATnKh 4BD4E/KvqV3VFJlRM1CjCXl39H4r1TF7Aq2a8Xmmk73KJXDkwvSFnIR4Nj0C33SOQ6+L YAIg== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=0M+cuxQcvYewwyk4Th5VGeYl8kRK9tF6Qct+KX6cQ/4=; fh=/w/8x3AMNatiRLY8r7YxDLe8jyE3cjhoK1Qtq6Qky5U=; b=1H9OLnTWdVvjkv/G5BB2GVbd+xoquIFVzrkfGGdgCAaXKv5h8eNvcnh8v2z3dNw2kC TM1Xl20PdS7cdhU9ksBOuvnwhDSa16/+xtQMwVtZqo82zrsdq04mMt2+q7lHEYpY+Y6r P2EE+bq/u42ZmCqqJ073iXzmPLl9lxikhklBCN5Wp+e1tusV5s2ifa9FwamIkcnz/1S/ x5kYxD4KUGzpZMGCwU/Z+IHXUjJIHVXIx/zwp5DajBRsRfuuVUk9JYPy450djpiUF27D NwLPvGvkAecfSfS27d0v7rlQtGBdTWtZPkjrT+l9/LfkpYXMklknWIIwdO2hGp+XaXhw +cWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="oKKM/O7T"; spf=pass (google.com: domain of linux-kernel+bounces-8853-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kb2-20020a170907924200b00a26aea18c06si279723ejb.91.2023.12.21.09.32.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:32:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8853-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="oKKM/O7T"; spf=pass (google.com: domain of linux-kernel+bounces-8853-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8853-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 073CC1F242EF for ; Thu, 21 Dec 2023 17:32:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 126B56281A; Thu, 21 Dec 2023 17:31:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="oKKM/O7T" X-Original-To: linux-kernel@vger.kernel.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 EA27462801; Thu, 21 Dec 2023 17:31:50 +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 768841BF203; Thu, 21 Dec 2023 17:31:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1703179909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0M+cuxQcvYewwyk4Th5VGeYl8kRK9tF6Qct+KX6cQ/4=; b=oKKM/O7T1r3p5geKv0JQS6h9R7CSVpqcu4nfFHVmAWrSSPd/n9e4grtwCFSsAntGJJC/XX hpJKGbmYH1W65BjgUIYe4Sv9CGa/HfyqeU9ym+N5wb2BizHli4nMh8osC3NEEjKRlpafCE vwowfV0rRkFbVzZoAwgYLbIP5f4FPGF5HF4Qbpw/Hr8PYG0E9Ow4y/diaTwqqNmhHtV91G KIIeTM/lfKR3qI35OAqpmw2L/GbOHMCAQ2+90iqmxgeXhMJZqULGKfgagjXzcBK83+qaQP NuzV8fCpgDcxBYXV55pBZ5vXR/e5NVNmbYAa5KKz8g7HYlm51bZjVOBNL7WncQ== Date: Thu, 21 Dec 2023 18:31:45 +0100 From: Maxime Chevallier To: Andrew Lunn Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, 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?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Jonathan Corbet , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese Subject: Re: [PATCH net-next v4 10/13] net: ethtool: pse-pd: Target the command to the requested PHY Message-ID: <20231221183145.31c167c0@device-28.home> In-Reply-To: <5f3a74fe-11e4-4c6e-a77d-f9c4f6fab156@lunn.ch> References: <20231215171237.1152563-1-maxime.chevallier@bootlin.com> <20231215171237.1152563-11-maxime.chevallier@bootlin.com> <5f3a74fe-11e4-4c6e-a77d-f9c4f6fab156@lunn.ch> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com Hi Andrew, Sorry I forgot to reply to that one... On Mon, 18 Dec 2023 10:58:30 +0100 Andrew Lunn wrote: > On Fri, Dec 15, 2023 at 06:12:32PM +0100, Maxime Chevallier wrote: > > PSE and PD configuration is a PHY-specific command. Instead of targeting > > the command towards dev->phydev, use the request to pick the targeted > > PHY device. > > > > Signed-off-by: Maxime Chevallier > > --- > > V4: No changes > > V3: No changes > > V2: New patch > > > > net/ethtool/pse-pd.c | 14 +++----------- > > 1 file changed, 3 insertions(+), 11 deletions(-) > > > > diff --git a/net/ethtool/pse-pd.c b/net/ethtool/pse-pd.c > > index cc478af77111..0d9cd9c87104 100644 > > --- a/net/ethtool/pse-pd.c > > +++ b/net/ethtool/pse-pd.c > > @@ -31,17 +31,10 @@ const struct nla_policy ethnl_pse_get_policy[ETHTOOL_A_PSE_HEADER + 1] = { > > [ETHTOOL_A_PSE_HEADER] = NLA_POLICY_NESTED(ethnl_header_policy), > > }; > > > > -static int pse_get_pse_attributes(struct net_device *dev, > > +static int pse_get_pse_attributes(struct phy_device *phydev, > > struct netlink_ext_ack *extack, > > struct pse_reply_data *data) > > { > > - struct phy_device *phydev = dev->phydev; > > - > > - if (!phydev) { > > - NL_SET_ERR_MSG(extack, "No PHY is attached"); > > - return -EOPNOTSUPP; > > - } > > - > > It would be good to say in the commit message why it is safe to remove > this. That's a good catch, this removal is wrong and will be put back in the next iteration. > > @@ -132,7 +124,7 @@ ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info) > > /* this values are already validated by the ethnl_pse_set_policy */ > > config.admin_cotrol = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]); > > > > - phydev = dev->phydev; > > + phydev = req_info->phydev; > > if (!phydev) { > > NL_SET_ERR_MSG(info->extack, "No PHY is attached"); > > return -EOPNOTSUPP; > > So you removed one test, but this one stays? Thanks for the review, Maxime