Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp120034iob; Tue, 17 May 2022 20:53:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZJY3EwL1ejEjYCLnsqY7EB4r+pDCcVlurUDlILWuS7PjNI+7eKIwEjLav3mzw0ks1qwXU X-Received: by 2002:a17:90b:1e53:b0:1dc:5cdf:565e with SMTP id pi19-20020a17090b1e5300b001dc5cdf565emr28530736pjb.78.1652846001827; Tue, 17 May 2022 20:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652846001; cv=none; d=google.com; s=arc-20160816; b=u0SO28d7mF8PGdAhoJKf7Zs2MO9DsVPFMNSsojZvphht77cC0VUdO2HfexqwKgdgDh rexUfy0N2f5EbLwHQWlExDP93wIw0aBL3q56XqCU4XYNNTh8RJ0QoRTManjfl99zOG+F XcieOk8v1UG5OEwuDZzOUxWRQvdfYJBxOfKN1TbEriaOTVZ44P0EOTW6JZ8eogsoh/5v WHzMthr71gYHmZpXJwJL0Vo169d5cuihpj6bXTO2iWEtOZDZ9f4pjWYI9UIjO67Rmjgp P2nIM7mXiGEXk1EkX9SP0HHK6OfIjxpCcXEpqeNJmwdVcTtpRrmMfN2kKhO+Ci2sqOH8 m1CQ== 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=zomvFyKwvw6sl1NdObv6Lxmz7g2O8ob0ad1FOsoR+M0=; b=F5Do7bQ9Pn/1mRuCDZtBW8wQtUdaMdDy9BAe5vDxGOLYgWVF/V0XZ1nMiA+gaTNAaz 4j1FnNq3466pNVa/R5G4KFjrs0MDKm5kOMVMt1QbnoChSpMFUzwtfG+V9zkfX9l46RaJ NnmnIq9A1P3aBgsfyxwfZryDmjKIIiOx1qLfniMoVd1nrxzJxKT3ZWlhix6hnFcxdcLo oj9PgE+1iFRZ5Lb02dnbeLvDSvKQyTq2E/wnF45kiFT8J8M7MHS82sffbWiavAxFOds8 0SSqdSTxdAM2Xql9XvS0Qa/964Rf7Nk7WZya1aRbpMafrYdyPzryyh4STS9/TDy8ii/3 9wLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QGDr7Glp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bm15-20020a656e8f000000b003c653e92e26si1122773pgb.89.2022.05.17.20.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QGDr7Glp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9D8A939BD; Tue, 17 May 2022 20:34:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245723AbiEQKOA (ORCPT + 99 others); Tue, 17 May 2022 06:14:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343769AbiEQKMp (ORCPT ); Tue, 17 May 2022 06:12:45 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35FBD1CFF2; Tue, 17 May 2022 03:12:07 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id x23so16459920pff.9; Tue, 17 May 2022 03:12:07 -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=zomvFyKwvw6sl1NdObv6Lxmz7g2O8ob0ad1FOsoR+M0=; b=QGDr7GlpRtohqnEqHu9NzhS/DN2bjl9VDao1H9pGnSW7NQ1+ZU/kvpuuszSkLE/XS/ vgXfS5vpbQHyvDVgyjeewc1ALxm1roslp4B6HUnfwqmEApI6g7mJ3bywifFn8ufCTgIn bRdvyg2BFue0am5FIkv+cjwQdelM7ANsNh+Y1L20fOy0SWwoV/bCKotMfL+tgGRV2mIf ugzf4KUSSjWl3KKmDUEjErxGBmEi6H+8kTpPei8cCM7k7YLf/0SPQgg89eMUR70siRFp Ej/NFy+rCGg4VH5ZiwjCXbIsAGPGIBfEhC2/+QoOMqIsxN4sqU9jSnRoWS0rLZtdtiiv kj4Q== 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=zomvFyKwvw6sl1NdObv6Lxmz7g2O8ob0ad1FOsoR+M0=; b=vF2Vtqx42Ewa3UXGXAnZz6/yY5CIra2FszGapilfIuMHYXW6kMB1mIhkORA1n704ES w1ktOJGfGruC3pTpzpnydI0/s4VlBveC0LyRdyyBzbTgqygppfpdX/1w4hCl583W3W1b /PBxcG9AYPlfq/2DQBfjyGMVdTlekTowWBmOnjwAhdtf0OMeVGuMWQWaixgUaVAP1ZMX XiZEYDCFtJfrgEb3yiea2AuHM9vH51gfpdsuSNPnqTfnIXJe5jyc4Hbe10dB6AXQuZXA 0re/7tKMy9EsdtyQm/xCIt3o0Ff/BFf0dMP1ZNEgvfuCLhxqJJ6GEo/DBQuYhjkhWqzP S34w== X-Gm-Message-State: AOAM531zh3QnQNOKrdykR6Ywy3AaGko2Z/K3izjlgP6w25wutErtlc0q TQ+8qwGqP5yh3VDL660Ccg== X-Received: by 2002:a65:4007:0:b0:3c6:c6e2:1ccc with SMTP id f7-20020a654007000000b003c6c6e21cccmr18499757pgp.500.1652782326658; Tue, 17 May 2022 03:12:06 -0700 (PDT) Received: from localhost (220-133-130-217.hinet-ip.hinet.net. [220.133.130.217]) by smtp.gmail.com with ESMTPSA id b1-20020a056a000a8100b0050dc76281c1sm8628069pfl.155.2022.05.17.03.12.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 May 2022 03:12:06 -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+dt@linaro.org, wsa@kernel.org, andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com, semen.protsenko@linaro.org, rafal@milecki.pl, sven@svenpeter.dev, jsd@semihalf.com, jie.deng@intel.com, lukas.bulwahn@gmail.com, arnd@arndb.de, olof@lixom.net, 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 v5 06/10] i2c: npcm: Correct register access width Date: Tue, 17 May 2022 18:11:38 +0800 Message-Id: <20220517101142.28421-7-warp5tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220517101142.28421-1-warp5tw@gmail.com> References: <20220517101142.28421-1-warp5tw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 36f8aa7ab106..58d7175f0362 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