All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] clocksource: sh_cmt: don't use CMTOUT_IE with R-Car Gen2/3
@ 2021-03-09  9:44 Wolfram Sang
  2021-04-09 10:27 ` [tip: timers/core] clocksource/drivers/sh_cmt: Don't " tip-bot2 for Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2021-03-09  9:44 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-kernel, Daniel Lezcano, Geert Uytterhoeven,
	Niklas Söderlund, Wolfram Sang, Phong Hoang,
	Geert Uytterhoeven, Niklas Söderlund

CMTOUT_IE is only supported for older SoCs. Newer SoCs shall not set
this bit. So, add a version check.

Reported-by: Phong Hoang <phong.hoang.wz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Changes since v1:
* updated $subject
* added tags

 drivers/clocksource/sh_cmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index c98f8851fd68..d7ed99f0001f 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);
 	}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: timers/core] clocksource/drivers/sh_cmt: Don't use CMTOUT_IE with R-Car Gen2/3
  2021-03-09  9:44 [PATCH v2] clocksource: sh_cmt: don't use CMTOUT_IE with R-Car Gen2/3 Wolfram Sang
@ 2021-04-09 10:27 ` tip-bot2 for Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Wolfram Sang @ 2021-04-09 10:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Phong Hoang, Geert Uytterhoeven, niklas.soderlund+renesas,
	Wolfram Sang, Daniel Lezcano, x86, linux-kernel

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     68c70aae06e9660473a00fd7d68e0b53f4d7b6f4
Gitweb:        https://git.kernel.org/tip/68c70aae06e9660473a00fd7d68e0b53f4d7b6f4
Author:        Wolfram Sang <wsa+renesas@sang-engineering.com>
AuthorDate:    Tue, 09 Mar 2021 10:44:48 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 08 Apr 2021 13:24:16 +02:00

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 <phong.hoang.wz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210309094448.31823-1-wsa+renesas@sang-engineering.com
---
 drivers/clocksource/sh_cmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index c98f885..d7ed99f 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);
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-09 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09  9:44 [PATCH v2] clocksource: sh_cmt: don't use CMTOUT_IE with R-Car Gen2/3 Wolfram Sang
2021-04-09 10:27 ` [tip: timers/core] clocksource/drivers/sh_cmt: Don't " tip-bot2 for Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.