Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1495070rdb; Sat, 3 Feb 2024 08:25:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVtupqsZ4J5bjQWRQcytoSIOwLD8Z5CbJTE+PlwUplfvze7tFPWMRYi+fnp11UOZjefYLP X-Received: by 2002:a2e:8908:0:b0:2d0:7836:5453 with SMTP id d8-20020a2e8908000000b002d078365453mr4513167lji.19.1706977552431; Sat, 03 Feb 2024 08:25:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706977552; cv=pass; d=google.com; s=arc-20160816; b=eAdSI4kPNthfxOIKKkINnCrajU7/kM9mPNamFGxGEsXUQTSUZpV5L6EW1ahRrMgSaI c+DU3tJ2TTlnCEK606MivXFcHzWZA69x73V3fusaU5Bb/f/MQ393/mqSajB7zgtIkUII rsrDgidgBSG5MpuOGu+OkMO9bIQndmXcHh2MMkEknZiNWH+uPWbfQlckk+DhJ9Chal/U tbfRcv3bbhOy3l6bqVy45rntHRXwbrDrlOQB6m/0VaaZOBtLT8Y1pn3jkHTkkNUykVnY j5vXIWBnRU8UTDxato3ZMhggdj6YijN1sO/NT569+IVsovIkla57RZYUzuFJbPEYGKSY Dsgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4djEjuQQh7CJm2rcKQ3SV1fnshnuP3wO2z85v1DRISU=; fh=2pZwNxkM/CxIhTlT6jlNzJcjJ70CKEbNJ/ToLAQgEmw=; b=q5EpmzavfPRLRTtbuu+an0IpSb6u9ootTfjP2IE8Elj3EKkFFLpUpP59Alv4xCW0Da 3VGNaQ4LeOgYvc7ulVyIkClBCYEGZdBNJjEaamu5kS5JA/L0eI1yye+6STPoqGw5R1oI gajQvm1JorgqKOjZY01K9NQRqejjY0bxj3BMSUpj1b+KLpwkr0Ya/TXnxGuOzzXUiSAe vP3VFD28QjuZp6qZqY1q/2PBzcW+0LXdUdF1GblT5HxqrmqMXe9k+LG6VPivonyrNh5X qm1tUFOH1aRD1n1HboGe9PJ56oBK99Di9RrE9crp2xjAWJQFcpTvd0puFAxuByh/2Z3j IfVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2lLAyxbH; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-51180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch X-Forwarded-Encrypted: i=1; AJvYcCXDU729O9CLxpQ9FyC0Z9bkW57pkv1bYbUOM/Luea48aaTXq863rHHgF2QbaJ5+LMrWsrscFnlmtIdrkGJQrJY9U9Rh2+8GHSCkM4yfCQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y88-20020a50bb61000000b005569cab2645si1990767ede.5.2024.02.03.08.25.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 08:25:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2lLAyxbH; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-51180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2E80B1F232A1 for ; Sat, 3 Feb 2024 16:25:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DC035F851; Sat, 3 Feb 2024 16:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="2lLAyxbH" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 755CF58206; Sat, 3 Feb 2024 16:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706977536; cv=none; b=mBEaenqDutFcjHq6+krDJKnkeH73pq6nzQcUIfI/Cu3HqbISwyfzGsq49Tv/6zcRRQhZy/Z0/stcuoQt9q900MEXQ+C8l/qBfXS0sClys3xfXhIqXcANKyE0LeTBepl7cXiWTXsNgEQfHK960Z53WkvrPmTiQmjKscXqCQfiZbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706977536; c=relaxed/simple; bh=vWy0Zx39e4wmgFNDFPUH6HFaDxM9TNK1v6d9d2+MVE0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dlMx3mv+n0P9ghj0uJ9TXo7pctnIbWNtwgRBGuQpYs4f0wGmNBymofL2rvMMqBRXGXVjR4sqy8va/EG+0/VclaVPX/p/piPCgqLwYpU1jWNVbs780+Wk4RBZRjufcOITKWZAx9x0vbRW86h8WLYQZ3PIiJQUH1iux/+Dlb7m7+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=2lLAyxbH; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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=4djEjuQQh7CJm2rcKQ3SV1fnshnuP3wO2z85v1DRISU=; b=2lLAyxbH+7u/rQ2fN8is/U0PSy zy9m9wMMdFiIMIaQYnPZd1qcz7HhGAraK1eO2zuCDS66BBJsDS5jHUCoPXwqe6IkhA3OnGmmNzN/d nFFk4s63sIR1BliZKt808FdHcKr4D4OQiZKa5EA1M2/GsSvFYljoJMTVquL0dqDAgGGs=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rWIpX-006udA-V2; Sat, 03 Feb 2024 17:25:23 +0100 Date: Sat, 3 Feb 2024 17:25:23 +0100 From: Andrew Lunn To: Christian Marangi Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Heiner Kallweit , Russell King , Frank Rowand , Robert Marko , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [net-next PATCH v5 7/9] net: phy: qcom: add support for QCA807x PHY Family Message-ID: References: <20240201151747.7524-1-ansuelsmth@gmail.com> <20240201151747.7524-8-ansuelsmth@gmail.com> <65bd29f9.050a0220.a175d.3d5f@mx.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65bd29f9.050a0220.a175d.3d5f@mx.google.com> On Fri, Feb 02, 2024 at 06:44:22PM +0100, Christian Marangi wrote: > On Fri, Feb 02, 2024 at 02:35:11AM +0100, Andrew Lunn wrote: > > > +static int qca807x_read_fiber_status(struct phy_device *phydev) > > > +{ > > > + int ss, err, lpa, old_link = phydev->link; > > > + > > > + /* Update the link, but return if there was an error */ > > > + err = genphy_update_link(phydev); > > > + if (err) > > > + return err; > > > + > > > + /* why bother the PHY if nothing can have changed */ > > > + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link) > > > + return 0; > > > + > > > + phydev->speed = SPEED_UNKNOWN; > > > + phydev->duplex = DUPLEX_UNKNOWN; > > > + phydev->pause = 0; > > > + phydev->asym_pause = 0; > > > + > > > + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) { > > > + lpa = phy_read(phydev, MII_LPA); > > > + if (lpa < 0) > > > + return lpa; > > > + > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, > > > + phydev->lp_advertising, lpa & LPA_LPACK); > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, > > > + phydev->lp_advertising, lpa & LPA_1000XFULL); > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT, > > > + phydev->lp_advertising, lpa & LPA_1000XPAUSE); > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, > > > + phydev->lp_advertising, > > > + lpa & LPA_1000XPAUSE_ASYM); > > > + > > > + phy_resolve_aneg_linkmode(phydev); > > > + } > > > > This looks a lot like genphy_c37_read_status(). Can it be used? > > > > Yes but I had to expand genphy_c37_read_status. Hope it will be OK. You can expand it, but please keep to what is defined within 802.3. We don't want any vendor extensions in this common code. Vendor things should be kept in the vendor driver. So you can call genphy_c37_read_status() and then do any vendor specific fixups needed. Andrew