* [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
@ 2022-12-29 22:46 ` Prabhakar
0 siblings, 0 replies; 11+ messages in thread
From: Prabhakar @ 2022-12-29 22:46 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Daniel Lezcano,
Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Prabhakar, Lad Prabhakar, Samuel Holland
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Having a clocksource_arch_init() callback always sets vdso_clock_mode to
VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
required for the riscv-timer.
This works for platforms where just riscv-timer clocksource is present.
On platforms where other clock sources are available we want them to
register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
move setting of vdso_clock_mode in the riscv-timer driver instead of doing
this in clocksource_arch_init() callback as done similarly for ARM/64
architecture.
[0] drivers/clocksource/renesas-ostm.c
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Samuel Holland <samuel@sholland.org>
---
RFC -> v2
* Dropped vdso_default static global variable
* Used IS_ENABLED() macro
* Included Tested-by from Samuel
RFC:
https://patchwork.kernel.org/project/linux-renesas-soc/patch/20221211215843.24024-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
---
arch/riscv/Kconfig | 1 -
arch/riscv/kernel/time.c | 9 ---------
drivers/clocksource/timer-riscv.c | 5 +++++
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index e2b656043abf..9c687da7756d 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -12,7 +12,6 @@ config 32BIT
config RISCV
def_bool y
- select ARCH_CLOCKSOURCE_INIT
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
select ARCH_HAS_BINFMT_FLAT
diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 8217b0f67c6c..42bee305e997 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -30,12 +30,3 @@ void __init time_init(void)
of_clk_init(NULL);
timer_probe();
}
-
-void clocksource_arch_init(struct clocksource *cs)
-{
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
- cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
-#else
- cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
-#endif
-}
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index 55dad7965f43..c416e5e934bf 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -77,6 +77,11 @@ static struct clocksource riscv_clocksource = {
.mask = CLOCKSOURCE_MASK(64),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.read = riscv_clocksource_rdtime,
+#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
+ .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
+#else
+ .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
+#endif
};
static int riscv_timer_starting_cpu(unsigned int cpu)
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
@ 2022-12-29 22:46 ` Prabhakar
0 siblings, 0 replies; 11+ messages in thread
From: Prabhakar @ 2022-12-29 22:46 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Daniel Lezcano,
Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Prabhakar, Lad Prabhakar, Samuel Holland
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Having a clocksource_arch_init() callback always sets vdso_clock_mode to
VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
required for the riscv-timer.
This works for platforms where just riscv-timer clocksource is present.
On platforms where other clock sources are available we want them to
register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
move setting of vdso_clock_mode in the riscv-timer driver instead of doing
this in clocksource_arch_init() callback as done similarly for ARM/64
architecture.
[0] drivers/clocksource/renesas-ostm.c
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Samuel Holland <samuel@sholland.org>
---
RFC -> v2
* Dropped vdso_default static global variable
* Used IS_ENABLED() macro
* Included Tested-by from Samuel
RFC:
https://patchwork.kernel.org/project/linux-renesas-soc/patch/20221211215843.24024-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
---
arch/riscv/Kconfig | 1 -
arch/riscv/kernel/time.c | 9 ---------
drivers/clocksource/timer-riscv.c | 5 +++++
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index e2b656043abf..9c687da7756d 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -12,7 +12,6 @@ config 32BIT
config RISCV
def_bool y
- select ARCH_CLOCKSOURCE_INIT
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
select ARCH_HAS_BINFMT_FLAT
diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 8217b0f67c6c..42bee305e997 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -30,12 +30,3 @@ void __init time_init(void)
of_clk_init(NULL);
timer_probe();
}
-
-void clocksource_arch_init(struct clocksource *cs)
-{
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
- cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
-#else
- cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
-#endif
-}
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index 55dad7965f43..c416e5e934bf 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -77,6 +77,11 @@ static struct clocksource riscv_clocksource = {
.mask = CLOCKSOURCE_MASK(64),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.read = riscv_clocksource_rdtime,
+#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
+ .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
+#else
+ .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
+#endif
};
static int riscv_timer_starting_cpu(unsigned int cpu)
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
2022-12-29 22:46 ` Prabhakar
@ 2023-01-03 17:38 ` Samuel Holland
-1 siblings, 0 replies; 11+ messages in thread
From: Samuel Holland @ 2023-01-03 17:38 UTC (permalink / raw)
To: Prabhakar, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Daniel Lezcano, Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Lad Prabhakar
On 12/29/22 16:46, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
> RFC -> v2
> * Dropped vdso_default static global variable
> * Used IS_ENABLED() macro
> * Included Tested-by from Samuel
>
> RFC:
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/20221211215843.24024-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
> ---
> arch/riscv/Kconfig | 1 -
> arch/riscv/kernel/time.c | 9 ---------
> drivers/clocksource/timer-riscv.c | 5 +++++
> 3 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..9c687da7756d 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -12,7 +12,6 @@ config 32BIT
>
> config RISCV
> def_bool y
> - select ARCH_CLOCKSOURCE_INIT
> select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
> select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
> select ARCH_HAS_BINFMT_FLAT
> diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
> index 8217b0f67c6c..42bee305e997 100644
> --- a/arch/riscv/kernel/time.c
> +++ b/arch/riscv/kernel/time.c
> @@ -30,12 +30,3 @@ void __init time_init(void)
> of_clk_init(NULL);
> timer_probe();
> }
> -
> -void clocksource_arch_init(struct clocksource *cs)
> -{
> -#ifdef CONFIG_GENERIC_GETTIMEOFDAY
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
> -#else
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
> -#endif
> -}
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index 55dad7965f43..c416e5e934bf 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -77,6 +77,11 @@ static struct clocksource riscv_clocksource = {
> .mask = CLOCKSOURCE_MASK(64),
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> .read = riscv_clocksource_rdtime,
> +#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
> + .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
> +#else
> + .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
The else case isn't strictly necessary because VDSO_CLOCKMODE_NONE is
the default. Either way it looks fine to me.
Reviewed-by: Samuel Holland <samuel@sholland.org>
And I tested v2 as well.
Regards,
Samuel
> +#endif
> };
>
> static int riscv_timer_starting_cpu(unsigned int cpu)
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
@ 2023-01-03 17:38 ` Samuel Holland
0 siblings, 0 replies; 11+ messages in thread
From: Samuel Holland @ 2023-01-03 17:38 UTC (permalink / raw)
To: Prabhakar, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Daniel Lezcano, Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Lad Prabhakar
On 12/29/22 16:46, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
> RFC -> v2
> * Dropped vdso_default static global variable
> * Used IS_ENABLED() macro
> * Included Tested-by from Samuel
>
> RFC:
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/20221211215843.24024-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
> ---
> arch/riscv/Kconfig | 1 -
> arch/riscv/kernel/time.c | 9 ---------
> drivers/clocksource/timer-riscv.c | 5 +++++
> 3 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..9c687da7756d 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -12,7 +12,6 @@ config 32BIT
>
> config RISCV
> def_bool y
> - select ARCH_CLOCKSOURCE_INIT
> select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
> select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
> select ARCH_HAS_BINFMT_FLAT
> diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
> index 8217b0f67c6c..42bee305e997 100644
> --- a/arch/riscv/kernel/time.c
> +++ b/arch/riscv/kernel/time.c
> @@ -30,12 +30,3 @@ void __init time_init(void)
> of_clk_init(NULL);
> timer_probe();
> }
> -
> -void clocksource_arch_init(struct clocksource *cs)
> -{
> -#ifdef CONFIG_GENERIC_GETTIMEOFDAY
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
> -#else
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
> -#endif
> -}
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index 55dad7965f43..c416e5e934bf 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -77,6 +77,11 @@ static struct clocksource riscv_clocksource = {
> .mask = CLOCKSOURCE_MASK(64),
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> .read = riscv_clocksource_rdtime,
> +#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
> + .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
> +#else
> + .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
The else case isn't strictly necessary because VDSO_CLOCKMODE_NONE is
the default. Either way it looks fine to me.
Reviewed-by: Samuel Holland <samuel@sholland.org>
And I tested v2 as well.
Regards,
Samuel
> +#endif
> };
>
> static int riscv_timer_starting_cpu(unsigned int cpu)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
2022-12-29 22:46 ` Prabhakar
@ 2023-01-14 18:58 ` Lad, Prabhakar
-1 siblings, 0 replies; 11+ messages in thread
From: Lad, Prabhakar @ 2023-01-14 18:58 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Daniel Lezcano,
Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Lad Prabhakar, Samuel Holland
On Thu, Dec 29, 2022 at 10:50 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
>
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
> RFC -> v2
> * Dropped vdso_default static global variable
> * Used IS_ENABLED() macro
> * Included Tested-by from Samuel
>
> RFC:
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/20221211215843.24024-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
> ---
> arch/riscv/Kconfig | 1 -
> arch/riscv/kernel/time.c | 9 ---------
> drivers/clocksource/timer-riscv.c | 5 +++++
> 3 files changed, 5 insertions(+), 10 deletions(-)
>
Gentle ping.
Cheers,
Prabhakar
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..9c687da7756d 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -12,7 +12,6 @@ config 32BIT
>
> config RISCV
> def_bool y
> - select ARCH_CLOCKSOURCE_INIT
> select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
> select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
> select ARCH_HAS_BINFMT_FLAT
> diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
> index 8217b0f67c6c..42bee305e997 100644
> --- a/arch/riscv/kernel/time.c
> +++ b/arch/riscv/kernel/time.c
> @@ -30,12 +30,3 @@ void __init time_init(void)
> of_clk_init(NULL);
> timer_probe();
> }
> -
> -void clocksource_arch_init(struct clocksource *cs)
> -{
> -#ifdef CONFIG_GENERIC_GETTIMEOFDAY
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
> -#else
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
> -#endif
> -}
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index 55dad7965f43..c416e5e934bf 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -77,6 +77,11 @@ static struct clocksource riscv_clocksource = {
> .mask = CLOCKSOURCE_MASK(64),
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> .read = riscv_clocksource_rdtime,
> +#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
> + .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
> +#else
> + .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
> +#endif
> };
>
> static int riscv_timer_starting_cpu(unsigned int cpu)
> --
> 2.25.1
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
@ 2023-01-14 18:58 ` Lad, Prabhakar
0 siblings, 0 replies; 11+ messages in thread
From: Lad, Prabhakar @ 2023-01-14 18:58 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Daniel Lezcano,
Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Lad Prabhakar, Samuel Holland
On Thu, Dec 29, 2022 at 10:50 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
>
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
> RFC -> v2
> * Dropped vdso_default static global variable
> * Used IS_ENABLED() macro
> * Included Tested-by from Samuel
>
> RFC:
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/20221211215843.24024-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
> ---
> arch/riscv/Kconfig | 1 -
> arch/riscv/kernel/time.c | 9 ---------
> drivers/clocksource/timer-riscv.c | 5 +++++
> 3 files changed, 5 insertions(+), 10 deletions(-)
>
Gentle ping.
Cheers,
Prabhakar
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..9c687da7756d 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -12,7 +12,6 @@ config 32BIT
>
> config RISCV
> def_bool y
> - select ARCH_CLOCKSOURCE_INIT
> select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
> select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
> select ARCH_HAS_BINFMT_FLAT
> diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
> index 8217b0f67c6c..42bee305e997 100644
> --- a/arch/riscv/kernel/time.c
> +++ b/arch/riscv/kernel/time.c
> @@ -30,12 +30,3 @@ void __init time_init(void)
> of_clk_init(NULL);
> timer_probe();
> }
> -
> -void clocksource_arch_init(struct clocksource *cs)
> -{
> -#ifdef CONFIG_GENERIC_GETTIMEOFDAY
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
> -#else
> - cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
> -#endif
> -}
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index 55dad7965f43..c416e5e934bf 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -77,6 +77,11 @@ static struct clocksource riscv_clocksource = {
> .mask = CLOCKSOURCE_MASK(64),
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> .read = riscv_clocksource_rdtime,
> +#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
> + .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
> +#else
> + .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
> +#endif
> };
>
> static int riscv_timer_starting_cpu(unsigned int cpu)
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
2022-12-29 22:46 ` Prabhakar
@ 2023-01-20 14:09 ` Conor Dooley
-1 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2023-01-20 14:09 UTC (permalink / raw)
To: Prabhakar
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Daniel Lezcano,
Thomas Gleixner, linux-riscv, Geert Uytterhoeven, linux-kernel,
linux-renesas-soc, Lad Prabhakar, Samuel Holland
[-- Attachment #1.1: Type: text/plain, Size: 1410 bytes --]
On Thu, Dec 29, 2022 at 10:46:01PM +0000, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
> RFC -> v2
> * Dropped vdso_default static global variable
> * Used IS_ENABLED() macro
Not sure it really makes much difference here either way, but increased
coverage is always good I suppose.
rv32 is the user for the !GENERIC_GETTIMEOFDAY patch IIRC and nothing
seemed obviously amiss there to me either.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
@ 2023-01-20 14:09 ` Conor Dooley
0 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2023-01-20 14:09 UTC (permalink / raw)
To: Prabhakar
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Daniel Lezcano,
Thomas Gleixner, linux-riscv, Geert Uytterhoeven, linux-kernel,
linux-renesas-soc, Lad Prabhakar, Samuel Holland
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
On Thu, Dec 29, 2022 at 10:46:01PM +0000, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
> RFC -> v2
> * Dropped vdso_default static global variable
> * Used IS_ENABLED() macro
Not sure it really makes much difference here either way, but increased
coverage is always good I suppose.
rv32 is the user for the !GENERIC_GETTIMEOFDAY patch IIRC and nothing
seemed obviously amiss there to me either.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
2022-12-29 22:46 ` Prabhakar
@ 2023-01-26 11:18 ` Daniel Lezcano
-1 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2023-01-26 11:18 UTC (permalink / raw)
To: Prabhakar, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Lad Prabhakar, Samuel Holland
On 29/12/2022 23:46, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
Applied, I had a trivial conflict which was fixed. Please have a look on
the patch once it is push in the timers/next branch
Thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
@ 2023-01-26 11:18 ` Daniel Lezcano
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2023-01-26 11:18 UTC (permalink / raw)
To: Prabhakar, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Thomas Gleixner
Cc: linux-riscv, Geert Uytterhoeven, linux-kernel, linux-renesas-soc,
Lad Prabhakar, Samuel Holland
On 29/12/2022 23:46, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Having a clocksource_arch_init() callback always sets vdso_clock_mode to
> VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
> required for the riscv-timer.
>
> This works for platforms where just riscv-timer clocksource is present.
> On platforms where other clock sources are available we want them to
> register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
>
> On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
> avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
> move setting of vdso_clock_mode in the riscv-timer driver instead of doing
> this in clocksource_arch_init() callback as done similarly for ARM/64
> architecture.
>
> [0] drivers/clocksource/renesas-ostm.c
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Tested-by: Samuel Holland <samuel@sholland.org>
> ---
Applied, I had a trivial conflict which was fixed. Please have a look on
the patch once it is push in the timers/next branch
Thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 11+ messages in thread
* [tip: timers/core] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
2022-12-29 22:46 ` Prabhakar
` (4 preceding siblings ...)
(?)
@ 2023-02-13 18:26 ` tip-bot2 for Lad Prabhakar
-1 siblings, 0 replies; 11+ messages in thread
From: tip-bot2 for Lad Prabhakar @ 2023-02-13 18:26 UTC (permalink / raw)
To: linux-tip-commits
Cc: Lad Prabhakar, Samuel Holland, Conor Dooley, Daniel Lezcano, x86,
linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 3aff0403f814df6ce2377a6ecf61dd7750a3925f
Gitweb: https://git.kernel.org/tip/3aff0403f814df6ce2377a6ecf61dd7750a3925f
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
AuthorDate: Thu, 29 Dec 2022 22:46:01
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Mon, 13 Feb 2023 13:10:17 +01:00
clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback
Having a clocksource_arch_init() callback always sets vdso_clock_mode to
VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is
required for the riscv-timer.
This works for platforms where just riscv-timer clocksource is present.
On platforms where other clock sources are available we want them to
register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE.
On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to
avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER
move setting of vdso_clock_mode in the riscv-timer driver instead of doing
this in clocksource_arch_init() callback as done similarly for ARM/64
architecture.
[0] drivers/clocksource/renesas-ostm.c
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20221229224601.103851-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/riscv/Kconfig | 1 -
arch/riscv/kernel/time.c | 9 ---------
drivers/clocksource/timer-riscv.c | 5 +++++
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index e2b6560..9c687da 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -12,7 +12,6 @@ config 32BIT
config RISCV
def_bool y
- select ARCH_CLOCKSOURCE_INIT
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
select ARCH_HAS_BINFMT_FLAT
diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 1cf21db..babaf3b 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -33,12 +33,3 @@ void __init time_init(void)
tick_setup_hrtimer_broadcast();
}
-
-void clocksource_arch_init(struct clocksource *cs)
-{
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
- cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
-#else
- cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
-#endif
-}
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index adf7f98..d8cb629 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -78,6 +78,11 @@ static struct clocksource riscv_clocksource = {
.mask = CLOCKSOURCE_MASK(64),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.read = riscv_clocksource_rdtime,
+#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)
+ .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER,
+#else
+ .vdso_clock_mode = VDSO_CLOCKMODE_NONE,
+#endif
};
static int riscv_timer_starting_cpu(unsigned int cpu)
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-02-13 18:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-29 22:46 [PATCH v2] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback Prabhakar
2022-12-29 22:46 ` Prabhakar
2023-01-03 17:38 ` Samuel Holland
2023-01-03 17:38 ` Samuel Holland
2023-01-14 18:58 ` Lad, Prabhakar
2023-01-14 18:58 ` Lad, Prabhakar
2023-01-20 14:09 ` Conor Dooley
2023-01-20 14:09 ` Conor Dooley
2023-01-26 11:18 ` Daniel Lezcano
2023-01-26 11:18 ` Daniel Lezcano
2023-02-13 18:26 ` [tip: timers/core] " tip-bot2 for Lad Prabhakar
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.