Skip to content

Commit 50e0d28

Browse files
RajuRangojudavem330
authored andcommitted
cxgb4/ptp: pass the sign of offset delta in FW CMD
cxgb4_ptp_fineadjtime() doesn't pass the signedness of offset delta in FW_PTP_CMD. Fix it by passing correct sign. Signed-off-by: Raju Rangoju <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e80f40c commit 50e0d28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ static int cxgb4_ptp_fineadjtime(struct adapter *adapter, s64 delta)
246246
FW_PTP_CMD_PORTID_V(0));
247247
c.retval_len16 = cpu_to_be32(FW_CMD_LEN16_V(sizeof(c) / 16));
248248
c.u.ts.sc = FW_PTP_SC_ADJ_FTIME;
249+
c.u.ts.sign = (delta < 0) ? 1 : 0;
250+
if (delta < 0)
251+
delta = -delta;
249252
c.u.ts.tm = cpu_to_be64(delta);
250253

251254
err = t4_wr_mbox(adapter, adapter->mbox, &c, sizeof(c), NULL);

0 commit comments

Comments
 (0)