Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6921579rwb; Mon, 12 Dec 2022 07:59:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Tmvyj8hWS7wBIOjisMo/4HN54NgF+VnUl3g5wqJnK5F/lqgPMaTLG2MWpPagu1vAmqRDZ X-Received: by 2002:a05:6a20:9e49:b0:a6:7529:7c99 with SMTP id mt9-20020a056a209e4900b000a675297c99mr22253575pzb.5.1670860792079; Mon, 12 Dec 2022 07:59:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670860792; cv=none; d=google.com; s=arc-20160816; b=JyNa38TzL7P6RzQzj9tMoy96eGichSEAGqbfjt9YfWMQN9igPmsoH0YNfx4/o+O8Ch fMowQWn7h+QdQ4tZHECx7Js4mkoI+pwra0ina1z9FPyOmnxJSMmMhyMEwgIo1pgjOpXe FnIHFzWkZs2gw0fIhIg8qSVkOuJs3xt/wTsLCxX19CZOUI2mmxrIP8Ut/mgAQJpocyU6 8dQxlcZdaOj/irCuK7nQqgH+/UKhZDPQb6fNU4FUgAsX9Qx4zl93QaxGEvIOPaZVHGtg 1cno8Wg+UqvLeN2GFw/C5d7Lgv2R5QG2mz19ZWP7Nh/sS2aPuICccIPqFYGobNk3RwKi t/3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d438kEu4qOLcbFU0URbQJriH5Y4n1xPR4eyQliRbNVg=; b=r9dqUG7epmkvFE8pbLp8WfJ5mLUYyeptzrZ3JJuUQuypP1N+kujOAm2OubeW399sCx gpBPI20OBc1tP5eAEAVuRuY+OvWOTnbAjNAwigKlp7Ld3kUkJhmYH4klCRlT15I/cOzE yje2uDQPEj/+MKAirnJvQ/GRFBWLgLAPLRe0F0N42Y44BO19BrEYCUyMxmhTYODrImUF H2x6meFSJSGccRwid6QryNA/HrG32nSV2sRrDr9z4zcx2UG6LQzMeikcKRIFU9Ohfdzv H8o8XMSTrsErfV/psvrlgkErVuM7DTAlzh2I0IQPotir8I/Nv54bzSvR6DOmY5aKbHBH D38g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=s74zTubE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s139-20020a632c91000000b0046e9babe7a1si9715963pgs.54.2022.12.12.07.59.41; Mon, 12 Dec 2022 07:59:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=s74zTubE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231633AbiLLPXa (ORCPT + 74 others); Mon, 12 Dec 2022 10:23:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiLLPX0 (ORCPT ); Mon, 12 Dec 2022 10:23:26 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C092DEC6; Mon, 12 Dec 2022 07:23:21 -0800 (PST) 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=d438kEu4qOLcbFU0URbQJriH5Y4n1xPR4eyQliRbNVg=; b=s74zTubE3Doqlg41fuRrBNF/o1 JP/4EJXdvCTx2Omjp//leDXooDFHx4iKbMNAy6UjIt6OULjw8OVYLeNQdMg42MP9yNsmtbyJLkEua k7ucGTq5RCmeeS4yosZJCD6kq+OuEgZ99PwhWMe+vqNe19XtIFmTmjqswt1wn71mcOnE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p4kdn-00562d-DZ; Mon, 12 Dec 2022 16:22:51 +0100 Date: Mon, 12 Dec 2022 16:22:51 +0100 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Piergiorgio Beruto , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Oleksij Rempel Subject: Re: [PATCH v6 net-next 3/5] drivers/net/phy: add connection between ethtool and phylib for PLCA Message-ID: References: <75cb0eab15e62fc350e86ba9e5b0af72ea45b484.1670712151.git.piergiorgio.beruto@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 On Sun, Dec 11, 2022 at 08:34:14PM +0000, Russell King (Oracle) wrote: > On Sun, Dec 11, 2022 at 08:03:15PM +0100, Piergiorgio Beruto wrote: > > On Sun, Dec 11, 2022 at 12:23:53PM +0000, Russell King (Oracle) wrote: > > > On Sat, Dec 10, 2022 at 11:46:39PM +0100, Piergiorgio Beruto wrote: > > > > This patch adds the required connection between netlink ethtool and > > > > phylib to resolve PLCA get/set config and get status messages. > > > > > > > > Signed-off-by: Piergiorgio Beruto > > > > --- > > > > drivers/net/phy/phy.c | 175 +++++++++++++++++++++++++++++++++++ > > > > drivers/net/phy/phy_device.c | 3 + > > > > include/linux/phy.h | 7 ++ > > > > 3 files changed, 185 insertions(+) > > > > > > > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > > > > index e5b6cb1a77f9..40d90ed2f0fb 100644 > > > > --- a/drivers/net/phy/phy.c > > > > +++ b/drivers/net/phy/phy.c > > > > @@ -543,6 +543,181 @@ int phy_ethtool_get_stats(struct phy_device *phydev, > > > > } > > > > EXPORT_SYMBOL(phy_ethtool_get_stats); > > > > > > > > +/** > > > > + * phy_ethtool_get_plca_cfg - Get PLCA RS configuration > > > > + * > > > > > > You shouldn't have an empty line in the comment here > > I was trying to follow the style of this file. All other functions start > > like this, including an empty line. Do you want me to: > > a) follow your indication and leave all other functions as they are? > > b) Change all functions docs to follow your suggestion? > > c) leave it as-is? > > > > Please, advise. > > Please see Documentation/doc-guide/kernel-doc.rst > > "Function parameters > ~~~~~~~~~~~~~~~~~~~ > > Each function argument should be described in order, immediately following > the short function description. Do not leave a blank line between the > function description and the arguments, nor between the arguments." > > Note the last sentence - there should _not_ be a blank line, so please > follow this for new submissions. I don't think we care enough to fix > what's already there though. > > > > > > > > > > + * @phydev: the phy_device struct > > > > + * @plca_cfg: where to store the retrieved configuration > > > > > > Maybe have an empty line, followed by a bit of text describing what this > > > function does and the return codes it generates? > > Again, I was trying to follow the style of the docs in this file. > > Do you still want me to add a description here? > > Convention is a blank line - as illustrated by the general format > in the documentation file I refer to above. > > > > > > > > > > + */ > > > > +int phy_ethtool_get_plca_cfg(struct phy_device *phydev, > > > > + struct phy_plca_cfg *plca_cfg) > > > > +{ > > > > + int ret; > > > > + > > > > + if (!phydev->drv) { > > > > + ret = -EIO; > > > > + goto out; > > > > + } > > > > + > > > > + if (!phydev->drv->get_plca_cfg) { > > > > + ret = -EOPNOTSUPP; > > Once more, all other functions in this file take the mutex -after- > > checking for phydev->drv and checking the specific function. Therefore, > > I assumed that was a safe thing to do. If not, should we fix all of > > these functions in this file? > > This is a review comment I've made already, but you seem to have ignored > it. Please ensure that new contributions are safe. Yes, existing code > may not be, and that's something we should fix, but your contribution > should at least be safer than the existing code. I have a patch ready for fixing the cable test examples of performing the test before taking the lock. I was going to post it to net-next in a couple of weeks time. Or do you think it should be to net? Andrew