Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp983813rwd; Thu, 18 May 2023 06:35:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6n3qZYj6JL+GeXc1/zGb3PuZQC3oXzQ3zOAQlxWXIIXqg2yQuZ1e6af3Upr7u9S6daB/GM X-Received: by 2002:a05:6a20:841b:b0:101:3046:8db3 with SMTP id c27-20020a056a20841b00b0010130468db3mr2045393pzd.22.1684416934369; Thu, 18 May 2023 06:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684416934; cv=none; d=google.com; s=arc-20160816; b=EuSFnt1SAJGFwDNOtftftCJO4O725a5Odrn8FxpKiom8ychFit4RScBPBzrIcQ+PNs 9cn2awcSy7H3y4JkEDOIHnNBVyJACWgBcyQ7rmgSN7Edqk/QtRGWDDLhcrCpEfE+FR6r unvWraNC8NYzYQWxKu8fvvjjbQQ6KwDnM93rxEGROT6F4bvP+VEJclJ6kcibSRbF6Aba HF1zd81tI53dcpMHM3ah8X7Pyq66ctHDUJezA9S+fIgYjaVKIyB69y9V8cG7EhXl1fHC Wr+TSmDv0c6z3DlEhIa3wtd/oZxFkE+U0fMtIxAHOxt8G5Bc/yWsTlGk0N/6u4/Q8DBr 7+Ow== 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=vBIUYk0X7dcPX89l65CSzwMuo2GpVr6EqTAPW2nb8sQ=; b=wdAgbAOfBCv4Ewoe1Oa7+YGRwgP67YGoA72dYzM26V5wNXti4hj2/ft6BPy9D17R3T vz0P0gydRJDhKiYJFKtgwS8ifqJ2XIEj1RS5WE347b6Wbpdw1iQTyytxiQPYQDn82NjX z46lbr87N9rbROUs0qxKbuRM2K7cMotEvrlgQq/DytpvKO8fR3+4w9a6OgtAMcsPMTwu 26jKXmtqnz3v/t3AZb9JwQJvx7Zia6v/I2r+RIxcpAg56zDgVDjTpUfhSRmjpYUekwbJ k3kdrYcGse5rts7wAO1dpxX1ni9SXgOKivYpldURco64NPJqXDyJzj4lb5a0MNpOUPxh 6wZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tebfDu2c; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a63b256000000b0053439a3ba31si1453138pgo.711.2023.05.18.06.35.18; Thu, 18 May 2023 06:35:34 -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=@kernel.org header.s=k20201202 header.b=tebfDu2c; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbjERNMw (ORCPT + 99 others); Thu, 18 May 2023 09:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbjERNMn (ORCPT ); Thu, 18 May 2023 09:12:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1167B1999; Thu, 18 May 2023 06:11:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89D1364F44; Thu, 18 May 2023 13:11:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B023C433D2; Thu, 18 May 2023 13:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684415492; bh=kwYbV+xRqnM3gD5wja5IP2IYhT3BPYOFw/sxTmqeyds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tebfDu2ciCGlWfmOzk3QjqBAf9k6FxRFj7jmur4lv4YYgmCqMwYndQMkm/TX5ALdr ahSuRZujS7dWo/DAxOKxBUAyoU2L7N5xr8A0BvnwSqYyibaEpV8BhHb94puApoRjfN 0wJpP+cKegCUiSc3U4UPwgoIzrXWQze32a23f7IDPdtkunSTAJgoYFkRL1ycW0/Isq 3t+c9hz2PtbDnszFGKOPxXjZgXL1mfQWMblibSnBovz/83Borj9U0Mf+6/2KifouyE oz7PCD3ulfIeKgtZ+BrOCR8DT4EGQCxUw0Wvzb6d8X1HWDulB2UMy5eHOeJnNkulsN fb9+hL6VaPVCA== From: guoren@kernel.org To: arnd@arndb.de, guoren@kernel.org, palmer@rivosinc.com, tglx@linutronix.de, peterz@infradead.org, luto@kernel.org, conor.dooley@microchip.com, heiko@sntech.de, jszhang@kernel.org, chenhuacai@kernel.org, apatel@ventanamicro.com, atishp@atishpatra.org, mark.rutland@arm.com, bjorn@kernel.org, paul.walmsley@sifive.com, catalin.marinas@arm.com, will@kernel.org, rppt@kernel.org, anup@brainfault.org, shihua@iscas.ac.cn, jiawei@iscas.ac.cn, liweiwei@iscas.ac.cn, luxufan@iscas.ac.cn, chunyu@iscas.ac.cn, tsu.yubo@gmail.com, wefu@redhat.com, wangjunqiang@iscas.ac.cn, kito.cheng@sifive.com, andy.chiu@sifive.com, vincent.chen@sifive.com, greentime.hu@sifive.com, corbet@lwn.net, wuwei2016@iscas.ac.cn, jrtc27@jrtc27.com Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Guo Ren Subject: [RFC PATCH 04/22] clocksource: riscv: s64ilp32: Use __riscv_xlen instead of CONFIG_32BIT Date: Thu, 18 May 2023 09:09:55 -0400 Message-Id: <20230518131013.3366406-5-guoren@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230518131013.3366406-1-guoren@kernel.org> References: <20230518131013.3366406-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: Guo Ren When s64ilp32 enabled, CONFIG_32BIT=y but __riscv_xlen=64. So we must use __riscv_xlen to detect real machine XLEN for CSR access. Signed-off-by: Guo Ren Signed-off-by: Guo Ren --- drivers/clocksource/timer-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index 5f0f10c7e222..459a634012ce 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -37,7 +37,7 @@ static int riscv_clock_next_event(unsigned long delta, csr_set(CSR_IE, IE_TIE); if (static_branch_likely(&riscv_sstc_available)) { -#if defined(CONFIG_32BIT) +#if __riscv_xlen == 32 csr_write(CSR_STIMECMP, next_tval & 0xFFFFFFFF); csr_write(CSR_STIMECMPH, next_tval >> 32); #else -- 2.36.1