]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix bnxt_refclk_read()
authorPavan Chebbi <pavan.chebbi@broadcom.com>
Tue, 12 Jul 2022 02:26:18 +0000 (22:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:26 +0000 (21:24 +0200)
commit9fab2c78df53bcb09d91e0e4851078717a83b4de
treea5b3eb5be27f8dfa447ccceaf8707620daaf7c43
parent49dc4548eec3b5409965ad51ad25fac2b2b54e70
bnxt_en: Fix bnxt_refclk_read()

[ Upstream commit 7738c0fd01167141d77583e73417ed77ab60d818 ]

The upper 32-bit PHC register is not latched when reading the lower
32-bit PHC register.  Current code leaves a small window where we may
not read correct higher order bits if the lower order bits are just about
to wrap around.

This patch fixes this by reading higher order bits twice and makes
sure that final value is correctly paired with its lower 32 bits.

Fixes: bd0bd5797b78 ("bnxt_en: Do not read the PTP PHC during chip reset")
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c