Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5809913iob; Tue, 10 May 2022 04:20:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYbJ643VNOzk5IjNtE5Kzex0nXae+QXZ+2hBpbckwPCFFsaIEhMC81cdII3l5g2ZAe8WLA X-Received: by 2002:a17:907:3f04:b0:6e8:4b0e:438d with SMTP id hq4-20020a1709073f0400b006e84b0e438dmr19345225ejc.391.1652181616140; Tue, 10 May 2022 04:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652181616; cv=none; d=google.com; s=arc-20160816; b=yvC/KGWQOFBGDCFBRNVKLYJbPgukvTCtnm2qf+WJKz3ZflkHeYSWRiNmrSAnU9QKk4 4gbwi9Ibdv+QpltnBItF8E1XBFXuaJoC7726sOtxGze2/2SVHxHLwQ5HGPf187qNYNaj v2xyzzDSEGIeCGZ26FBaxOL6knsuBkOcqzmXgp+3Zcj43AVkbkK7vbx9TjxPimmwPe4d nLrSk1oT0fbz7F7CgWc3RBA6SGh2ygPzAD2c8486OSx83JK7EuBSuP9gsuauSjMHb9fZ XBVNaHYWVzJqVxcjOI5FHB+pUeEW1MCgD+4gyucQKLv/P7vxRtxjPz4+9mFWHVtx/gEF FRuA== 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=qdZcbphejbuJUyI8ZEVHLXuIfaV6dJq4J7NvpDgtTDg=; b=q0uuAze7aM/wWMoTNVtVxLQzQyHoouJrFmqvSIr1F4SYvHCvqg+fDNmnbT6y6ph9mJ kSW9fVuaiHTB+qlyGcz6BQ3hu90RomvFiSUsYYhU+twdzkPaD5s075+oVyysivWNCZTN 2ApB/QMaZMTRDgJT8TO7NaoXuUjyDNQUh4Ja8QnyWooqaOpif5ccxXuGvakLxJeJ3Rv6 nqC8Vn7DkSFtLNIKNQXog8uxwr4ZHp6YFkUgq1IGf9q7F2kfs2Tr1eOjw+amTaXUtc2Y DSCxYOy8UL+6MzHGByMrNi+NJ7NL7dSbFUhl72+qiKItLH7IJYGhRxW9AfWsXDkRfMY9 BHxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LPaoDLd4; 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 r12-20020a05640251cc00b00427b39d27f8si19113407edd.1.2022.05.10.04.19.52; Tue, 10 May 2022 04:20:16 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LPaoDLd4; 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 S238658AbiEJJW2 (ORCPT + 99 others); Tue, 10 May 2022 05:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238636AbiEJJWW (ORCPT ); Tue, 10 May 2022 05:22:22 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E940D218FE4; Tue, 10 May 2022 02:18:24 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id n10so4277597pjh.5; Tue, 10 May 2022 02:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qdZcbphejbuJUyI8ZEVHLXuIfaV6dJq4J7NvpDgtTDg=; b=LPaoDLd4Ikgrg7XEbyCAALxooHVmKiLlzVexFnqt53TrM98BzkpR73oa/V2hJLohvU B1aJUHEDRTEHt8gvAFtOjpgdjP87bI3esyPGDSSuNm9MF9vpQ7o1SEpnOI4JtE1DU6AD GLMeEtcI+D69rMS6wNyyQeYV1z/f3YgugfpeMudoHY1U0UfUCwbolO8KUVVvM0HjE5lP 2MCCPrctSV7sLbEIT0dc9WQZcmgrzuFmbxN0oRm1z97czaM4mFaKYq8mGiEsWenYlBFY mLneOPu/puWKkmKFiuaoy69NV86xj1vRVoFn5DJ+gd9VqZWv8Vo0ykwY4sL2YwYGZh/3 eQqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qdZcbphejbuJUyI8ZEVHLXuIfaV6dJq4J7NvpDgtTDg=; b=SrxbZg/pcRQMWkdxocjqpKUIirIQURBorL4uNe4EX0T58yRnPdmY9WaTnem9cyLNPD BlXejShB52sSJqM61fCuphNNGjsmrDimGDeTrLvwOTZxaT73HhTusbQEkmzBMGANRI/T qErMHLMvHsUot5hscsWvekGnYIoR2Hr2eogkDB5+UdFEhwcArcM99WnADZr/il46Flnj AVKVy31yV9PXCSDmGWciqoDBljJ/LsXh6f99SBxNdmg+l8c6HLu9I8A8GhnY18QGchLm JZLsCy8i/7BMwrqV5a8H9f+lynWKO2Z7cploxhiOyN4sTP7WFKNQ05BHSfiLRSsyr6k2 vswA== X-Gm-Message-State: AOAM530qOSSD3clobsca2nVi4+IEDDcCVfoTX2oqXkyhtbjdJXHNmjDk EkUZ1Jt7h87uhTyM2LguXtE0D7CahMcK X-Received: by 2002:a17:902:e549:b0:15e:aa63:6fd8 with SMTP id n9-20020a170902e54900b0015eaa636fd8mr20036042plf.152.1652174304396; Tue, 10 May 2022 02:18:24 -0700 (PDT) Received: from localhost (2001-b011-7010-358e-c990-a8c9-85a7-1d3e.dynamic-ip6.hinet.net. [2001:b011:7010:358e:c990:a8c9:85a7:1d3e]) by smtp.gmail.com with ESMTPSA id v3-20020a622f03000000b0050e0a43712esm10166345pfv.63.2022.05.10.02.18.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 May 2022 02:18:24 -0700 (PDT) From: Tyrone Ting To: avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com, wsa@kernel.org, andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com, semen.protsenko@linaro.org, sven@svenpeter.dev, jie.deng@intel.com, jsd@semihalf.com, lukas.bulwahn@gmail.com, olof@lixom.net, arnd@arndb.de, warp5tw@gmail.com, tali.perry@nuvoton.com, Avi.Fishman@nuvoton.com, tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, JJLIU0@nuvoton.com, kfting@nuvoton.com Cc: openbmc@lists.ozlabs.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/9] i2c: npcm: Correct register access width Date: Tue, 10 May 2022 17:16:51 +0800 Message-Id: <20220510091654.8498-7-warp5tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220510091654.8498-1-warp5tw@gmail.com> References: <20220510091654.8498-1-warp5tw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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 From: Tyrone Ting The SMBnCTL3 register is 8-bit wide and the 32-bit access was always incorrect, but simply didn't cause a visible error on the 32-bit machine. On the 64-bit machine, the kernel message reports that ESR value is 0x96000021. Checking Arm Architecture Reference Manual Armv8 suggests that it's the alignment fault. SMBnCTL3's address is 0xE. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Tyrone Ting Reviewed-by: Jonathan Neuschäfer --- drivers/i2c/busses/i2c-npcm7xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c index 56af571f65c1..e3c13f801f1a 100644 --- a/drivers/i2c/busses/i2c-npcm7xx.c +++ b/drivers/i2c/busses/i2c-npcm7xx.c @@ -360,14 +360,14 @@ static int npcm_i2c_get_SCL(struct i2c_adapter *_adap) { struct npcm_i2c *bus = container_of(_adap, struct npcm_i2c, adap); - return !!(I2CCTL3_SCL_LVL & ioread32(bus->reg + NPCM_I2CCTL3)); + return !!(I2CCTL3_SCL_LVL & ioread8(bus->reg + NPCM_I2CCTL3)); } static int npcm_i2c_get_SDA(struct i2c_adapter *_adap) { struct npcm_i2c *bus = container_of(_adap, struct npcm_i2c, adap); - return !!(I2CCTL3_SDA_LVL & ioread32(bus->reg + NPCM_I2CCTL3)); + return !!(I2CCTL3_SDA_LVL & ioread8(bus->reg + NPCM_I2CCTL3)); } static inline u16 npcm_i2c_get_index(struct npcm_i2c *bus) -- 2.17.1