From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="zE86ahOr" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42DFA18F; Tue, 28 Nov 2023 05:07:03 -0800 (PST) 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=+QDr7FZdswsmhujjfQTl7Q0WFf24+WtuOdWnrF5DdMc=; b=zE86ahOrssNDjMD79VtBHlpVS2 Snh113YLIK2OnmSoeHgAlgOm3YIlo1MArenj6rrcSIaStEiK90wXM3qcmITrLj2iBjWlBugMHWj6O l4hLf7RhDZaURAILTi8CGsyQ9IZcidBp62EKPIRvn854TR961e7c4671tf4pwhPMgivOZybs1uS17 DNIfkaFgBe5xTauKb3nVzx9wUilQIb0/Q/iZrh8kEFSW2Kh53IrOevv4kudN5DshETu5eLx+TdS7F 9tePe+ey1jy4sbUngQpwC9NF0GnhwULknEGYMHs4J9uF9t1IzMvrhbdt6IfNut5Kme37MkmOhKG6L ti8PgdeQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:52666) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r7xnj-0007JY-33; Tue, 28 Nov 2023 13:06:55 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r7xnk-0002yN-UJ; Tue, 28 Nov 2023 13:06:56 +0000 Date: Tue, 28 Nov 2023 13:06:56 +0000 From: "Russell King (Oracle)" To: Christian Marangi Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Robert Marko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [net-next PATCH v2] net: phy: aquantia: drop wrong endianness conversion for addr and CRC Message-ID: References: <20231127002924.22384-1-ansuelsmth@gmail.com> <6565e0e4.5d0a0220.26ded.fe1e@mx.google.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: <6565e0e4.5d0a0220.26ded.fe1e@mx.google.com> Sender: Russell King (Oracle) On Tue, Nov 28, 2023 at 01:44:39PM +0100, Christian Marangi wrote: > Also the CRC returned from the mailbox CRC has to be converted with > le16_to_cpu since it's LE and won't match on BE system. Am I wrong? I think you are. As I've said before, everything transferred over the MDIO bus is totally independent of the CPU endianness. Bit 0 in the registers on the PHY will appear in bit 0 of the CPU register, and bit 15 in the registers on the PHY will appear in bit 15 of the CPU register. If this weren't the case, then if we access the BMCR register, and the BMCR contains 0x1140 (indicating AN is enabled, full duplex, 1000Mbps) then if these were CPU endian-dependent, we'd end up reading 0x4011, and that will break phylib _and_ user applications (these register definitions are exported to userspace.) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!