]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Do not read the PTP PHC during chip reset
authorMichael Chan <michael.chan@broadcom.com>
Wed, 28 Jul 2021 18:11:41 +0000 (14:11 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Jul 2021 19:23:33 +0000 (20:23 +0100)
commitbd0bd5797b78175e8c7a6c7f55b75f600d159adb
tree125faec5891cfff27c19b3003f28eb6e49d26d8f
parentc2d1fa62b37e352b0cfb732ef7eb9364b3dfcdc2
bnxt_en: Do not read the PTP PHC during chip reset

During error recovery or hot firmware upgrade, the chip may be under
reset and the PHC register read cycles may cause completion timeouts.
Check that the chip is not under reset condition before proceeding
to read the PHC by checking the flag BNXT_STATE_IN_FW_RESET.  We also
need to take the ptp_lock before we set this flag to prevent race
conditions.

We need this logic because the PHC now will stay registered after
bnxt_close().

Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c