Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp980766rdf; Wed, 22 Nov 2023 02:13:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxEX14G3iVekmBzhfLtdQ1sh9ImyjihmooZjrcgeW8fibOOPelQYoft2aWBH00mr8e8VyH X-Received: by 2002:a17:903:11c5:b0:1cf:6ac3:81ba with SMTP id q5-20020a17090311c500b001cf6ac381bamr1851558plh.57.1700648002402; Wed, 22 Nov 2023 02:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700648002; cv=none; d=google.com; s=arc-20160816; b=a6DcMp2WplCjHfVYUL/zVZKgsEWdc7/IUMoaNrP2m92sd2drviVwvGXmdpsvxmX3u+ QZRcH8fkstsL7PU4bInHhq/fKU6p4IQ3oOQ8k07Poi6b+BlNyuOBEA9iUFfW5pm8zJJW 6wipQ4ttB+sY7b7zzcRyfxTdrsY+/0YSz/XObgGfU0Mi9H+pASwViQw0PUVO8H36gZ8N fkU9ZyS18EfHMDImkazSuAXJMYxyGsGKqcSkJ//4e5LVqhuXFsTZqY2iJUdc2hesh+iX 74elDf4YsIqp3A+FJe4cV8mIDUO3iycCIz0kY/BagMCe6PJpeIbGSFmTwu9ABYeZKxDR qKtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=w6RwZNjGanLOCTIORZpzLlR22CGNQ1cVDCQgks5j9Fw=; fh=seJURcEqd8fN2v2uTj2u3D6767oC1izjrIUGP64nnB8=; b=MtZG2tvW+VkBX3jTGJPo6Z9n9Nb91zryq/fTeF/MiUzT6cPugcP4NIInqTLVINusJr wkNodqCk25rXMxPvDAZ7wAqEKK4gI4oORpmmiBkTsfZ4E2gFufzY9IjGKoNuLFguVxgh u/PqmWqusbRirnTX/kDcIhhdrSPp+W9Z+utoZhDmxjdfZ7cIL0GUKw8gz3mWA4QH/OeO udjaGSe2IOm0VO585G2bQW7CJvJO04sVfTcL6J7WAlcrLyvP9jHkayYgJV+orY4Sny1n nObrWyRVqrP/VJoYgBIB1bE8+PGkrt1uDTAi/fLZzDrnnIPwXPBx1g5u9BaZVU6dJsmD 6axg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=cDHtQx7u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o7-20020a170902d4c700b001c0cbaf6970si11314237plg.501.2023.11.22.02.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 02:13:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=cDHtQx7u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B9E5D8022842; Wed, 22 Nov 2023 02:13:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235325AbjKVKNH (ORCPT + 99 others); Wed, 22 Nov 2023 05:13:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235129AbjKVKNF (ORCPT ); Wed, 22 Nov 2023 05:13:05 -0500 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 179DE198; Wed, 22 Nov 2023 02:12:58 -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=w6RwZNjGanLOCTIORZpzLlR22CGNQ1cVDCQgks5j9Fw=; b=cDHtQx7uD/ANOBEo+ZQvbLYDwd QdbMOatlKS02CgNRWy9Ft+2lOwCYVjcEABfMaphNBkxHKc6fhmXrhdDqgVuGXTq72ZJxtpj3vg+Hr vwx5V7clHXIR42QA6tBUVuwfs9B0TmRVX/mFrwOusoLPFs5eOzQRkN1O9OR6WOXDk9YQEzJocDcFS szS3guFTdlBKgZD9Lj1gN09t/JDs1lAvT/OVOLC+Uzmprh+KMIVuOFTxLuHv1k8LUaDGiud0DuJX9 6TlLQMwDImlijhDhMoJfUe/8nBqC54oaaFctEXFen9+SqXvRg7fPXj3kx0cphWQ8hMwUDEXavWrgQ t1EIchrw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37812) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r5kDw-0008Lo-04; Wed, 22 Nov 2023 10:12:48 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r5kDw-00056a-SQ; Wed, 22 Nov 2023 10:12:48 +0000 Date: Wed, 22 Nov 2023 10:12:48 +0000 From: "Russell King (Oracle)" To: Jakub Kicinski Cc: Christian Marangi , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Paolo Abeni , Robert Marko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [net-next PATCH] net: phy: aquantia: make mailbox interface4 lsw addr mask more specific Message-ID: References: <20231120193504.5922-1-ansuelsmth@gmail.com> <20231121150859.7f934627@kernel.org> <655d3e2b.df0a0220.50550.b235@mx.google.com> <20231121153918.4234973d@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231121153918.4234973d@kernel.org> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 02:13:19 -0800 (PST) On Tue, Nov 21, 2023 at 03:39:18PM -0800, Jakub Kicinski wrote: > On Wed, 22 Nov 2023 00:32:56 +0100 Christian Marangi wrote: > > the 2 addr comes from a define > > > > #define DRAM_BASE_ADDR 0x3FFE0000 > > #define IRAM_BASE_ADDR 0x40000000 > > > > it wasn't clear to me if on BE these addrs gets saved differently or > > not. PHY wants the addr in LE. > > > > On testing by removing the cpu_to_le32 the error is correctly removed! > > > > I guess on BE the addr was actually swapped and FIELD_GET was correctly > > warning (and failing) as data was missing in applying the mask. > > I think so. It's the responsibility of whether underlies > phy_write_mmd() to make sure the data is put on the bus in > correct order (but that's still just within the u16 boundaries, > splitting a constant into u16 halves is not endian dependent). MDIO bus accesses via the MDIO bus accessors are expected to produce the correct value in CPU order no matter what endian the host platform is. So if the BMCR contains the value 0x1234, then reading and then printing this register is expected to produce 0x1234 irrespective of the host CPU architecture. We do have 32-bit values split across two registers in clause 45 PHYs, namely the MMD present register pair. Another example is the PHY ID. In both cases we read the registers and apply the appropriate shift. See get_phy_c45_ids() and get_phy_c22_id(). Note that these, again, have to work independent of the CPU architecture. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!