lkml.org 
[lkml]   [2023]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH V2 35/38] clocksource: riscv: s64ilp32: Use __riscv_xlen instead of CONFIG_32BIT
    Date
    From: Guo Ren <guoren@linux.alibaba.com>

    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 <guoren@linux.alibaba.com>
    Signed-off-by: Guo Ren <guoren@kernel.org>
    ---
    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 da3071b387eb..fe83b4e2005a 100644
    --- a/drivers/clocksource/timer-riscv.c
    +++ b/drivers/clocksource/timer-riscv.c
    @@ -38,7 +38,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
    \
     
     \ /
      Last update: 2023-11-20 13:57    [W:4.146 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site