]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: mmp: fix timer_read delay
authorDoug Brown <doug@schmorgal.com>
Sun, 4 Dec 2022 00:51:17 +0000 (16:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:52 +0000 (11:40 +0100)
commit6ec4e533dd50082b5a4412f8e45fef8f6f261993
treedd982ef5c4060e68cf7b9ec8081ffd5bfbdc7078
parent866686ae1803cc43995ce83f860465b6c3414e15
ARM: mmp: fix timer_read delay

[ Upstream commit c3c4577c9dcc22a5affc37a9571ca774f5d5e2c0 ]

timer_read() was using an empty 100-iteration loop to wait for the
TMR_CVWR register to capture the latest timer counter value. The delay
wasn't long enough. This resulted in CPU idle time being extremely
underreported on PXA168 with CONFIG_NO_HZ_IDLE=y.

Switch to the approach used in the vendor kernel, which implements the
capture delay by reading TMR_CVWR a few times instead.

Fixes: 8c975c48b032 ("[ARM] pxa: add base support for Marvell's PXA168 processor line")
Signed-off-by: Doug Brown <doug@schmorgal.com>
Link: https://lore.kernel.org/r/20221204005117.53452-3-doug@schmorgal.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mach-mmp/time.c