Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1487102img; Sat, 23 Mar 2019 04:17:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxe6EfeTHtLG5WSBcLkOvPr+P4MhWUg3hHsjk1G2wBLL57ajyCHVeKfrs92uezxYX4ksAcy X-Received: by 2002:a62:1c8d:: with SMTP id c135mr14241853pfc.255.1553339877125; Sat, 23 Mar 2019 04:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553339877; cv=none; d=google.com; s=arc-20160816; b=hGGl9Cu8E+TpsqvdVIgiBXdNJurblKXx8lLLOnUbcdmwzcHYk7ufU4B4R6tFLfIiyp hGxEUGVnww7kMhH6TDy6cFMYO9r/Kq/czuljCpfy0vJz61tX/Ynog5lzMVkjTkC5QpAw RyBEiGiiJEGFSzvEpLLnN9bno8HzNDX/LrwN2LqNiYxApocNs2s9VTAxE6nBTFR4Xf79 4vofrz5oE2+tkZUhuFmR+6pzwE1TYI0n5XVqqSIMl0yvHvyccl9IOswLj+UkyDdBu5cn CP43JnS01sz/O/uWWCySI9ogXMdWivNAvsA7vCX0HJJWFHGgOZng3n0LIUQpY7lNeDe/ 2e8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gKVh9qYR9JrCsh7E8CFx7WgqHzSCvuhqj6pXjebU0Ho=; b=JbO81qi6YS/enFXtWH0Abkfk3V4u1Bv7gLlhg8twhc9CnwZtJu4/HivdresdASnRbX 763E9sx7v7x3RTmnx6k8vB15kligUfZpBA9J7KHmJmq2UU5wVGpyMtibQeR70KPZPi51 Jd5Ie15PkRdCda1VDubinCJd6LFGhGClRPylmvOxzNidoRxx2WU6T45ZtfBudQ5E6u+s Ak3D+FToUiSP3drbJqd17hme5p72mH18sQziqNzcO5VqLbDe6bku/MgYXo8bm4DPFaEC zCDaJEytXkfNjQDOecOH5RqNknbxFWq6lPjfjkKH6OZHxjfXH1upMyzM0cx3YenEgx0T L53A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=cMRLo8EU; 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 f124si8978491pfb.38.2019.03.23.04.17.42; Sat, 23 Mar 2019 04:17:57 -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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=cMRLo8EU; 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 S1727411AbfCWLPZ (ORCPT + 99 others); Sat, 23 Mar 2019 07:15:25 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42650 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbfCWLPZ (ORCPT ); Sat, 23 Mar 2019 07:15:25 -0400 Received: by mail-wr1-f68.google.com with SMTP id g3so1481573wrx.9 for ; Sat, 23 Mar 2019 04:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gKVh9qYR9JrCsh7E8CFx7WgqHzSCvuhqj6pXjebU0Ho=; b=cMRLo8EUypIuvd/GfvKnDpu+NxfR9z8X6slb0C9oRtWsLVgzlDsBVnQN0rNA+43Ht8 GL5V/C6lHcJ4tf62E5CpR6J5fDgtEmEv3UC21A2CYd5fCrx79jPYvlEY7ESsQoPBCsTm rmQ567WPodQ1nCJNOCuj4b9HeCejqu07KNnaaR1lf1HKnOX1QRBYaeGDSVl2JX0YRqqT kgUpZS1joEyFZ+wdEh/57Uo0c0U1YLu+7MEv2uzJzdjqdPCtDlxesB86dGXuyvZNUKyG GCKC8DgtbHVe4J/8wg0FWKT4rlgsYFN4ELMeFwgnLfJy+heP8dGHMeZHaegTJwAVcSpL IBew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gKVh9qYR9JrCsh7E8CFx7WgqHzSCvuhqj6pXjebU0Ho=; b=jPV38oVfGbifyptpS4s9NAAjVL3LTudfS31WIqOmc6ncJx1QOM/9J82rlVqXqd5VcQ x7iQc+sDPYLSLuebOuNPxUSF3Y+8UZsYEFcCljzsqDJF59Z7RjguPG6NDgMImcBuzPnE 6PkYSprJ2c6unzRnGji+DixEU4nC2rmMfhu8j1vHk3LVnKvX2fz6Y95KzPcKGOVDa4N5 /L5G7qgAa0IyUcryZoOu7iqI6vyGrPQrtt1tXXxlvSx/JNffWQNOx360LSflNUZzFymF 8yaDH0BGtBMLMgoy2IKUCTDE07rqvmT4OrKkDMNUXfAo/dhcsJvtpk0+tuoebUeRsUMG gcSw== X-Gm-Message-State: APjAAAW+jjOUf4r7HOjZOFmTxITC+2/x0ff71wWGaRuhgAA97n8p7NnX vpcaZ2VPFfRssMnsI2BnKAothAv1rSAtLhxdXlLYyQ== X-Received: by 2002:a5d:5108:: with SMTP id s8mr8758761wrt.99.1553339723383; Sat, 23 Mar 2019 04:15:23 -0700 (PDT) MIME-Version: 1.0 References: <20190322215411.19362-1-atish.patra@wdc.com> In-Reply-To: <20190322215411.19362-1-atish.patra@wdc.com> From: Anup Patel Date: Sat, 23 Mar 2019 16:45:12 +0530 Message-ID: Subject: Re: [PATCH] clocksource/drivers/riscv: Fix clocksource mask To: Atish Patra Cc: "linux-kernel@vger.kernel.org List" , Albert Ou , Daniel Lezcano , linux-riscv@lists.infradead.org, Palmer Dabbelt , Thomas Gleixner , Anup Patel , Damien Le Moal Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 23, 2019 at 3:24 AM Atish Patra wrote: > > 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. > > Signed-off-by: Atish Patra > --- > 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 e8163693..5e6038fb 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", > -- > 2.21.0 > Looks good to me. It would be great if you can add "Fixes:" line and "Cc: stable@vger.kernel.org" Reviewed-by: Anup Patel Regards, Anup