Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1493433img; Sat, 23 Mar 2019 04:29:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9HKzvOpKI5ARF+KuBYlyckAdDdAU63Trr5iugdm2OVHeSTE4Goyfy962QUJvBCS3oDuJK X-Received: by 2002:a62:5543:: with SMTP id j64mr14055329pfb.105.1553340547957; Sat, 23 Mar 2019 04:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553340547; cv=none; d=google.com; s=arc-20160816; b=oQEQOfyeTwv0vb3cvbFoldiqFRTETyT5hkUbKEYZ6F6BK57m6HXu/Mc6o7psDHVQLN UAb+GCZcMqIKWHypdGDGIr7zUUKfeXksRsRdlRBtrkNyF2HSU5jN/AZxjBXqclel9Hp5 MzOb+hn5hTRTCamnpobqzgHw/2P5AXehCC7s2KofI4QSxGVu9w8PnKI4ZvW+pKjhOxVn 1Uirld7y+EX/5Rw27cRnaai28s3RtH4nNQvs9VoLFCLxdlWuEYD06uSvQSWZQwEYsMOS aMWAkCPegSlS9mzsLkceGy/kEvjE4sq0rqtx7YK/4sfP61K+9BB2V9Zu4Y8IwC+1zV1g 2lkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=r44ut8c4sx10AxNSVDqEBUIp316p3fuUdodlQI7bdjQ=; b=mMdx5EyRS4RzbJ2M81VkHwTwUPiEmKvSF33jDVyOMh2K3omkK3Q3gDnb9C4Y2jxIM/ 5Xuz65b6pxhqGA2nNVQPj+faCtJbij7bEgQIvBMOrxKBvA656bN0hV9FmtGsWQJUGNL/ 10Lu37r/c1mNjV1L9c0Ux1YBE9oBWKzXfZnbEhnB5K9MNU706HuckYHxwuoz2E42Z703 h1F2soBsIPphA6v7EDRTm1QRZcgLvwbNnxGIV7kI6c4UkDXNIH4ZW9yPO5cP7idLPmoP XBlDjrxMo//DqkMhRK5rCzSBT4RwS4/Z6etApq1W6Tlopz/IgO+Gq+ykOPd3WcNONE5c MRzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si9282221plo.49.2019.03.23.04.28.52; Sat, 23 Mar 2019 04:29:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727365AbfCWL2T (ORCPT + 99 others); Sat, 23 Mar 2019 07:28:19 -0400 Received: from terminus.zytor.com ([198.137.202.136]:35333 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbfCWL2T (ORCPT ); Sat, 23 Mar 2019 07:28:19 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x2NBS97W996142 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 23 Mar 2019 04:28:09 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x2NBS87H996139; Sat, 23 Mar 2019 04:28:08 -0700 Date: Sat, 23 Mar 2019 04:28:08 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Atish Patra Message-ID: Cc: Damien.LeMoal@wdc.com, mingo@kernel.org, aou@eecs.berkeley.edu, tglx@linutronix.de, atish.patra@wdc.com, daniel.lezcano@linaro.org, anup@brainfault.org, Anup.Patel@wdc.com, linux-kernel@vger.kernel.org, palmer@sifive.com, hpa@zytor.com Reply-To: mingo@kernel.org, tglx@linutronix.de, aou@eecs.berkeley.edu, Damien.LeMoal@wdc.com, palmer@sifive.com, hpa@zytor.com, atish.patra@wdc.com, Anup.Patel@wdc.com, linux-kernel@vger.kernel.org, anup@brainfault.org, daniel.lezcano@linaro.org In-Reply-To: <20190322215411.19362-1-atish.patra@wdc.com> References: <20190322215411.19362-1-atish.patra@wdc.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/urgent] clocksource/drivers/riscv: Fix clocksource mask Git-Commit-ID: 32d0be018f6f5ee2d5d19c4795304613560814cf X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 32d0be018f6f5ee2d5d19c4795304613560814cf Gitweb: https://git.kernel.org/tip/32d0be018f6f5ee2d5d19c4795304613560814cf Author: Atish Patra AuthorDate: Fri, 22 Mar 2019 14:54:11 -0700 Committer: Thomas Gleixner CommitDate: Sat, 23 Mar 2019 12:25:34 +0100 clocksource/drivers/riscv: Fix clocksource mask For all riscv architectures (RV32, RV64 and RV128), the clocksource is a 64 bit incrementing counter. Fix the clock source mask accordingly. Tested on both 64bit and 32 bit virt machine in QEMU. Fixes: 62b019436814 ("clocksource: new RISC-V SBI timer driver") Signed-off-by: Atish Patra Signed-off-by: Thomas Gleixner Reviewed-by: Anup Patel Cc: Albert Ou Cc: Daniel Lezcano Cc: linux-riscv@lists.infradead.org Cc: Palmer Dabbelt Cc: Anup Patel Cc: Damien Le Moal Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20190322215411.19362-1-atish.patra@wdc.com --- drivers/clocksource/timer-riscv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index e8163693e936..5e6038fbf115 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -58,7 +58,7 @@ static u64 riscv_sched_clock(void) static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = { .name = "riscv_clocksource", .rating = 300, - .mask = CLOCKSOURCE_MASK(BITS_PER_LONG), + .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, .read = riscv_clocksource_rdtime, }; @@ -120,8 +120,7 @@ static int __init riscv_timer_init_dt(struct device_node *n) return error; } - sched_clock_register(riscv_sched_clock, - BITS_PER_LONG, riscv_timebase); + sched_clock_register(riscv_sched_clock, 64, riscv_timebase); error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING, "clockevents/riscv/timer:starting",