]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix PTP capability discovery
authorMichael Chan <michael.chan@broadcom.com>
Sun, 18 Jul 2021 19:36:33 +0000 (15:36 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Jul 2021 15:25:44 +0000 (08:25 -0700)
commit811e6ebb384a7fb93565e45af99232a3482bf831
treef12e6aad89cbc21832143ed8a134473fe462ee81
parent83ca4e2b7785816a8375ee10ecfd48b2c752d6b7
bnxt_en: Fix PTP capability discovery

The current PTP initialization logic does not account for firmware
reset that may cause PTP capability to change.  The valid pointer
bp->ptp_cfg is used to indicate that the device is capable of PTP
and that it has been initialized.  So we must clean up bp->ptp_cfg
and free it if the firmware after reset does not support PTP.

Fixes: 7b8132ee9734 ("bnxt_en: Enable hardware PTP support")
Cc: Richard Cochran <richardcochran@gmail.com>
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