Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp457088pxx; Thu, 29 Oct 2020 06:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7qs1x7j+rLkaiQ6FypVKCVFhNbngLfBDUL7IiKXDnfAqdAKH5h9zKSJM0294b3qSn0rlT X-Received: by 2002:a17:906:6d99:: with SMTP id h25mr4099597ejt.281.1603978918914; Thu, 29 Oct 2020 06:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603978918; cv=none; d=google.com; s=arc-20160816; b=F28Ic1UYfT48c9wOHn8Bf/7G6Nn9/XYQhon8rgspx0PS2MEP4YGyrZ2QamLDwR1CIO nvfGaQlBg4vwuI+LZzPD3NOqJ/VzcwMl2ge1+ZbOwVNrm2d5H+HyzRlK/w9eUD4deHzu 0LIEkDf4PfSYwCk7K13q/NUUiSyvx5SgJlQFKxYxZH9ovDIIGQA0+CAZnNHv3njzVFPK eC1RzTOGSehX16BFW9vixdnTm09yZLWQSIW43wjHht00InKcv9EvQr8RPBoYG+M3sWAs h6ELmaoCCOfAYI6YOBd/G1A+B4YBRrQUlAuWarE7DHAv0HtLxcmb0R1E0XvyZbZW4WnO +S6Q== 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; bh=lVI3SViRAD8w9BitlPVWge+5z+1CmwgQ81ENdI89pX8=; b=uXrcIFhfcVPqWLZ4ce4tZ8Dg98l5V+SNsz+KkROUiey+z9vpNFiItkZQXKvNo5KZoq xU5P4EW8Uluk6vYW0LKqFkMltrmfwgoQNG8t+2oJlRcEj/WDv13AWspMR519DG2nJTnq ZsT4S67ENXuY91Y4uRzo2kqAG+o74ZDvSH0neOef5HsdDMXepdK8nWlIuJc1eFg/QETM /je4bP8v9cHVZQi2l8SAJ67PiDmWHTWKE+EMyL5kQChRuarsCB+38xEp8loUPhpqlqK0 I9h+arLMSBGjypuCiRBpZ074foKrfqX2E2gZxobq2Wxz5zP3l+OlMVbx3rbbEE3XPbSb O/MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm13si2003030edb.281.2020.10.29.06.41.35; Thu, 29 Oct 2020 06:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbgJ2NiK (ORCPT + 99 others); Thu, 29 Oct 2020 09:38:10 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:52204 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgJ2NiK (ORCPT ); Thu, 29 Oct 2020 09:38:10 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kY87r-004AMG-Fc; Thu, 29 Oct 2020 14:37:59 +0100 Date: Thu, 29 Oct 2020 14:37:59 +0100 From: Andrew Lunn To: Willy Liu Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] net: phy: realtek: Add phy ids for RTL8226-CG/RTL8226B-CG Message-ID: <20201029133759.GQ933237@lunn.ch> References: <1603973277-1634-1-git-send-email-willy.liu@realtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1603973277-1634-1-git-send-email-willy.liu@realtek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 29, 2020 at 08:07:57PM +0800, Willy Liu wrote: > Realtek single-port 2.5Gbps Ethernet PHY ids as below: > RTL8226-CG: 0x001cc800(ES)/0x001cc838(MP) > RTL8226B-CG/RTL8221B-CG: 0x001cc840(ES)/0x001cc848(MP) > ES: engineer sample > MP: mass production > > Since above PHYs are already in mass production stage, > mass production id should be added. > > Signed-off-by: Willy Liu > --- > drivers/net/phy/realtek.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > mode change 100644 => 100755 drivers/net/phy/realtek.c > > diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c > old mode 100644 > new mode 100755 > index fb1db71..988f075 > --- a/drivers/net/phy/realtek.c > +++ b/drivers/net/phy/realtek.c > @@ -57,6 +57,9 @@ > #define RTLGEN_SPEED_MASK 0x0630 > > #define RTL_GENERIC_PHYID 0x001cc800 > +#define RTL_8226_MP_PHYID 0x001cc838 > +#define RTL_8221B_ES_PHYID 0x001cc840 > +#define RTL_8221B_MP_PHYID 0x001cc848 > > MODULE_DESCRIPTION("Realtek PHY driver"); > MODULE_AUTHOR("Johnson Leung"); > @@ -533,10 +536,17 @@ static int rtlgen_match_phy_device(struct phy_device *phydev) > > static int rtl8226_match_phy_device(struct phy_device *phydev) > { > - return phydev->phy_id == RTL_GENERIC_PHYID && > + return (phydev->phy_id == RTL_GENERIC_PHYID) || > + (phydev->phy_id == RTL_8226_MP_PHYID) && > rtlgen_supports_2_5gbps(phydev); Hi Willy If i understand the code correctly, this match function is used because the engineering sample did not use a proper ID? The mass production part does, so there is no need to make use of this hack. Please just list it as a normal PHY using PHY_ID_MATCH_EXACT(). > } > > +static int rtl8221b_match_phy_device(struct phy_device *phydev) > +{ > + return (phydev->phy_id == RTL_8221B_ES_PHYID) || > + (phydev->phy_id == RTL_8221B_MP_PHYID); > +} Again, these appear to be well defined ID, so just list them in the normal ways. Andrew