]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clocksource/drivers/imx-tpm: Fix next event not taking effect sometime
authorJacky Bai <ping.bai@nxp.com>
Thu, 25 Jul 2024 19:33:55 +0000 (15:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:07:51 +0000 (11:07 +0200)
commita5f2703f755080aa9a4f5ac3d39a343f851914a3
treec766514d4c5df3af0c35724d397c33e7800069e6
parent0746401d759ac58d8bafa44db8e6ce1ac4260c72
clocksource/drivers/imx-tpm: Fix next event not taking effect sometime

commit 3d5c2f8e75a55cfb11a85086c71996af0354a1fb upstream.

The value written into the TPM CnV can only be updated into the hardware
when the counter increases. Additional writes to the CnV write buffer are
ignored until the register has been updated. Therefore, we need to check
if the CnV has been updated before continuing. This may require waiting for
1 counter cycle in the worst case.

Cc: stable@vger.kernel.org
Fixes: 059ab7b82eec ("clocksource/drivers/imx-tpm: Add imx tpm timer support")
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240725193355.1436005-2-Frank.Li@nxp.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clocksource/timer-imx-tpm.c