Re: [PATCH v3] clocksource: Add driver for the Ingenic JZ47xx OST

From: Daniel Lezcano
Date: Sat Feb 08 2020 - 02:10:17 EST


Hi Paul,

On 15/01/2020 21:58, Paul Cercueil wrote:
>
>
> Le mer., janv. 15, 2020 at 20:54, Thomas Gleixner <tglx@xxxxxxxxxxxxx> a
> Ãcrit :
>> Paul Cercueil <paul@xxxxxxxxxxxxxxx> writes:
>>> ÂLe mer., janv. 15, 2020 at 18:48, Maarten ter Huurne
>>> Â<maarten@xxxxxxxxxxxxxx> a Ãcrit :
>>>> ÂOn Wednesday, 15 January 2020 14:57:01 CET Paul Cercueil wrote:
>>>>> Â Le mer., janv. 15, 2020 at 14:44, Daniel Lezcano
>>>>> Â <daniel.lezcano@xxxxxxxxxx> a Ãcrit :
>>>>> Â > Is the JZ47xx OST really a mfd needing a regmap? (Note regmap_read
>>>>> Â > will take a lock).
>>>>>
>>>>> Â Yes, the TCU_REG_OST_TCSR register is shared with the clocks driver.
>>>>
>>>> ÂThe TCU_REG_OST_TCSR register is only used in the probe though.
>>>>
>>>> ÂTo get the counter value from TCU_REG_OST_CNTL/TCU_REG_OST_CNTH you
>>>> Âcould technically do it by reading the register directly, if
>>>> Âperformance
>>>> Âconcerns make it necessary to bypass the usual kernel infrastructure
>>>> Âfor
>>>> Âdealing with shared registers.
>>>
>>> ÂIn theory yes, in practice there's no easy way to do that (the
>>> Âunderlying mmio pointer is not obtainable from the regmap), and
>>> Âbesides, the lock is just a spinlock and not a mutex.
>>
>> That lock still a massive contention point as clock readouts can be
>> pretty
>> frequent depending on workloads. Just think about tracing ...
>>
>> So I really would avoid both the lock and that ugly 64bit readout thing.
>
> The 64bit readout thing is gone in V3.
>
> The lock cannot go away unless we have a way to retrieve the underlying
> mmio pointer from the regmap, which the regmap maintainers will never
> accept. So I can't really change that now. Besides,
> drivers/clocksource/ingenic-timer.c also registers a clocksource that's
> read with the regmap, and nobody complained.

Is there any progress on this? Having a lock in this code path is very
impacting.


--
<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