Skip to contentSkip to conversation

clocksource/drivers/sh_cmt: Minor DT compat string update

PATCH In review Magnus Damm 3 participants 9 messages Jun 17, 2019 – Jun 18, 2019 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

cover clocksource/drivers/sh_cmt: Minor DT compat string update

clocksource/drivers/sh_cmt: Minor DT compat string update

[PATCH 1/3] clocksource/drivers/sh_cmt: SoC-specific match for CMT1 on r8a7740 and sh73a0 [PATCH 2/3] clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support
[PATCH 3/3] clocksource/drivers/sh_cmt: Document "cmt-48" as deprecated

Move over to new CMT1 bindings on r8a7740 and sh73a0 and get rid of old stale stuff such as "cmt-48-gen2" while keeping "cmt-48" around but document it as deprecated.

---

Patch 1 and patch 3 depend on updated SoC-specific DT bindings in:
[PATCH 2/8] dt-bindings: timer: renesas, cmt: Update CMT1 on sh73a0 and r8a7740

 drivers/clocksource/sh_cmt.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
#1 lore raw

PATCH 1/3 clocksource/drivers/sh_cmt: SoC-specific match for CMT1 on r8a7740 and sh73a0

From: Magnus Damm <[email protected]>

Add SoC-specific matching for CMT1 on r8a7740 and sh73a0.

This allows us to move away from the old DT bindings such as
- "renesas,cmt-48-sh73a0"
- "renesas,cmt-48-r8a7740"
- "renesas,cmt-48"
in favour for the now commonly used format "renesas,<soc>-<device>"

---

The updated SoC-specific DT bindings are documented in:
[PATCH 2/8] dt-bindings: timer: renesas, cmt: Update CMT1 on sh73a0 and r8a7740

 drivers/clocksource/sh_cmt.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/clocksource/sh_cmt.c +8 -0
@@ -928,6 +928,14 @@ static const struct of_device_id sh_cmt_
 		.data = &sh_cmt_info[SH_CMT0_RCAR_GEN2]
 	},
 	{
+		.compatible = "renesas,r8a7740-cmt1",
+		.data = &sh_cmt_info[SH_CMT_48BIT]
+	},
+	{
+		.compatible = "renesas,sh73a0-cmt1",
+		.data = &sh_cmt_info[SH_CMT_48BIT]
+	},
+	{
 		.compatible = "renesas,rcar-gen2-cmt0",
 		.data = &sh_cmt_info[SH_CMT0_RCAR_GEN2]
 	},
#2 lore raw

PATCH 2/3 clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Since late 2017 the DT compat string "renesas,cmt-48-gen2" has not been in use in the upstream kernel. SoC-specific strings and the fallback string "rcar-gen2-cmt1" are now used in the DTSI instead.

Remove "renesas,cmt-48-gen2" from the CMT driver.

---

 drivers/clocksource/sh_cmt.c |    5 -----
 1 file changed, 5 deletions(-)
drivers/clocksource/sh_cmt.c +0 -5
@@ -923,11 +923,6 @@ MODULE_DEVICE_TABLE(platform, sh_cmt_id_
 static const struct of_device_id sh_cmt_of_table[] __maybe_unused = {
 	{ .compatible = "renesas,cmt-48", .data = &sh_cmt_info[SH_CMT_48BIT] },
 	{
-		/* deprecated, preserved for backward compatibility */
-		.compatible = "renesas,cmt-48-gen2",
-		.data = &sh_cmt_info[SH_CMT0_RCAR_GEN2]
-	},
-	{
 		.compatible = "renesas,r8a7740-cmt1",
 		.data = &sh_cmt_info[SH_CMT_48BIT]
 	},
Reviewed-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support

Hi Magnus,

Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Since late 2017 the DT compat string "renesas,cmt-48-gen2" has not been in use in the upstream kernel. SoC-specific strings and the fallback string "rcar-gen2-cmt1" are now used in the DTSI instead.

Not really: since v4.16, which was released on Apr 1, 2018, i.e. after v4.14, the base for the latest LTSI kernel.

Note that the removal commits were backported to v4.14-ltsi, but not to v4.14.y.

Quoted 3 lines

Remove "renesas,cmt-48-gen2" from the CMT driver.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#4 lore raw

Re: [PATCH 2/3] clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support

Hi Geert,

Quoted 10 lines · Geert Uytterhoeven

Hi Magnus,

Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Since late 2017 the DT compat string "renesas,cmt-48-gen2" has not been in use in the upstream kernel. SoC-specific strings and the fallback string "rcar-gen2-cmt1" are now used in the DTSI instead.

Quoted 5 lines

Not really: since v4.16, which was released on Apr 1, 2018, i.e. after v4.14, the base for the latest LTSI kernel.

Note that the removal commits were backported to v4.14-ltsi, but not to v4.14.y.

You are right. I was looking at the commit date in git of:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=98b6b8b493a99d828e6665e6e67d6ca077c1aee0

Actually the first version of the series "[PATCH 00/08] clocksource:
sh_cmt: DT binding rework" was posted in mid-2015, but I guess I lost interest at some point. =)

Thanks for your help!

/ magnus

Quoted 16 lines
Quoted 3 lines

Remove "renesas,cmt-48-gen2" from the CMT driver.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw

PATCH 3/3 clocksource/drivers/sh_cmt: Document "cmt-48" as deprecated

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Update the CMT driver to mark "renesas,cmt-48" as deprecated.

Instead of documenting a theoretical hardware device based on current software support level, define DT bindings top-down based on available data sheet information and make use of part numbers in the DT compat string.

In case of the only in-tree users r8a7740 and sh73a0 the compat strings "renesas,r8a7740-cmt1" and "renesas,sh73a0-cmt1" may be used instead.

---

The updated SoC-specific DT bindings are documented in:
[PATCH 2/8] dt-bindings: timer: renesas, cmt: Update CMT1 on sh73a0 and r8a7740

 drivers/clocksource/sh_cmt.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clocksource/sh_cmt.c +5 -1
@@ -921,7 +921,11 @@ static const struct platform_device_id s
 MODULE_DEVICE_TABLE(platform, sh_cmt_id_table);
 
 static const struct of_device_id sh_cmt_of_table[] __maybe_unused = {
-	{ .compatible = "renesas,cmt-48", .data = &sh_cmt_info[SH_CMT_48BIT] },
+	{
+		/* deprecated, preserved for backward compatibility */
+		.compatible = "renesas,cmt-48",
+		.data = &sh_cmt_info[SH_CMT_48BIT]
+	},
 	{
 		.compatible = "renesas,r8a7740-cmt1",
 		.data = &sh_cmt_info[SH_CMT_48BIT]
#6 lore raw
In reply to Magnus Damm
Quoted 11 lines · Magnus Damm

clocksource/drivers/sh_cmt: Minor DT compat string update

[PATCH 1/3] clocksource/drivers/sh_cmt: SoC-specific match for CMT1 on r8a7740 and sh73a0 [PATCH 2/3] clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support
[PATCH 3/3] clocksource/drivers/sh_cmt: Document "cmt-48" as deprecated

Move over to new CMT1 bindings on r8a7740 and sh73a0 and get rid of old stale stuff such as "cmt-48-gen2" while keeping "cmt-48" around but document it as deprecated.

Hi Magnus,

I think this series should include the Clocksource maintainers as recipients:

Daniel Lezcano <[email protected]>
Thomas Gleixner <[email protected]>

And LKML for good measure.

Quoted 8 lines

---

Patch 1 and patch 3 depend on updated SoC-specific DT bindings in:
[PATCH 2/8] dt-bindings: timer: renesas, cmt: Update CMT1 on sh73a0 and r8a7740

 drivers/clocksource/sh_cmt.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
#7 lore raw
Quoted 17 lines · Simon Horman
Quoted 11 lines · Magnus Damm

clocksource/drivers/sh_cmt: Minor DT compat string update

[PATCH 1/3] clocksource/drivers/sh_cmt: SoC-specific match for CMT1 on r8a7740 and sh73a0 [PATCH 2/3] clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support
[PATCH 3/3] clocksource/drivers/sh_cmt: Document "cmt-48" as deprecated

Move over to new CMT1 bindings on r8a7740 and sh73a0 and get rid of old stale stuff such as "cmt-48-gen2" while keeping "cmt-48" around but document it as deprecated.

Hi Magnus,

Quoted 7 lines

I think this series should include the Clocksource maintainers as recipients:

Daniel Lezcano <[email protected]>
Thomas Gleixner <[email protected]>

And LKML for good measure.

Hi Simon,

I totally agree. I was suspecting some opinions might come out about the CMT compat string changes in the DT binding document. I'll repost this series and include the above folks/ML once the CMT compat string changes in DT binding document are agreed.

Cheers,

/ magnus

#8 lore raw
Quoted 24 lines · Magnus Damm
Quoted 23 lines · Simon Horman
Quoted 11 lines · Magnus Damm

clocksource/drivers/sh_cmt: Minor DT compat string update

[PATCH 1/3] clocksource/drivers/sh_cmt: SoC-specific match for CMT1 on r8a7740 and sh73a0 [PATCH 2/3] clocksource/drivers/sh_cmt: Remove "cmt-48-gen2" support
[PATCH 3/3] clocksource/drivers/sh_cmt: Document "cmt-48" as deprecated

Move over to new CMT1 bindings on r8a7740 and sh73a0 and get rid of old stale stuff such as "cmt-48-gen2" while keeping "cmt-48" around but document it as deprecated.

Hi Magnus,

I think this series should include the Clocksource maintainers as recipients:

Daniel Lezcano <[email protected]>
Thomas Gleixner <[email protected]>

Quoted 8 lines
Quoted 1 line

And LKML for good measure.

Hi Simon,

I totally agree. I was suspecting some opinions might come out about the CMT compat string changes in the DT binding document. I'll repost this series and include the above folks/ML once the CMT compat string changes in DT binding document are agreed.

Great, thanks!