Received: by 2002:ac8:6d01:0:b0:423:7e07:f8e4 with SMTP id o1csp6627797qtt; Mon, 18 Dec 2023 01:59:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6CObW1s91sy+y7+6todwSm4wnW4wB1VD8BaWQpDUPt8EEILnjloecvksvE2AnN0uCxDg1 X-Received: by 2002:a05:6870:a40d:b0:1fb:75a:6d45 with SMTP id m13-20020a056870a40d00b001fb075a6d45mr20433146oal.108.1702893550001; Mon, 18 Dec 2023 01:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702893549; cv=none; d=google.com; s=arc-20160816; b=P444Id/e5Z1lDG/6wyiOzcFQfOkRQ81HyN3uj12Kvcb4DcrRClaca5dU1zJA7ntI7m KLftn9a32porn2E56rVx26GuUH3IXThk31/6Npbo14luIfTSMEPRDfMzHNnIxrRB+E8d VmvLXPzntSZ8lgaYcL4VaImfU1E+Wz5HW6Iz+tnzDzIZlOTrXf6/vyw7c8PD2UglfbAX w5gn3mUJCjcTS72EDNB17VlUWlysfwGkAa5FAqVlecxSM+f9LEUOA/Hu8gtJg219CClJ AZvCbVUOK2xoYsLVWwA396JrLUp8QaQFbu74ZDAbryPfJW3DSu3ci1vtzyWiD7DtSqW+ TH/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oy2S57Ia795NCnjW5zgqmFnUT8qKZ0VYqVrGM8Qzdt0=; fh=Q+IcUsh4l2m3701WfbZB/nnC77ysPD3LXNP6vpNjdZQ=; b=W6HbGKbj4bwknSlUXyLckQXbRV+BCQa2JIqxxOrnpnNM2AokHoQOiqgpGaAzGlwHzE UOD6ZsRkD1EXBbguXH/NOxHjXOxj+HrLTVxvlsAJckCxQgtwijfOwzsyTlYKJLv64g4N nqHRi4vdpUE69S2D+fYT6p+af+5jHEg5Rm6pxSEjjAEeRtI8pp+eXPpFTC1m0GSmHLEH D06dA9sx2f0ULQU9fJEtRnkW3qkNLuqsEShTmM3GC3Ud1IhTQxHFT/j0yVPxTId7dtwU 4Z3hqohNDg3INvkguFZO/geCCMuMKvOkIwVQcJBZVl2hX7oXbDMR0oDOIz4VU9fsqXGu 8Nmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=jCdHceUW; spf=pass (google.com: domain of linux-kernel+bounces-3282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u6-20020a6540c6000000b005c60319035dsi17123408pgp.835.2023.12.18.01.59.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 01:59:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=jCdHceUW; spf=pass (google.com: domain of linux-kernel+bounces-3282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AB421B21E8F for ; Mon, 18 Dec 2023 09:59:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A822134C6; Mon, 18 Dec 2023 09:58:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="jCdHceUW" X-Original-To: linux-kernel@vger.kernel.org Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 B05A813FFB; Mon, 18 Dec 2023 09:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=oy2S57Ia795NCnjW5zgqmFnUT8qKZ0VYqVrGM8Qzdt0=; b=jCdHceUWD3PsaQmS/oFMeVfJ2o 7BLA8GOd1jGU5ZpJmX8+Jn0GS4HKTcIW/Ft9DX4jPUZykcGlAwpgw62tEuL945S2WSe42du458N15 abj0cn2QjZduhb0eLOn7D1y3tHjS02Aut+19Fpepj1Pw7TX73S2v/l7aHDOBzXgj1da8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rFAOM-003ENO-9a; Mon, 18 Dec 2023 10:58:30 +0100 Date: Mon, 18 Dec 2023 10:58:30 +0100 From: Andrew Lunn To: Maxime Chevallier 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 , =?iso-8859-1?Q?K=F6ry?= Maincent , Jesse Brandeburg , Jonathan Corbet , Marek =?iso-8859-1?Q?Beh=FAn?= , Piergiorgio Beruto , Oleksij Rempel , =?iso-8859-1?Q?Nicol=F2?= Veronese Subject: Re: [PATCH net-next v4 10/13] net: ethtool: pse-pd: Target the command to the requested PHY Message-ID: <5f3a74fe-11e4-4c6e-a77d-f9c4f6fab156@lunn.ch> References: <20231215171237.1152563-1-maxime.chevallier@bootlin.com> <20231215171237.1152563-11-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231215171237.1152563-11-maxime.chevallier@bootlin.com> 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. > @@ -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? Andrew