Re: [PATCH net 8/9] bnxt_en: Move bnxt_ptp_init() to bnxt_open()
From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-07-19 10:43:31
From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-07-19 10:43:31
On Sun, 18 Jul 2021 15:36:32 -0400, Michael Chan wrote:
The device needs to be in ifup state for PTP to function, so move bnxt_ptp_init() to bnxt_open(). This means that the PHC will be registered during bnxt_open().
I think it's an anti-pattern to have the clock registered only when the device is up. Right, Richard? IIRC Intel parts did it in the past because they had the clock hooked up to the MAC/PHY so the clock was not actually ticking. But seems like a wrong trade off to unreg PTP for SW convenience. Or maybe I'm biased against the live FW reset :) Let's see if Richard agrees.
This also makes firmware reset work correctly. PTP configurations may change after firmware upgrade or downgrade. bnxt_open() will be called after firmware reset, so it will work properly. bnxt_ptp_start() is now incorporated into bnxt_ptp_init(). We now also need to call bnxt_ptp_clear() in bnxt_close().