Skip to content

Commit b673ccb

Browse files
committed
bnxt_en: Refactor bnxt_ptp_init()
jira LE-2522 Rebuild_History Non-Buildable kernel-5.14.0-503.29.1.el9_5 commit-author Michael Chan <[email protected]> commit 1e9614c Instead of passing the 2nd parameter phc_cfg to bnxt_ptp_init(). Store it in bp->ptp_cfg so that the caller doesn't need to know what the value should be. In the next patch, we'll need to call bnxt_ptp_init() in bnxt_resume() and this will make it easier. Reviewed-by: Somnath Kotur <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> (cherry picked from commit 1e9614c) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 85485c7 commit b673ccb

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8272,7 +8272,6 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
82728272
struct hwrm_port_mac_ptp_qcfg_output *resp;
82738273
struct hwrm_port_mac_ptp_qcfg_input *req;
82748274
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
8275-
bool phc_cfg;
82768275
u8 flags;
82778276
int rc;
82788277

@@ -8315,8 +8314,9 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
83158314
rc = -ENODEV;
83168315
goto exit;
83178316
}
8318-
phc_cfg = (flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
8319-
rc = bnxt_ptp_init(bp, phc_cfg);
8317+
ptp->rtc_configured =
8318+
(flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
8319+
rc = bnxt_ptp_init(bp);
83208320
if (rc)
83218321
netdev_warn(bp->dev, "PTP initialization failed.\n");
83228322
exit:

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ static void bnxt_ptp_free(struct bnxt *bp)
922922
}
923923
}
924924

925-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
925+
int bnxt_ptp_init(struct bnxt *bp)
926926
{
927927
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
928928
int rc;
@@ -944,7 +944,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
944944

945945
if (BNXT_PTP_USE_RTC(bp)) {
946946
bnxt_ptp_timecounter_init(bp, false);
947-
rc = bnxt_ptp_init_rtc(bp, phc_cfg);
947+
rc = bnxt_ptp_init_rtc(bp, ptp->rtc_configured);
948948
if (rc)
949949
goto out;
950950
} else {

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ struct bnxt_ptp_cfg {
115115
BNXT_PTP_MSG_PDELAY_REQ | \
116116
BNXT_PTP_MSG_PDELAY_RESP)
117117
u8 tx_tstamp_en:1;
118+
u8 rtc_configured:1;
118119
int rx_filter;
119120
u32 tstamp_filters;
120121

@@ -145,6 +146,6 @@ int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb);
145146
int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts);
146147
void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns);
147148
int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg);
148-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg);
149+
int bnxt_ptp_init(struct bnxt *bp);
149150
void bnxt_ptp_clear(struct bnxt *bp);
150151
#endif

0 commit comments

Comments
 (0)