]> 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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Jul 2022 03:35:56 +0000 (20:35 -0700)
commit7738c0fd01167141d77583e73417ed77ab60d818
tree7b494232cb656a66fa43d8a449e4e5ee7171d258
parent816e6a8787bef9e63c3519e0584664fc910cc0f9
bnxt_en: Fix bnxt_refclk_read()

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>
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c