clocksource/drivers/timer-sun4i: Add CLOCK_EVT_FEAT_DYNIRQ

Message ID 20230209040239.24710-1-frank.li@vivo.com
State New
Headers
Series clocksource/drivers/timer-sun4i: Add CLOCK_EVT_FEAT_DYNIRQ |

Commit Message

李扬韬 Feb. 9, 2023, 4:02 a.m. UTC
  Add CLOCK_EVT_FEAT_DYNIRQ to allow the IRQ could be runtime set affinity
to the cores that needs wake up, otherwise saying core0 has to send
IPI to wakeup core1. With CLOCK_EVT_FEAT_DYNIRQ set, when broadcast
timer could wake up the cores, IPI is not needed.

After enabling this feature, especially the scene where cpuidle is
enabled can benefit.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/clocksource/timer-sun4i.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Daniel Lezcano Feb. 10, 2023, 1:37 p.m. UTC | #1
On 09/02/2023 05:02, Yangtao Li wrote:
> Add CLOCK_EVT_FEAT_DYNIRQ to allow the IRQ could be runtime set affinity
> to the cores that needs wake up, otherwise saying core0 has to send
> IPI to wakeup core1. With CLOCK_EVT_FEAT_DYNIRQ set, when broadcast
> timer could wake up the cores, IPI is not needed.
> 
> After enabling this feature, especially the scene where cpuidle is
> enabled can benefit.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---

Applied, thanks
  

Patch

diff --git a/drivers/clocksource/timer-sun4i.c b/drivers/clocksource/timer-sun4i.c
index e5a70aa1deb4..7bdcc60ad43c 100644
--- a/drivers/clocksource/timer-sun4i.c
+++ b/drivers/clocksource/timer-sun4i.c
@@ -144,7 +144,8 @@  static struct timer_of to = {
 	.clkevt = {
 		.name = "sun4i_tick",
 		.rating = 350,
-		.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+		.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
+				CLOCK_EVT_FEAT_DYNIRQ,
 		.set_state_shutdown = sun4i_clkevt_shutdown,
 		.set_state_periodic = sun4i_clkevt_set_periodic,
 		.set_state_oneshot = sun4i_clkevt_set_oneshot,