<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/clocksource/arm_global_timer.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-09-23T10:41:58+00:00</updated>
<entry>
<title>clocksource/drivers/arm_global_timer: Add auto-detection for initial prescaler values</title>
<updated>2025-09-23T10:41:58+00:00</updated>
<author>
<name>Markus Schneider-Pargmann</name>
<email>msp@baylibre.com</email>
</author>
<published>2025-08-19T07:52:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c4b87c921fb158d853adcb8fd48c2dc07fc6f91'/>
<id>urn:sha1:1c4b87c921fb158d853adcb8fd48c2dc07fc6f91</id>
<content type='text'>
am43xx has a clock tree where the global timer clock is an indirect child
of the CPU clock used for frequency scaling:

  dpll_mpu_ck -- CPU/cpufreq
        |
        v
  dpll_mpu_m2_ck -- divider
        |
        v
  mpu_periphclk -- fixed divider by 2 used for global timer

When CPU frequency changes, the global timer's clock notifier rejects
the change because the hardcoded prescaler (1 or 2) cannot accommodate
the frequency range across all CPU OPPs (300, 600, 720, 800, 1000 MHz).

Add platform-specific prescaler auto-detection to solve this issue:

- am43xx: prescaler = 50 (calculated as initial_freq/GCD of all OPP
  freqs) This allows the timer to work across all CPU frequencies after
  the fixed divider by 2. Tested on am4372-idk-evm.

- zynq-7000: prescaler = 2 (preserves previous Kconfig default)

- Other platforms: prescaler = 1 (previous default)

The Kconfig option now defaults to 0 (auto-detection) but can still
override the auto-detected value when set to a non-zero value,
preserving existing customization workflows.

Signed-off-by: Markus Schneider-Pargmann &lt;msp@baylibre.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Tested-by: Kevin Hilman &lt;khilman@baylibre.com&gt;
Tested-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Tested-by: Judith Mendez &lt;jm@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@baylibre.com&gt;
Link: https://lore.kernel.org/r/20250819-topic-am43-arm-global-timer-v6-16-v2-1-6d082e2a5161@baylibre.com
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Remove clockevents shutdown call on offlining</title>
<updated>2024-10-31T09:41:42+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>frederic@kernel.org</email>
</author>
<published>2024-10-29T12:54:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15b810e0496eba62ca5a70d1545d1e4757c0a1ee'/>
<id>urn:sha1:15b810e0496eba62ca5a70d1545d1e4757c0a1ee</id>
<content type='text'>
The clockevents core already detached and unregistered it at this stage.

Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/all/20241029125451.54574-7-frederic@kernel.org

</content>
</entry>
<entry>
<title>clocksource/driver/arm_global_timer: Remove unnecessary ‘0’ values from err</title>
<updated>2024-07-12T14:07:05+00:00</updated>
<author>
<name>Li kunyu</name>
<email>kunyu@nfschina.com</email>
</author>
<published>2024-07-05T05:21:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f3539a6a6998e1e662fdb30af435f239d5931c98'/>
<id>urn:sha1:f3539a6a6998e1e662fdb30af435f239d5931c98</id>
<content type='text'>
The 'err' variable is initialized whatever the code path, it is
pointless to initialize it when it is declared.

Signed-off-by: Li kunyu &lt;kunyu@nfschina.com&gt;
Link: https://lore.kernel.org/r/20240705052159.22235-1-kunyu@nfschina.com
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Simplify prescaler register access</title>
<updated>2024-02-26T09:07:25+00:00</updated>
<author>
<name>Martin Blumenstingl</name>
<email>martin.blumenstingl@googlemail.com</email>
</author>
<published>2024-02-25T15:13:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=755350bcfb4ac8cbbb62bd7ee6be8271d4b2a88a'/>
<id>urn:sha1:755350bcfb4ac8cbbb62bd7ee6be8271d4b2a88a</id>
<content type='text'>
Use GENMASK() to define the prescaler mask and make the whole driver use
the mask (together with helpers such as FIELD_{GET,PREP,FIT}) instead of
needing an additional shift and max value constant.

Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240225151336.2728533-4-martin.blumenstingl@googlemail.com
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Guard against division by zero</title>
<updated>2024-02-26T09:07:25+00:00</updated>
<author>
<name>Martin Blumenstingl</name>
<email>martin.blumenstingl@googlemail.com</email>
</author>
<published>2024-02-25T15:13:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e651f2fae33634175fae956d896277cf916f5d09'/>
<id>urn:sha1:e651f2fae33634175fae956d896277cf916f5d09</id>
<content type='text'>
The result of the division of new_rate by gt_target_rate can be zero (if
new_rate is smaller than gt_target_rate). Using that result as divisor
without checking can result in a division by zero error. Guard against
this by checking for a zero value earlier.
While here, also change the psv variable to an unsigned long to make
sure we don't overflow the datatype as all other types involved are also
unsiged long.

Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240225151336.2728533-3-martin.blumenstingl@googlemail.com
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Make gt_target_rate unsigned long</title>
<updated>2024-02-26T09:07:25+00:00</updated>
<author>
<name>Martin Blumenstingl</name>
<email>martin.blumenstingl@googlemail.com</email>
</author>
<published>2024-02-25T15:13:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f31c204850f9d93906b5ac8c203b2066524ff245'/>
<id>urn:sha1:f31c204850f9d93906b5ac8c203b2066524ff245</id>
<content type='text'>
Change the data type of gt_target_rate to unsigned long as this is what
we get back from clk_get_rate().

Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240225151336.2728533-2-martin.blumenstingl@googlemail.com
</content>
</entry>
<entry>
<title>clocksource: arm_global_timer: fix non-kernel-doc comment</title>
<updated>2024-02-21T08:56:06+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2024-01-15T05:36:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=97454a65d56b240013ed8d396427b85e34384238'/>
<id>urn:sha1:97454a65d56b240013ed8d396427b85e34384238</id>
<content type='text'>
Use a common C comment "/*" instead of a kernel-doc marker "/**"
to prevent kernel-doc warnings:

arm_global_timer.c:92: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * To ensure that updates to comparator value register do not set the
arm_global_timer.c:92: warning: missing initial short description on line:
 * To ensure that updates to comparator value register do not set the

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240115053641.29129-1-rdunlap@infradead.org
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Remove stray tab</title>
<updated>2024-02-18T23:48:54+00:00</updated>
<author>
<name>Martin Blumenstingl</name>
<email>martin.blumenstingl@googlemail.com</email>
</author>
<published>2024-02-18T17:41:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9256cec7b4f3293c11585326401325b1f81670e1'/>
<id>urn:sha1:9256cec7b4f3293c11585326401325b1f81670e1</id>
<content type='text'>
Remove a stray tab in global_timer_of_register() which is different from
the coding style in the rest of the driver.

Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240218174138.1942418-3-martin.blumenstingl@googlemail.com
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Fix maximum prescaler value</title>
<updated>2024-02-18T23:48:54+00:00</updated>
<author>
<name>Martin Blumenstingl</name>
<email>martin.blumenstingl@googlemail.com</email>
</author>
<published>2024-02-18T17:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b34b9547cee41575a4fddf390f615570759dc999'/>
<id>urn:sha1:b34b9547cee41575a4fddf390f615570759dc999</id>
<content type='text'>
The prescaler in the "Global Timer Control Register bit assignments" is
documented to use bits [15:8], which means that the maximum prescaler
register value is 0xff.

Fixes: 171b45a4a70e ("clocksource/drivers/arm_global_timer: Implement rate compensation whenever source clock changes")
Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240218174138.1942418-2-martin.blumenstingl@googlemail.com
</content>
</entry>
<entry>
<title>clocksource/drivers/arm_global_timer: Remove duplicated argument in arm_global_timer</title>
<updated>2021-06-16T15:33:04+00:00</updated>
<author>
<name>Wan Jiabing</name>
<email>wanjiabing@vivo.com</email>
</author>
<published>2021-06-15T11:54:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f94bc2667fb204d7c131ac39d9ea342bd16116dc'/>
<id>urn:sha1:f94bc2667fb204d7c131ac39d9ea342bd16116dc</id>
<content type='text'>
Fix the following coccicheck warning:

    drivers/clocksource/arm_global_timer.c:107:4-23:
    duplicated argument to &amp; or |

Signed-off-by: Wan Jiabing &lt;wanjiabing@vivo.com&gt;
Reviewed-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20210615115440.8881-1-wanjiabing@vivo.com
</content>
</entry>
</feed>
