bnxt_en: reset PHC frequency in free-running mode
PATCH v4 1/1 bnxt_en: reset PHC frequency in free-running mode
When using a PHC in shared between multiple hosts, the previous frequency value may not be reset and could lead to host being unable to compensate the offset with timecounter adjustments. To avoid such state reset the hardware frequency of PHC to zero on init. Some refactoring is needed to make code readable.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 + drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 56 ++++++++++--------- 3 files changed, 35 insertions(+), 29 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -4
@@ -6990,11 +6990,9 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp)if (flags &FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED ) bp->fw_cap |=BNXT_FW_CAP_DCBX_AGENT ; } -if (BNXT_PF (bp) && (flags &FUNC_QCFG_RESP_FLAGS_MULTI_HOST )) { +if (BNXT_PF (bp) && (flags &FUNC_QCFG_RESP_FLAGS_MULTI_HOST )) bp->flags |=BNXT_FLAG_MULTI_HOST ; -if (bp->fw_cap &BNXT_FW_CAP_PTP_RTC ) - bp->fw_cap &= ~BNXT_FW_CAP_PTP_RTC ; - } +if (flags &FUNC_QCFG_RESP_FLAGS_RING_MONITOR_ENABLED ) bp->fw_cap |=BNXT_FW_CAP_RING_MONITOR ;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +2 -0
@@ -2000,6 +2000,8 @@ struct bnxt {u32 fw_dbg_cap;#define BNXT_NEW_RM (bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM) +#define BNXT_PTP_USE_RTC (bp) (!BNXT_MH(bp) && \ + ((bp)->fw_cap & BNXT_FW_CAP_PTP_RTC))u32 hwrm_spec_code;u16 hwrm_cmd_seq;u16 hwrm_cmd_kong_seq;
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +31 -25
99 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 10 lines · Vadim Fedorenko
When using a PHC in shared between multiple hosts, the previous frequency value may not be reset and could lead to host being unable to compensate the offset with timecounter adjustments. To avoid such state reset the hardware frequency of PHC to zero on init. Some refactoring is needed to make code readable.
Fixes 85036aee1938 ("bnxt_en: Add a non-real time mode to access NIC clock")Signed-off-by Vadim Fedorenko <[email protected]>---
Thank you.
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Fri, 10 Mar 2023 07:13:56 -0800 you wrote:
When using a PHC in shared between multiple hosts, the previous frequency value may not be reset and could lead to host being unable to compensate the offset with timecounter adjustments. To avoid such state reset the hardware frequency of PHC to zero on init. Some refactoring is needed to make code readable.
Fixes 85036aee1938 ("bnxt_en: Add a non-real time mode to access NIC clock")Signed-off-by Vadim Fedorenko <[email protected]>[...]
Here is the summary with links:
- [net,v4] bnxt_en: reset PHC frequency in free-running mode
https://git.kernel.org/netdev/net/c/131db4991622
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html