Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5340355rwl; Sun, 8 Jan 2023 13:14:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvythGOLPCvmEwYreGeXgnL/+zvrh83fvIv8F2W7i+Ll3stKTxEBo/txM/1ZjUJO3kgpEPU X-Received: by 2002:a17:906:36ce:b0:7c1:727c:5f70 with SMTP id b14-20020a17090636ce00b007c1727c5f70mr53566436ejc.46.1673212459247; Sun, 08 Jan 2023 13:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673212459; cv=none; d=google.com; s=arc-20160816; b=ra/sFSjN+++jtGRQ4t+IohArhDhtZyFdLGNRlY7cRYu2Xz8nxSyivJQNR/uNUIZPXR AqFmIU5hnQqR5gB+nrLX75ly+4IthE5sTZJLN0urDJaXOMFdpVO2gIEB9cCu21uREItp 69j3m2lNOgkv0gDe/5ot7mMCTSfMZyg3YYCLpXIiehHaz59ofxXiDGtnROTaVPJjnZo5 WKj+0pmOmFyGkdDnkJ40anG3nPSEBwz958+aOvajheGF8EXyakbdCm1X2ywv2gLKdTp/ vwgrb4JgIobPKeLmRVcbb5PrkP9qSqgwrffmhEvIyQkrCAcZznt6mgDBweWtTVfKIfbh ONsg== 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 :dkim-signature; bh=/l7O+u7hpvwx/CEE2kQt2CxxFAlI3yQgMXXhNMZZ5b8=; b=ZSfw+8QqPlhzvTXy8rh2yU9+MXpN7dguSTGX9H159lH02w6MGjWkQW9tF5K7cH7C7R 2+4ky5nbAvhwW/BwFUWzb0GSDolAd30E3KIs59p6y4ld5CcsyuArEX/AgStReQ75OMo5 fsHtQD1JhQgo0Nv78ajLbfTahIoRsEofYl1lxdJDQ7n+1UQZeiJgEJhjOfwze4WnfUe+ fNzJ8y3QVPegolFBYYNV/J1+qX+k8HFYaew6P5z8QH6PvjE4YCw0LfQcARAfMe3GVhmB aNXFNhnZqWuZ0/1MEl1PCNwVGlAi/BCq7/gv2252HDxt+ysyD4pkb9mYZrhFa2hwM9xr nBqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FDlaf6Hu; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss2-20020a170907c00200b00741a16e8562si6266256ejc.826.2023.01.08.13.14.06; Sun, 08 Jan 2023 13:14:19 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FDlaf6Hu; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233690AbjAHUuX (ORCPT + 53 others); Sun, 8 Jan 2023 15:50:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjAHUuW (ORCPT ); Sun, 8 Jan 2023 15:50:22 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3CAAE4A; Sun, 8 Jan 2023 12:50:21 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id v10so8605104edi.8; Sun, 08 Jan 2023 12:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/l7O+u7hpvwx/CEE2kQt2CxxFAlI3yQgMXXhNMZZ5b8=; b=FDlaf6HuGHd/1r8jZ2JcrzSIODO1aqOOU8QPRxTfVdcd28+Sp/p8K1uUm+WJ66t+eP vCE2BDQT9oyeZYP7xXVs6k6R8l1vDzdKzuMRyGEm/UozYAs/UVVw1E0j49Q5VU5mieZS XHhtpYeJ1mj76AbggBVYA76nx5hKOx5Zt42DflN6fMAPaFsLmRFbj140pFyzKpeCRjOe +8L0vej/ie/lW9+H4QRosHp03GMEiiGwi2SQBscrbeTedyAxkbDD+efVBsxLzLRa5IYv btO9dveEcPLEwR/0o6guaAPLnbul8qG8rhcxCYSVmLb14gZaNp7h/nBb3QGUHMTDWMwj JeSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/l7O+u7hpvwx/CEE2kQt2CxxFAlI3yQgMXXhNMZZ5b8=; b=BPokn7S1qtDQF/M3xNEaIwgHu9Fj7A/XSZkOcxrr5/AYesmGwjMOPUTQ65bLvd33gD v0u2bPNSr4Ss9M1HQviHGTU75tB2I/Nkinb765NBK0coEyMhqkb3GFP0AybVpBZOuAZh k9LIC3PdQ/oykPg5KJMNPZOp/koPKJng6AjNCiBlqRMjc28sspqVFj0Ag4lxdNbMGkv0 01cZPtAhcpkTcMMt4MWRdptOgOiXNRVJUtaYb8mXEy+HofXDfWc6QnaFBHJDTAOAjsz5 saxcrpR0DhQFIrUpGbRxtOJhi/IiNvwWdC89sSaVsAowAISErO5YhDPe1VE805mlZRaL mSAQ== X-Gm-Message-State: AFqh2krmFYEgdMsdzSkQHf0QjamSG0XstqYrsUsIurIik4pIzDgA/e+s Re/BSOLS9Po7uFqMPz7FpmE= X-Received: by 2002:aa7:d653:0:b0:47e:15ec:155e with SMTP id v19-20020aa7d653000000b0047e15ec155emr50820952edr.26.1673211019627; Sun, 08 Jan 2023 12:50:19 -0800 (PST) Received: from jernej-laptop.localnet (82-149-19-102.dynamic.telemach.net. [82.149.19.102]) by smtp.gmail.com with ESMTPSA id n18-20020a056402061200b004950ef2a09asm2871821edv.61.2023.01.08.12.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 12:50:19 -0800 (PST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Srinivas Kandagatla , Chen-Yu Tsai , Samuel Holland 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 Subject: Re: [PATCH 1/4] nvmem: sunxi_sid: Always use 32-bit MMIO reads Date: Sun, 08 Jan 2023 21:50:18 +0100 Message-ID: <3511184.iIbC2pHGDl@jernej-laptop> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Dne nedelja, 14. avgust 2022 ob 19:36:52 CET je Samuel Holland napisal(a): > 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 Reviewed-by: Jernej Skrabec Best regards, Jernej