From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 EA2243D34AB; Thu, 19 Mar 2026 12:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773925113; cv=none; b=RJ2BuOrlAGAKF6QdlGiivym+YpO2+SK8nSbdawtBk3hdsEhZ/SEfidYPmFDxaDCpbnkGUbIBgp/5hSPo+xRT0sA8c3xfwWBuIBxDQeyNPYIeywpq6PJv+xDnIKx0jfq2+ea82vRu9iaIteOqZ4MKhXA6w9wljdCrWGxOViqPiLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773925113; c=relaxed/simple; bh=cdknfVDKZfirBjvPbVt1AvVgcyHfvS3/uHlqeMpnjZg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iDyEm9T7zD1TQGs4DxiBnw8lalFUNDvDkZPgEGDer3S28s+F1MhxoIPbb3xt73XgP4fQcBEzbwUhg1+/F8zaz5dXYCFmBM7ziYWu7YhPm4vMW1VaZrZIpWGSEBCGyLrDM3oAcUgd+xZLCO9F+8LtEjYHOha4oyldGORJGhZnfeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=zxpv3RsH; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="zxpv3RsH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z7R0pn7ZfdsYWdr21Qctdy5ZMqO7uhqsnnOEXcHNYDI=; b=zxpv3RsH1j0RgeyxZ9QHdWZhmC lFnfS4AluSgqoW0Ktrf02KNVAy4qiftcMGC3jfrsFBWzpTqaQwAJ1AW+g8chPTOCmutDfi9k7Evaz KU1VJpc58NGgX2euaAZJhqiE0RxEiAteyQi7WxqXmCzkESLPGJxSWIbrWWcgCfW3TTTRkyNFQLIXB EpziFXgvzqIcLeViTs1sUUW1tm4DKdlRYwgOB+5xgeUF+zg0+vO5W6gqv3y1cvRlVZYExQpTEsBVW Pvzr1i6JlyzfF5+3xYYuwRhiSeImWqBxXJDeLeT40ly4HU9dvNv0LeJES9IpMlxtewEnK079koyAH UKG0/sxw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45602) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w3CxC-000000004lO-0Uh7; Thu, 19 Mar 2026 12:58:22 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1w3Cx8-0000000088u-3p1e; Thu, 19 Mar 2026 12:58:18 +0000 Date: Thu, 19 Mar 2026 12:58:18 +0000 From: "Russell King (Oracle)" To: Konrad Dybcio Cc: Mohd Ayaan Anwar , Andrew Lunn , Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, Paolo Abeni , Vinod Koul Subject: Re: [PATCH net-next 0/8] net: stmmac: improve PCS support Message-ID: References: <7566c66b-2dda-4b29-b59e-4e4a7e159e21@oss.qualcomm.com> Precedence: bulk X-Mailing-List: netdev@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: <7566c66b-2dda-4b29-b59e-4e4a7e159e21@oss.qualcomm.com> Sender: Russell King (Oracle) On Thu, Mar 19, 2026 at 11:09:33AM +0100, Konrad Dybcio wrote: > On 3/19/26 10:24 AM, Russell King (Oracle) wrote: > > On Thu, Mar 19, 2026 at 12:35:58AM +0000, Russell King (Oracle) wrote: > >> On Thu, Mar 19, 2026 at 03:42:05AM +0530, Mohd Ayaan Anwar wrote: > >>> [ 8.650486] qcom-ethqos 23040000.ethernet: clk_csr value out of range (0xffffff00 exceeds mask 0x00000f00), truncating > >> > >> Please look into this first - with the MDIO bus operating at > >> who-knows-what frequency, this could make reading from the PHY > >> unreliable. > > > > My guess is clk_get_rate(priv->plat->stmmac_clk) is returning zero, > > which means we don't know the rate of the CSR clock. > > > > From what I can see in drivers/clk/qcom/gcc-qcs404.c and > > drivers/clk/qcom/gcc-sdx55.c, this looks like this case - the > > struct clk_branch makes no mention of any clock rate, nor does it > > have any parent. From what I can see, neither of these drivers > > specify any rates for any of their clocks, which likely means that > > clk_get_rate() will be zero for all of them. > > > > Sadly, when I designed the clk API, I didn't think that people would > > be stupid enough not to implement the API properly, more fool me. > > > > Under the old code, we would've used STMMAC_CSR_20_35M, which means > > we're assuming that the CSR clock is between 20 and 35MHz, even > > though the value is zero. Is that the case? If it's higher than > > 35MHz, then you've been operating the MDIO bus out of IEEE 802.3 > > specification, which can make PHY access unrealible. > > > > In any case, please fix your clock drivers. > > I'm not 100% sure the currently-passed AXI clock is what we want > there and the docs aren't super helpful.. is there a synopsys-name > for it? What rates would you expect it to run at? There is no easy answer to that - it depends on the bus interfaces and whether the CSR (register) clock is separate. The likely possible names are hclk_i (for AHB master), aclk_i (for AXI master), or clk_csr_i. It does state that the CSR clock should have a minimum frequency of 25MHz to allow all statistics to be properly collected. The rate of the CSR clock needs to be known, as selecting the divider for generating MDC within IEEE 802.3 specifications is rather fundamental. You may find something there which hints at what rate the dwmac's CSR clock runs at. Hope this helps. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!