Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4115626rwl; Sat, 7 Jan 2023 11:20:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXuFL1POAeN5RNjBigj9Mxlvx+SDMJQKiYWS1a3VgTrs/hFtH/SXjWvZ502mOUkGFaC2n7EU X-Received: by 2002:a17:907:b608:b0:7c1:4623:400e with SMTP id vl8-20020a170907b60800b007c14623400emr56374281ejc.16.1673119235563; Sat, 07 Jan 2023 11:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673119235; cv=none; d=google.com; s=arc-20160816; b=nMSYY3A9QkAw9v/jRF/ud/q2mUKAaWIBoDlP2Yf25yWpidiZGDQpequ3CLMdQ24It1 n1an64k5xlZGEIMpHzinIKG5d+LCmz0b4TPb1QPpC+mhODG5rBDHPNP28A4dVt7DvnUn 0Kbdjo9j9AKxP0cf8NB2Ac+utVoydO+RudOMdMoNsf3aA5J4/ixMh3MdhZuf+etB3tmw gbotyN5jaV4jJWShMwlwHtEO7jfEfc+iPzTrDkdUj3a5A9Q18kIiIEssrvDezdF+q223 LXOLzcEFz+AeEnS/SXEnITP2AVe54au0w4J+roMHKL2C7Ft4UKWxqiCtu5p1XphLpmto 3sDg== 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=rbaU3zKYZQm8LWw+XTHjZPw1N0FWGhaOeYaSMW68DXI=; b=lG08AS7nuSVHg8aL0Z1tEvBpsRTGpX0GBUYKhiw7BOKD7EZ0g8ZscsF3fqt93V1xq9 T1nhHH1+hf3PVFj7BMGinAZ5l8J8iUzFev//zPlDjZbfo6MWdZGH8Z0h85j2YX0BVniB DitPsmp8O8xkgHXoB5LR+YAfYe1NbSRyP14IbvBkIGMINp7Y00erGF3blU4y2m0/LkfW jYyVeT8h5UGdyzRxMMLu832vSS3ohZbxsiYh3pfHd1vQ64PLuWtcpC/XFkDTGr3n38um LKsgSRgx50htdhL0a5O+PfwEZcCWSkKvZqn4l94QCvhEhdmu76fH2WTIX5e2OhE3Y6Jj rmMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Pgp7KRtq; 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 h20-20020a170906111400b007c0ef00a05csi3416060eja.922.2023.01.07.11.20.22; Sat, 07 Jan 2023 11:20:35 -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=Pgp7KRtq; 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 S232417AbjAGSYQ (ORCPT + 54 others); Sat, 7 Jan 2023 13:24:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbjAGSYL (ORCPT ); Sat, 7 Jan 2023 13:24:11 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69E2A1E3C4; Sat, 7 Jan 2023 10:24:10 -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=rbaU3zKYZQm8LWw+XTHjZPw1N0FWGhaOeYaSMW68DXI=; b=Pgp7KRtqGgcqKUSYc8VypUf5Zo nqiB4kHecWiWtl+zcdAwGdeeR7Q23CyBJ/QA48OHhpRkCC6nKh7+PJkxsXJQSrtySWqFT97xl8soE vUGX1azwTQgKWbdfWhz+hMAOQDIATH53xlOsMQqGB0Ed3ta8NlUymPSnzuhBizY2XT0U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pEDrL-001RC1-5S; Sat, 07 Jan 2023 19:23:59 +0100 Date: Sat, 7 Jan 2023 19:23:59 +0100 From: Andrew Lunn To: Piergiorgio Beruto 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,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 > +++ 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. > 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. > +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? Andrew