devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Hao-Wen Ting <haowen.ting@realtek.com>,
	daniel.lezcano@linaro.org, tglx@linutronix.de
Cc: jinn.cheng@realtek.com, edwardwu@realtek.com, phelic@realtek.com,
	shawn.huang724@realtek.com, cy.huang@realtek.com,
	james.tai@realtek.com, cylee12@realtek.com, phinex@realtek.com,
	conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] clocksource: Add Realtek systimer as tick broadcast driver
Date: Tue, 11 Nov 2025 10:43:38 +0100	[thread overview]
Message-ID: <d94dc0f4-5d81-4e95-b9e6-1c3940180c36@kernel.org> (raw)
In-Reply-To: <20251111092959.616089-3-haowen.ting@realtek.com>

On 11/11/2025 10:29, Hao-Wen Ting wrote:
> Add a tick broadcast timer driver for Realtek SoCs.
> 
> On Realtek platforms, CPUs can enter deep idle states (C-states) where
> the local timer is stopped and powered off. Without a global tick
> broadcast timer, one CPU must remain awake to wake up the others,
> preventing all CPUs from entering deep idle simultaneously.
> 
> This driver provides a tick broadcast timer which remains active
> during deep idle states. This allows all CPUs to enter power-cut
> idle states simultaneously, significantly reducing overall power
> consumption.
> 
> The timer operates at 1MHz and supports oneshot mode.
> 
> Signed-off-by: Hao-Wen Ting <haowen.ting@realtek.com>
> ---
>  MAINTAINERS                         |   5 +
>  drivers/clocksource/Kconfig         |  10 ++
>  drivers/clocksource/Makefile        |   1 +
>  drivers/clocksource/timer-realtek.c | 173 ++++++++++++++++++++++++++++
>  4 files changed, 189 insertions(+)
>  create mode 100644 drivers/clocksource/timer-realtek.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index c7a116b795d5..59dfd7543c39 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -28395,3 +28395,8 @@ S:	Buried alive in reporters
>  T:	git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>  F:	*
>  F:	*/
> +
> +REALTEK SYSTIMER DRIVER

Why are you adding to the end of the file? Did you look at this file at
all before changing this?

> +M:	Hao-Wen Ting <haowen.ting@realtek.com>
> +S:	Maintained
> +F:	drivers/clocksource/timer-realtek.c
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index ffcd23668763..e86905378f82 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -782,4 +782,14 @@ config NXP_STM_TIMER
>            Enables the support for NXP System Timer Module found in the
>            s32g NXP platform series.
>  
> +config RTK_SYSTIMER
> +	bool "Realtek SYSTIMER support"
> +	depends on OF
Missing depends on ARCH. Please don't send drivers which do not have any
possible user.

> +	select TIMER_OF
> +	help
> +	  This enables the global tick-broadcast timer on Realtek platforms.
> +	  If your Realtek platform supports power-cut level CPU idle states,
> +	  enabling this timer allows all CPUs to enter power-cut simultaneously
> +	  to achieve lower power consumption.
> +

...

> +
> +static int __init rtk_systimer_init(struct device_node *node)
> +{
> +	int ret;
> +
> +	ret = timer_of_init(node, &_to);
> +	if (ret)
> +		return ret;
> +
> +	systimer_base = timer_of_base(&_to);
> +	clockevents_config_and_register(&_to.clkevt, SYSTIMER_RATE,
> +					SYSTIMER_MIN_DELTA, SYSTIMER_MAX_DELTA);
> +
> +	pr_info("Realtek SYSTIMER registered\n");

Drop.

This does not look like useful printk message. Drivers should be silent
on success:
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/coding-style.rst#L913
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/debugging/driver_development_debugging_guide.rst#L79

> +	return 0;
> +}
> +
> +TIMER_OF_DECLARE(rtk_systimer, "realtek,systimer", rtk_systimer_init);


Best regards,
Krzysztof

      reply	other threads:[~2025-11-11  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11  9:29 [PATCH 0/2] Add Realtek SYSTIMER driver Hao-Wen Ting
2025-11-11  9:29 ` [PATCH 1/2] dt-bindings: timer: Add Realtek SYSTIMER binding Hao-Wen Ting
2025-11-11  9:41   ` Krzysztof Kozlowski
2025-11-11  9:29 ` [PATCH 2/2] clocksource: Add Realtek systimer as tick broadcast driver Hao-Wen Ting
2025-11-11  9:43   ` Krzysztof Kozlowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d94dc0f4-5d81-4e95-b9e6-1c3940180c36@kernel.org \
    --to=krzk@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=cy.huang@realtek.com \
    --cc=cylee12@realtek.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=edwardwu@realtek.com \
    --cc=haowen.ting@realtek.com \
    --cc=james.tai@realtek.com \
    --cc=jinn.cheng@realtek.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phelic@realtek.com \
    --cc=phinex@realtek.com \
    --cc=robh@kernel.org \
    --cc=shawn.huang724@realtek.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).