Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5492202rwl; Sun, 8 Jan 2023 16:30:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxR4YldSc71qlRH5hCV9HK5gx/6qfS17p7HrG+OjZrhiIQhI8NQkW7fJfhsk6/7s/clzS8 X-Received: by 2002:a05:6402:3894:b0:48f:68b1:db4e with SMTP id fd20-20020a056402389400b0048f68b1db4emr14986821edb.27.1673224212668; Sun, 08 Jan 2023 16:30:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673224212; cv=none; d=google.com; s=arc-20160816; b=unzdF3RViqUXqc6bt/kO/Q3GDhjki0YxD6z3eoz/+vA9sPz7FwKFaBI6vAMu4p7NpT onJTQk6XSGeJRpBXReCvgx2rziEspVHy8mBOxK3ZrQ7/eYnAu0eJBC+tbZxiSAYe87te V6h5Hif7Z2A/HhwMGRq7GIZvyWsgjMzowv2YpARyd5G6B9RI+FISue+V0vAZJtR1GEvW IeWeq7LKuktgs4t/e1ZzjabekLNvAMXAoLt9JWR5KIRFCxKC615bObBrrqKVCIR7+MFQ hAHs4GZL4SL/K9KaDvzo2xwjvqMaAARgXVPSpyvemyqskW7h+X07kjWTVl/ozQHebL0Q AUvw== 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=u4A0bDRa/R2/JRiiWr/AsAmLFcd2KvFBs/zLsNWm1MM=; b=zv5xW3tfMl3mgeTsvMarICN11DMthWbzUXCMZqpcm4yOSvtE1sTWK2CuBjqEGqE8fV 2eySsv6H0i4nyimOAdauZfxZRvOsz1Kn2Sm/yKMAUSZqbFoQPcVJFGnw9xPu4KIBXEBT Kee3h+qecgkXKmxfZCIg+p01WT49oS0uq5/LjvZQwSdUCnBcCRMWsr3ySu80nBCfKIdB 6/DrLcCRdlrhizYqSL4L4D38llcofjVMqqO3ZoJXQVxPXBaUQpP7oUibkZ1akwCuOrVo JO7V2VSPK5fkDSWtz1e+J8sBbbBVZS0CA5KYaG7+PaD3XPooGFAr6L+EX44fGD6QJJb0 EWzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="F/g7Hns+"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402350900b004853521ef69si9337050edd.258.2023.01.08.16.29.57; Sun, 08 Jan 2023 16:30:12 -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=@gmail.com header.s=20210112 header.b="F/g7Hns+"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229613AbjAHX5L (ORCPT + 54 others); Sun, 8 Jan 2023 18:57:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbjAHX5I (ORCPT ); Sun, 8 Jan 2023 18:57:08 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F3A26C0; Sun, 8 Jan 2023 15:57:07 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id ay40so5142548wmb.2; Sun, 08 Jan 2023 15:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=u4A0bDRa/R2/JRiiWr/AsAmLFcd2KvFBs/zLsNWm1MM=; b=F/g7Hns+kfqSmM7vvlFrL7oFLXkIID/T2XfN+KPJzdjmhN++ek1jakL6SKaefXNFxy 00becfZRkraXZOsVn6D8+ynJUm0O0W3ae84p33xxgRNj0uqps/z5h5qluaU42byVBbOv R8f7LYLU60vsXG5wvcEMtF7nBPFpgavXWFPjIei5ip0LFgc7RYRTIJfcASKO9U/17ZQF 34NI9d0qtCSvuMIe/RADYEqxI+ZdZ8PBznatUaR2kHz0zPhWFWz/hf+K0eCxteid1BAC +yfwMsHM+2yoqkcKvDBEzlzLJEUWICKSZdDHba/NRuMa4ABhudUzQYN2MK4IhItUO73g HYTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u4A0bDRa/R2/JRiiWr/AsAmLFcd2KvFBs/zLsNWm1MM=; b=qTY032qaEa3u8WG9W0K7GNTb/ryr1ZCtG+P9mO7D0y6OGt7r/Jd7TwCKQCiVX8qjsg GFc/rjt8OCr19dc75dY5KNdUs4Q5/DO+NTzY3GUS/YS55+F/mtip6dL6va0IcWiEfxGD wb5S2XmI4Py+5Zm8Vv1+eSxAsE0joOmMpBlQG8hCdsi5d6Wnf6eTNPepQhTWuIi/CUpM PPZtXj4e1PexeDw/sRP/m6nUGbGQDS6udtXqVwGX94ZCZJD8UyV5zPW1cRELCbdNhudV oWrhDXbnOLKo7YW4GZF7/Vx7MnGxcChLeaLIcANGoZ0zvIPvTXo5rDDvo1v7eqEuvJ+H +vKg== X-Gm-Message-State: AFqh2kroMTNFyGjDkUT3LV7M57m08Foxe14nT4L7xHKntFWIptXzQNSg pRE8BTzkZ8Pg5rQKE3GInBoDr5unX/tGF1vF X-Received: by 2002:a05:600c:4f93:b0:3d9:e5f9:984c with SMTP id n19-20020a05600c4f9300b003d9e5f9984cmr3671476wmq.2.1673222225675; Sun, 08 Jan 2023 15:57:05 -0800 (PST) Received: from gvm01 (net-5-89-66-224.cust.vodafonedsl.it. [5.89.66.224]) by smtp.gmail.com with ESMTPSA id j18-20020a05600c191200b003d9dee823a3sm9309598wmq.5.2023.01.08.15.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 15:57:05 -0800 (PST) Date: Mon, 9 Jan 2023 00:57:03 +0100 From: Piergiorgio Beruto To: Andrew Lunn Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Oleksij Rempel , mailhol.vincent@wanadoo.fr, sudheer.mogilappagari@intel.com, sbhatta@marvell.com, linux-doc@vger.kernel.org, wangjie125@huawei.com, corbet@lwn.net, lkp@intel.com, gal@nvidia.com, gustavoars@kernel.org Subject: Re: [PATCH v2 net-next 5/5] drivers/net/phy: add driver for the onsemi NCN26000 10BASE-T1S PHY Message-ID: References: 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Sat, Jan 07, 2023 at 07:23:59PM +0100, Andrew Lunn wrote: > > +++ b/drivers/net/phy/Kconfig > > @@ -264,6 +264,13 @@ config NATIONAL_PHY > > help > > Currently supports the DP83865 PHY. > > > > +config NCN26000_PHY > > + tristate "onsemi 10BASE-T1S Ethernet PHY" > > + help > > + Adds support for the onsemi 10BASE-T1S Ethernet PHY. > > + Currently supports the NCN26000 10BASE-T1S Industrial PHY > > + with MII interface. > > + > > config NXP_C45_TJA11XX_PHY > > tristate "NXP C45 TJA11XX PHYs" > > These are actually sorted by the tristate string, which is what you > see when you use > > make menuconfig > > So 'onsemi' should be after 'NXP TJA11xx PHYs support'. Also, all the > other entries capitalise the first word. As for the order I fixed it. Thanks for noticing. Regarding the capitalization, I have a little problem here. 'onsemi' is a brand and according to company rules it MUST be written all in lowercase. I know we're not obliged to follow any company directive here, but as wierd as it might sound, I'd rather keep it lowercase just not to get comments later on trying to fix this, if you agree... > > > depends on PTP_1588_CLOCK_OPTIONAL > > diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile > > index f7138d3c896b..b5138066ba04 100644 > > --- a/drivers/net/phy/Makefile > > +++ b/drivers/net/phy/Makefile > > @@ -77,6 +77,7 @@ obj-$(CONFIG_MICROCHIP_T1_PHY) += microchip_t1.o > > obj-$(CONFIG_MICROSEMI_PHY) += mscc/ > > obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm.o > > obj-$(CONFIG_NATIONAL_PHY) += national.o > > +obj-$(CONFIG_NCN26000_PHY) += ncn26000.o > > obj-$(CONFIG_NXP_C45_TJA11XX_PHY) += nxp-c45-tja11xx.o > > obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o > > obj-$(CONFIG_QSEMI_PHY) += qsemi.o > > This is sorted by CONFIG_ symbol, so is correct. > > > + > > +// driver callbacks --------------------------------------------------------- // > > Comments like this don't really add any value. Sure, I can remove it. > > > +static irqreturn_t ncn26000_handle_interrupt(struct phy_device *phydev) > > +{ > > + int ret; > > + > > + // read and aknowledge the IRQ status register > > + ret = phy_read(phydev, NCN26000_REG_IRQ_STATUS); > > + > > + // check only link status changes > > + if (unlikely(ret < 0) || (ret & NCN26000_REG_IRQ_STATUS) == 0) > > + return IRQ_NONE; > > More usage of unlikely(). If this was on the hot path, handling 10M > frames a second, then maybe unlikley() could be justified. But how > often do you get PHY interrupts? Once a day? Right, it is my instinct to use unlikely on any sanity check which is effectively unlikely to happen. But I understand it is not needed here. > > Andrew