Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp741133rdf; Tue, 21 Nov 2023 15:39:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHxpmPKqgp00YWKHXvfE8dLXBTcjphFnyRsYeTdli9k1YNUrndkdt63rTcEHyoepjFx4ZG X-Received: by 2002:a05:6808:211b:b0:3b5:69c2:59cd with SMTP id r27-20020a056808211b00b003b569c259cdmr967240oiw.25.1700609979690; Tue, 21 Nov 2023 15:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700609979; cv=none; d=google.com; s=arc-20160816; b=Tn4yyTZd1R99iXCJ5sncuIr9HV3oPoOHwCsLoLEBhXa1dT6QCGKN+MYp9we6TMIjE1 8VDzcTK+BQoaUY1LQbLHNOOyG/tinNEx4hBlksjXfeky2jAto8Vy09B6mE7AeVkIeaqO omgPx9fx9qYpqs623QvHHJMamRxFL+MmEpT+4bu9I10tkxAB5Fwy7FDHTthqreAlU8eX dqjrY5s24EP6W/n1SMuRWN7KI+Uth3Vgm2MVWZdJYD9iSVTGh2fsklRDq89FFjetpD/d HE4qQB56NSE5Pqf4Tf973nzMhQ/otTkV5atGDOHRDNbZYNVUCFec+2KZ08rxG3y5ioqg Zh9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=03cbrOzkcUAoil1X4M+A1M189W3gFHhpdyJEGUARRoc=; fh=SBtKWTNbcsVBil//aVgAw+U7cFFwFOCxN9/BQ1X0wBs=; b=Gj8pb0hkiZfAppqGI+CGXpAL6B7AH6kkVbRN+zX0meJq8b5t9p9vwQSaEV/a93GxYO O+azzDwjTO1KyRIAYJaLA/tFJwO8ACVmXawDR8L3HW9eXK9Oy6j4P2h+NqbauFP46/0y pbVErgrupjy25eJa6tKZTDze8cMgjI7E5SyCUfVd49N+JorRPomNOK2NG7OeAaqZugSd pgL7IOypNhpsyJE7wUqH06GjbNAKxC9mJgiixJkQK8FrQrsyWZGP+bN8znUZdMpy95dW VanuJrNZXn/NavL12gcu9qrPOfMTC6Dt/Cr1e1g1cH3XnZNXS0MQL0jqyLo5UWODaflc EsLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PhFltCL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q8-20020a63e208000000b0059b79bf220csi11251558pgh.662.2023.11.21.15.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 15:39:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PhFltCL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 56B0580DBAF7; Tue, 21 Nov 2023 15:39:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234563AbjKUXjZ (ORCPT + 99 others); Tue, 21 Nov 2023 18:39:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjKUXjY (ORCPT ); Tue, 21 Nov 2023 18:39:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 689D4D1 for ; Tue, 21 Nov 2023 15:39:20 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84DD3C433C8; Tue, 21 Nov 2023 23:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700609960; bh=RszxG6K3d072jCkBLTpgU6IMlmbsLSh8U2l2W3DjB44=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PhFltCL0gbtiIIW1uBM0Rn2oSxvzt0/b0DVLL45rNn90lyd/b9GmKyzps6Mi39Qht 7oTRbeOBlMQYX2hlDp6/lyuWy7Kyh1W0q+3fnblhM20p4Y23sxo3v9V5BVtuZFVCqL 6UKvElsYYkddh3T/jLy3D94Vwg5DQt2PPh/Yfs4y4Q3NgEVCbP1Bg2ongMRwODTZKW OCDGO6IODTj2VQE3A/zeHiqIK7n0K82RbUPO26Hm2uLm4div8Pr5mJgexoLxiYAtfV 46AoiSX9uHpF7pXuMA6AAyjAJBSlfwSyO7Lof/2rwESyJwE/XHLj3O5nNUAMfz6eCq jf8Ac3+K6e7qQ== Date: Tue, 21 Nov 2023 15:39:18 -0800 From: Jakub Kicinski To: Christian Marangi Cc: Andrew Lunn , Heiner Kallweit , Russell King , "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: <20231121153918.4234973d@kernel.org> In-Reply-To: <655d3e2b.df0a0220.50550.b235@mx.google.com> References: <20231120193504.5922-1-ansuelsmth@gmail.com> <20231121150859.7f934627@kernel.org> <655d3e2b.df0a0220.50550.b235@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 15:39:37 -0800 (PST) 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). > If all of this makes sense, will send a followup patch that drop the > cpu_to_le32 and also the other in the bottom that does cpu_to_be32 (to a > __swab32 as FW is LE and mailbox calculate CRC in BE) Not so sure about this one, it puts the u32 on the stack, and takes the address of it: u32 word; word = (__force u32)cpu_to_be32(word); crc = crc_ccitt_false(crc, (u8 *)&word, sizeof(word)); so the endian will matter here. My guess is that this part is correct.