netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] cxgb4/ptp: pass the sign of offset delta in FW CMD
@ 2020-03-24 11:40 Raju Rangoju
  2020-03-24 23:24 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Raju Rangoju @ 2020-03-24 11:40 UTC (permalink / raw)
  To: davem, netdev; +Cc: vishal, nirranjan, dt, rajur

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 <rajur@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
index 58a039c3224a..af1f40cbccc8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
@@ -246,6 +246,9 @@ static int  cxgb4_ptp_fineadjtime(struct adapter *adapter, s64 delta)
 			     FW_PTP_CMD_PORTID_V(0));
 	c.retval_len16 = cpu_to_be32(FW_CMD_LEN16_V(sizeof(c) / 16));
 	c.u.ts.sc = FW_PTP_SC_ADJ_FTIME;
+	c.u.ts.sign = (delta < 0) ? 1 : 0;
+	if (delta < 0)
+		delta = -delta;
 	c.u.ts.tm = cpu_to_be64(delta);
 
 	err = t4_wr_mbox(adapter, adapter->mbox, &c, sizeof(c), NULL);
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] cxgb4/ptp: pass the sign of offset delta in FW CMD
  2020-03-24 11:40 [PATCH net] cxgb4/ptp: pass the sign of offset delta in FW CMD Raju Rangoju
@ 2020-03-24 23:24 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-24 23:24 UTC (permalink / raw)
  To: rajur; +Cc: netdev, vishal, nirranjan, dt

From: Raju Rangoju <rajur@chelsio.com>
Date: Tue, 24 Mar 2020 17:10:00 +0530

> 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 <rajur@chelsio.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-24 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 11:40 [PATCH net] cxgb4/ptp: pass the sign of offset delta in FW CMD Raju Rangoju
2020-03-24 23:24 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).