Skip to contentSkip to conversation

Local Timer based on SPI

Question Kukjin Kim 2 participants 4 messages Nov 26, 2010 – Nov 29, 2010

lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

Hi all,

I have a question about local timer.

Current ARM Local Timer code is based on PPI using.
If want to use SPI on local timer, what approach is right or better?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#1 lore raw
Quoted 2 lines · Kukjin Kim

Current ARM Local Timer code is based on PPI using.
If want to use SPI on local timer, what approach is right or better?

SPI interrupts only go to one core at a time. You can't have local timer support off a targetted interrupt.

author
#2 lore raw
Quoted 7 lines · Russell King
Quoted 2 lines · Kukjin Kim

Current ARM Local Timer code is based on PPI using.
If want to use SPI on local timer, what approach is right or better?

SPI interrupts only go to one core at a time. You can't have local timer support off a targetted interrupt.

Hi Russell,

Thank you for your reply :-)

Yeah, it seems CONFIG_LOCAL_TIMER is just for PPI.

The purpose of my question is for the plan to use different SPIs to support each CPU event timer. According to the help message of LOCAL_TIMER in Kconfig, it seems better each CPU has a different event timer source clock instead of using IPI broadcast method. Current ARM implementation registers dummy_timers when CONFIG_LOCAL_TIMERS is not set so, I think need to set CONFIG_LOCAL_TIMERS.

To support different SPIs for each CPU event timer, should I neglect the dummy_timer?
Or is it not worth to implement?...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw
Quoted 8 lines · Kukjin Kim

Yeah, it seems CONFIG_LOCAL_TIMER is just for PPI.

The purpose of my question is for the plan to use different SPIs to support each CPU event timer. According to the help message of LOCAL_TIMER in Kconfig, it seems better each CPU has a different event timer source clock instead of using IPI broadcast method. Current ARM implementation registers dummy_timers when CONFIG_LOCAL_TIMERS is not set so, I think need to set CONFIG_LOCAL_TIMERS.

The dummy timer clock event device is setup to provide the core with a means to broadcast the timer IPI when there isn't a local timer. When there is a local timer, this function falls to the local timer clock event device (which is actually the same structure, just initialized in a different way.)

Quoted 3 lines

To support different SPIs for each CPU event timer, should I neglect the dummy_timer?
Or is it not worth to implement?...

It depends how many CPU cores you have. If you have just two, then the "thundering herd" issue may not affect you too much.

The idea behind local timers is to avoid all CPUs being woken at the same point in time, and then immediately contending over the same set of locks. Local timers help to distribute the wakeups throughout the interval, and thereby avoid contention.

If you have one CPU and you IPI the timer to it, then you've probably already done much of the work with the locks held already.