RE: [PATCH 2/2] clocksource: timer-imx-sysctr: set cpumask to cpu_possible_mask

From: Peng Fan
Date: Sun Dec 05 2021 - 07:53:59 EST


> Subject: Re: [PATCH 2/2] clocksource: timer-imx-sysctr: set cpumask to
> cpu_possible_mask
>
> On 01/12/2021 13:50, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@xxxxxxx>
> >
> > Actually we have CLOCK_EVT_FEAT_DYNIRQ, the irq affinity will be
> > runtime changed and no issue. But the system counter timer is not tied
> > to CPU0, so use cpu_possible_mask here.
>
> Did you mean:
>
> "There is no reason to tie the system counter timer to CPU0, change its
> affinity to cpu_possible_mask.
>
> Moreover, the timer has the flag CLOCK_EVT_FEAT_DYNIRQ set, changing to
> cpu_possibl_mask will reduce the number of wakeups related to the system
> timer"

The syctr interrupt could be set affinity to any cores in the SoC. Default affinity
is set to cpu 0.

This timer will be used as broadcast timer on all the i.MX SoCs. Because DYNIRQ
flag set, the core time framework will runtime set the interrupt affinity to the cores
that needs to wake up and the cpumask will runtime set to the core that will be
wake up. So even the sysctr initialization use cpumask 0, there is no issue,
the current patch is just use cpu_possible_mask to show the fact that the
timer supports routed to all the cpu cores and nothing else.

Thanks,
Peng.

>
> ?
>
> Note you may want to explain why 'there is no reason'
>
>
> > Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
> > ---
> > drivers/clocksource/timer-imx-sysctr.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clocksource/timer-imx-sysctr.c
> > b/drivers/clocksource/timer-imx-sysctr.c
> > index 2b309af11266..55a8e198d2a1 100644
> > --- a/drivers/clocksource/timer-imx-sysctr.c
> > +++ b/drivers/clocksource/timer-imx-sysctr.c
> > @@ -119,7 +119,7 @@ static struct timer_of to_sysctr = {
> >
> > static void __init sysctr_clockevent_init(void) {
> > - to_sysctr.clkevt.cpumask = cpumask_of(0);
> > + to_sysctr.clkevt.cpumask = cpu_possible_mask;
> >
> > clockevents_config_and_register(&to_sysctr.clkevt,
> > timer_of_rate(&to_sysctr),
> >
>
>
> --
> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.l
> inaro.org%2F&amp;data=04%7C01%7Cpeng.fan%40nxp.com%7C1fec86efbd5
> 4498106c508d9b57d9e2a%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C637740373391832133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
> 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&
> amp;sdata=q98PLDpC8h7jt%2BjvCeXZAf2F5ZzJsMMS613OSHmjDr0%3D&am
> p;reserved=0> Linaro.org │ Open source software for ARM SoCs
>
> Follow Linaro:
> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.f
> acebook.com%2Fpages%2FLinaro&amp;data=04%7C01%7Cpeng.fan%40nxp.
> com%7C1fec86efbd54498106c508d9b57d9e2a%7C686ea1d3bc2b4c6fa92cd
> 99c5c301635%7C0%7C0%7C637740373391832133%7CUnknown%7CTWFpb
> GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI
> 6Mn0%3D%7C3000&amp;sdata=KmuInvkOIYTEcR4sFHhEbQSJczarvwwm8slI
> GfjCa70%3D&amp;reserved=0> Facebook |
> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwitter
> .com%2F%23!%2Flinaroorg&amp;data=04%7C01%7Cpeng.fan%40nxp.com%
> 7C1fec86efbd54498106c508d9b57d9e2a%7C686ea1d3bc2b4c6fa92cd99c5c
> 301635%7C0%7C0%7C637740373391832133%7CUnknown%7CTWFpbGZsb3
> d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> %3D%7C3000&amp;sdata=mS9fXmEPB1798JRJWfhEpXcbdWfRiSb5%2FH6cz7
> 9rl8E%3D&amp;reserved=0> Twitter |
> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.l
> inaro.org%2Flinaro-blog%2F&amp;data=04%7C01%7Cpeng.fan%40nxp.com%
> 7C1fec86efbd54498106c508d9b57d9e2a%7C686ea1d3bc2b4c6fa92cd99c5c
> 301635%7C0%7C0%7C637740373391832133%7CUnknown%7CTWFpbGZsb3
> d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> %3D%7C3000&amp;sdata=%2BlsiYye7ZBW8jClBsZbSHkcbD0hqvvvx0H9SAlUV
> e7U%3D&amp;reserved=0> Blog