]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
clocksource/drivers/timer-ti-dm: Fix posted mode status check order
authorTony Lindgren <tony@atomide.com>
Thu, 4 Mar 2021 07:21:33 +0000 (09:21 +0200)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:24 +0000 (17:46 -0600)
commit4ec6338854c95f17a8bf7b9e2a5ad98d35fe0735
tree746b91337253fb747906d43493d75f69065a2f60
parent09715b30edf347fb5e9331c6f8b7144040020cbf
clocksource/drivers/timer-ti-dm: Fix posted mode status check order

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 212709926c5493a566ca4086ad4f4b0d4e66b553 ]

When the timer is configured in posted mode, we need to check the write-
posted status register (TWPS) before writing to the register.

We now check TWPS after the write starting with commit 52762fbd1c47
("clocksource/drivers/timer-ti-dm: Add clockevent and clocksource
support").

For example, in the TRM for am571x the following is documented in chapter
"22.2.4.13.1.1 Write Posting Synchronization Mode":

"For each register, a status bit is provided in the timer write-posted
 status (TWPS) register. In this mode, it is mandatory that software check
 this status bit before any write access. If a write is attempted to a
 register with a previous access pending, the previous access is discarded
 without notice."

The regression happened when I updated the code to use standard read/write
accessors for the driver instead of using __omap_dm_timer_load_start().
We have__omap_dm_timer_load_start() check the TWPS status correctly using
__omap_dm_timer_write().

Fixes: 52762fbd1c47 ("clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210304072135.52712-2-tony@atomide.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/clocksource/timer-ti-dm-systimer.c