From: Wolfram Sang Date: Tue, 9 Mar 2021 09:44:48 +0000 (+0100) Subject: clocksource/drivers/sh_cmt: Don't use CMTOUT_IE with R-Car Gen2/3 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=68c70aae06e9660473a00fd7d68e0b53f4d7b6f4;p=linux.git clocksource/drivers/sh_cmt: Don't use CMTOUT_IE with R-Car Gen2/3 CMTOUT_IE is only supported for older SoCs. Newer SoCs shall not set this bit. So, add a version check. Reported-by: Phong Hoang Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Wolfram Sang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210309094448.31823-1-wsa+renesas@sang-engineering.com --- diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index c98f8851fd680..d7ed99f0001f8 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -339,8 +339,9 @@ static int sh_cmt_enable(struct sh_cmt_channel *ch) sh_cmt_write_cmcsr(ch, SH_CMT16_CMCSR_CMIE | SH_CMT16_CMCSR_CKS512); } else { - sh_cmt_write_cmcsr(ch, SH_CMT32_CMCSR_CMM | - SH_CMT32_CMCSR_CMTOUT_IE | + u32 cmtout = ch->cmt->info->model <= SH_CMT_48BIT ? + SH_CMT32_CMCSR_CMTOUT_IE : 0; + sh_cmt_write_cmcsr(ch, cmtout | SH_CMT32_CMCSR_CMM | SH_CMT32_CMCSR_CMR_IRQ | SH_CMT32_CMCSR_CKS_RCLK8); }