From: tip-bot for Atish Patra <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:timers/urgent] clocksource/drivers/riscv: Fix clocksource mask
Date: Sat, 23 Mar 2019 04:28:08 -0700 [thread overview]
Message-ID: <tip-32d0be018f6f5ee2d5d19c4795304613560814cf@git.kernel.org> (raw)
In-Reply-To: <20190322215411.19362-1-atish.patra@wdc.com>
Commit-ID: 32d0be018f6f5ee2d5d19c4795304613560814cf
Gitweb: https://git.kernel.org/tip/32d0be018f6f5ee2d5d19c4795304613560814cf
Author: Atish Patra <atish.patra@wdc.com>
AuthorDate: Fri, 22 Mar 2019 14:54:11 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
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 <atish.patra@wdc.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Anup Patel <anup@brainfault.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-riscv@lists.infradead.org
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Anup Patel <Anup.Patel@wdc.com>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
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",
prev parent reply other threads:[~2019-03-23 11:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 21:54 [PATCH] clocksource/drivers/riscv: Fix clocksource mask Atish Patra
2019-03-23 11:15 ` Anup Patel
2019-03-23 11:28 ` tip-bot for Atish Patra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-32d0be018f6f5ee2d5d19c4795304613560814cf@git.kernel.org \
--to=tipbot@zytor.com \
--cc=Anup.Patel@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@wdc.com \
--cc=daniel.lezcano@linaro.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=palmer@sifive.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox