bnxt_en: Move bnxt_ptp_init() from bnxt_open() back to bnxt_init_one()
authorMichael Chan <michael.chan@broadcom.com>
Wed, 28 Jul 2021 18:11:40 +0000 (14:11 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Jul 2021 19:23:33 +0000 (20:23 +0100)
commita521c8a01d267bc1732ee83fdbf3ad2e02240d63
treee001a4207a4540facb629a7d06b75ccf29e480bd
parent63caca1e3ef6e5ff53f97b41f03ec2805cca1e2b
bnxt_en: Move bnxt_ptp_init() from bnxt_open() back to bnxt_init_one()

It was pointed out by Richard Cochran that registering the PHC during
probe is better than during ifup, so move bnxt_ptp_init() back to
bnxt_init_one().  In order to work correctly after firmware reset which
may result in PTP config. changes, we modify bnxt_ptp_init() to return
if the PHC has been registered earlier.  If PTP is no longer supported
by the new firmware, we will unregister the PHC and clean up.

This partially reverts:

d7859afb6880 ("bnxt_en: Move bnxt_ptp_init() to bnxt_open()")

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