Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp566850rwe; Thu, 25 Aug 2022 05:39:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pG92RXLVIbYIQem0wmQfaiKmgUzuTCaxjLr3J2sPC8mjXFra3kQymFq2GUOJuXXu+lj3M X-Received: by 2002:a17:90b:17c7:b0:1fb:5bbc:91c0 with SMTP id me7-20020a17090b17c700b001fb5bbc91c0mr4611160pjb.224.1661431159718; Thu, 25 Aug 2022 05:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661431159; cv=none; d=google.com; s=arc-20160816; b=BhRdpAxkqw/oEjHP2RYk2yy/kbfJ1g9EUcb7pnNdA5/QjoU4HicxPSht+3VGgoAVYL lyL8qfbDDyDjqpT+M68la70KXDfORr8xeiB7/+Hjz3okWb7mvWlhNAFPk/qchOVGY0Yu Acv6FGl/oxiSCu4kaVytxYkvWpk42sXlDVyg8wv4cvGE/KvbI/odCREU/i+4/BcX9GnQ CddH7HBDO3WoFGzD9qi8O/ITGC9xQJROkDohfgsRo0tkv/UcynJ+jj43E1/9kyB1m71y dZ1qyLtGqfl2UpiUrGa4YCwuK8jKGCxfmEvAHOYjOFZsWL79K5o7zxmwzJ65ojarkgjG nEuQ== 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:date:subject:cc:to:from; bh=9SfhQxXEXuuzr2f1TB34XwksuZ1X/s8WsZ9g9ERYzvc=; b=PmxvXeOXe7hWKTDg7Ja/jXm2DC9a2nAfTY/KeFslbQRYjO7mkTkYqvmaGSSRkbWP/w iWPe7ZqffK+4bbYi/3yY/VEiiAZcj6W61N/+Uf7IwLEszUA6ePUp7AZ1QO55tnLTYDhA RmtibTavi8JkSse1i/PGQ+Pt5EykQdtsLvQJMDsvpguuFo6+QIWaIHaMVA585p14LcJs RWwqqPC8lN3s8gisaWprknMV0YBfJ8O2ozH1OZgYk3XYfWOdDqfMhEaK0TMCK39ruFDI YbB+nF3ALabXjQsHDstzTiohEP41BB29qHHQA3ZCtPMY1DLzA0QquySBjnwh7W4W2CNC sLOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc18-20020a17090325d200b0016f4a25b5dcsi19117627plb.37.2022.08.25.05.39.08; Thu, 25 Aug 2022 05:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239499AbiHYMFd (ORCPT + 99 others); Thu, 25 Aug 2022 08:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241072AbiHYMF2 (ORCPT ); Thu, 25 Aug 2022 08:05:28 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03BE667C81; Thu, 25 Aug 2022 05:05:24 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oRBbh-0001K3-BL; Thu, 25 Aug 2022 14:05:09 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , linux-arm-kernel@lists.infradead.org Cc: Samuel Holland , Greg Kroah-Hartman , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Samuel Holland Subject: Re: [PATCH 1/4] nvmem: sunxi_sid: Always use 32-bit MMIO reads Date: Thu, 25 Aug 2022 14:05:08 +0200 Message-ID: <5410996.rnE6jSC6OK@diego> In-Reply-To: <20220814173656.11856-2-samuel@sholland.org> References: <20220814173656.11856-1-samuel@sholland.org> <20220814173656.11856-2-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Sonntag, 14. August 2022, 19:36:52 CEST schrieb Samuel Holland: > The SID SRAM on at least some SoCs (A64 and D1) returns different values > when read with bus cycles narrower than 32 bits. This is not immediately > obvious, because memcpy_fromio() uses word-size accesses as long as > enough data is being copied. > > The vendor driver always uses 32-bit MMIO reads, so do the same here. > This is faster than the register-based method, which is currently used > as a workaround on A64. And it fixes the values returned on D1, where > the SRAM method was being used. > > The special case for the last word is needed to maintain .word_size == 1 > for sysfs ABI compatibility, as noted previously in commit de2a3eaea552 > ("nvmem: sunxi_sid: Optimize register read-out method"). > > Fixes: 07ae4fde9efa ("nvmem: sunxi_sid: Add support for D1 variant") > Signed-off-by: Samuel Holland On a D1-Nezha: Tested-by: Heiko Stuebner