Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4517524rdb; Tue, 12 Dec 2023 01:30:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgK1VzI6W3sycloWLyNG+EcZKTpEUmvu2XYNcExaz/y8fW9Ibk3QKDqkySbmLbAEhXXm0Q X-Received: by 2002:a17:90b:19d8:b0:286:7ec2:df49 with SMTP id nm24-20020a17090b19d800b002867ec2df49mr7130565pjb.9.1702373408047; Tue, 12 Dec 2023 01:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702373408; cv=none; d=google.com; s=arc-20160816; b=V7ZMvzs0e7lk7RMB9prO+j9FRH7RF5TMpCK3KmDMjDbWeHElsFE5ozPR4IJCWWHRxc FSqY774Yo57CQVtFe1w3G3gN/2GY64AuLAxiMkWjqR/To4nlv0G8mHpI3QUE7WjlhacV uKo6j+C5dhcNq/pPKWKdu0RN+dZ4LvpTHfsn9XGCpMrKmFHUvJr4L0e3rFXpHMg9a5sf tpZkzdSPcPz8YLiwEnGkxqKA1aTg0rXs+1PLa+xnwHoxF8XbKYM3zY97mFM2g1At4G9a gfdwq6LfFVhY5fpcQhEnM9R0OEZ0kt/pyxO55zcrM/41XRYcoz5tjwLupc8ASI85EfDY K9Xw== 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=Sjj8H82wdIWX8iuGwWZ52IpH6iVTqwTn08QKods/alY=; fh=4XFqYhoFoDZCNTsAMuumPWj6CnGttoVw9HRFMl4668g=; b=iXpnKvWaCAPe3qRaAhm+90FU44fgOvqp+wwvpvJS72rZja8jW352Y+lARf6nCkr8/W 91d1vABMgdZ1vnMH/gzYlAGxNnu31IdimEfeeznkWfer2HqO50lBp5mHBMJm4tzdjDrQ bhXQZStXh12WlbkK2boZpHxBzLqHA+ijPErhMgkFyCw1p7CjV/SxRpgBqIwTSCNbV+H0 O7viGMXJ/6EJCymE8I7/21uP7ytGUePYDhW5ucG76CzBg1Lsi2xjkRSMNb0XuMPTzgG6 /2FON4ck4SFmDlhFNdnff4GYUmtzUf5apcbzJl+M1S6E3KGO70eQAsMwJ/oMCrZOCQZ+ Z+gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTwITWbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id kx9-20020a17090b228900b002867c645d4bsi8907939pjb.13.2023.12.12.01.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 01:30:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTwITWbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6A11A80B6310; Tue, 12 Dec 2023 01:30:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbjLLJ3s (ORCPT + 99 others); Tue, 12 Dec 2023 04:29:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjLLJ3p (ORCPT ); Tue, 12 Dec 2023 04:29:45 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AA13BD for ; Tue, 12 Dec 2023 01:29:52 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4285AC433CD; Tue, 12 Dec 2023 09:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702373391; bh=Ps5ITAFrTNffoKTbdr5QWix/U8BhTCkdC1mM+gT+YJg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FTwITWbTYw+hFrcKSU3lB/55PJAIeDlBwfdMAWXVb/y6soQ69TLBM42ivf9bSP61/ R/2niqeeprQVU6NLmXITbpY9eS/JpgW1zsPoS4SG1fSmsC/0Fx9LMXlymYxJlMXz9y 6OhCKlYRORSWgUC4hCAh/aw78kN2m5MKCnsf54M/4lBwDZ8TXb8FVT3CLwkqUiMphP mL5etSzSNlD441R1skIQaiyo6poo9e+C8YEX4NvK2ySPADWZ/cfvMtDvoxKHBoQlwo 72FKMoZ4nh8sdbgr7/FsUIsE/i4Pw/mCfwcFlrn9pi5S6ZS9EQAzA62QbShepCunV+ WsDZ8mMuVzHaw== Date: Tue, 12 Dec 2023 09:29:43 +0000 From: Simon Horman To: Daniel Golle Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Heiner Kallweit , Russell King , Alexander Couzens , Qingfang Deng , SkyLake Huang , Philipp Zabel , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org Subject: Re: [RFC PATCH net-next v3 5/8] net: pcs: add driver for MediaTek USXGMII PCS Message-ID: <20231212092943.GS5817@kernel.org> References: <07845ec900ba41ff992875dce12c622277592c32.1702352117.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07845ec900ba41ff992875dce12c622277592c32.1702352117.git.daniel@makrotopia.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 01:30:05 -0800 (PST) On Tue, Dec 12, 2023 at 03:47:47AM +0000, Daniel Golle wrote: > Add driver for USXGMII PCS found in the MediaTek MT7988 SoC and supporting > USXGMII, 10GBase-R and 5GBase-R interface modes. > > Signed-off-by: Daniel Golle Hi Daniel, some minor feedback from my side. ... > diff --git a/drivers/net/pcs/pcs-mtk-usxgmii.c b/drivers/net/pcs/pcs-mtk-usxgmii.c ... > +static int mtk_usxgmii_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode, > + phy_interface_t interface, > + const unsigned long *advertising, > + bool permit_pause_to_mac) > +{ > + struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs); > + unsigned int an_ctrl = 0, link_timer = 0, xfi_mode = 0, adapt_mode = 0; > + bool mode_changed = false; nit: please consider arranging local variables in networking code in reverse xmas tree order - longest line to shortest. This may be useful: https://github.com/ecree-solarflare/xmastree ... > diff --git a/include/linux/pcs/pcs-mtk-usxgmii.h b/include/linux/pcs/pcs-mtk-usxgmii.h > new file mode 100644 > index 0000000000000..ef936d9c5f116 > --- /dev/null > +++ b/include/linux/pcs/pcs-mtk-usxgmii.h > @@ -0,0 +1,27 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef __LINUX_PCS_MTK_USXGMII_H > +#define __LINUX_PCS_MTK_USXGMII_H > + > +#include > + > +/** > + * mtk_usxgmii_select_pcs() - Get MediaTek PCS instance > + * @np: Pointer to device node indentifying a MediaTek USXGMII PCS nit: identifying ./scripts/checkpatch.py --codespell is your friend here. > + * @mode: Ethernet PHY interface mode > + * > + * Return PCS identified by a device node and the PHY interface mode in use > + * > + * Return: Pointer to phylink PCS instance of NULL > + */ > +#if IS_ENABLED(CONFIG_PCS_MTK_USXGMII) > +struct phylink_pcs *mtk_usxgmii_pcs_get(struct device *dev, struct device_node *np); nit: The kernel doc above does not match the signature of mtk_usxgmii_pcs_get(). ./scripts/kernel-doc -none is helpful here. > +void mtk_usxgmii_pcs_put(struct phylink_pcs *pcs); > +#else > +static inline struct phylink_pcs *mtk_usxgmii_pcs_get(struct device *dev, struct device_node *np) > +{ > + return NULL; > +} > +static inline void mtk_usxgmii_pcs_put(struct phylink_pcs *pcs) { } > +#endif /* IS_ENABLED(CONFIG_PCS_MTK_USXGMII) */ > + > +#endif /* __LINUX_PCS_MTK_USXGMII_H */ > -- > 2.43.0