Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3835313ybb; Mon, 6 Apr 2020 17:08:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKe0cvFuRXDaJPnvNkqDJw7o2Q5wkGahd9cyeX5kqR5yog7E1PnlrFRMlzQSyMfeAlcTAm7 X-Received: by 2002:aca:c415:: with SMTP id u21mr1570303oif.102.1586218122528; Mon, 06 Apr 2020 17:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586218122; cv=none; d=google.com; s=arc-20160816; b=ceOyI1A6LtC18538STcyZsWXbya4JmKWvR1VnQ8e7fSUq8GL7hhAsbjIgGcyGmtu+N AfBTs+PuXjBi22MriN5+bfdXnqRfpXnvjCNH1wSCWfzbcK3rOhGzqMMQ3REXQX/I139U iqffYIu5xfnu+XBjC2HJfMUbVte0cyeQHr+c2TS2JVlwMBfrm9z/koUtuKN6E7AVKDQP CzukLFjhtxeJjpGYYpPjoZJSQm4JfJFw7htL0Yzsjs3/pAOBIvr5kx6yYsggOc0epfaA H2A+73IqAZeQ7quJ5bAFHja7YLZu09KfArWhKTifK4BlkXxq+hxWVDHhhfnXhQ26Ttj3 XJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VcWQ/PVO0oPYd3gTeAfmzJCfHzslL3qe6WI7TUMu4p8=; b=gLX2UVRPNwD+0bNRnXRJgyhljQVtP9Ap+O4V6Ap1cZXwhaN1/Q8gnKLSWfhA7vT5p5 t+82jvegemsYhgzZx3ngsg1T8UJ5B5Jp9h3fj5qxjCyvpDZBqhvhYyyxeCW5aKcezf+I FNqgwq4/fQBs0OUgfiudbsjOblPOvdOOUIT2nAhTnKgoXcZEsjbhQfBcJgd1Vw97VCI+ tV3ILWKrhsdrlU/zkyQG0qM3V2SFkPXZX6d8wcQEdkdeyUh9qpL67pAGR2CHiEqvyHci XLglkDPkhRrL5tjCgz//+ogjbsvtvswNKZVmZQOvC4xheuX8hm1Wd3c7bzyV/r7P9O78 NUZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iKy1Mfdt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si509530otg.35.2020.04.06.17.08.30; Mon, 06 Apr 2020 17:08:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iKy1Mfdt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbgDGAH7 (ORCPT + 99 others); Mon, 6 Apr 2020 20:07:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727149AbgDGABh (ORCPT ); Mon, 6 Apr 2020 20:01:37 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B1ED207FF; Tue, 7 Apr 2020 00:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586217696; bh=jO0bfRACoDqbJtxtvsGKsvpEltAHBXHauexTK0lbnSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKy1Mfdtd9AXZq8p1jKT/a2Sgs0mGsB2vyC9j4J1dlLyjxkPH3q2T4DhNncPMlbgH 3O+1NFcWja3glfSunvkaukaHULcJS3835rATG2QqJOJYPqDAmT9zf0co39weKNdJlx T2Jv18pkqgV11Yawu1r3VVg65pRENW/Y8dMvWEhE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Raju Rangoju , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.5 30/35] cxgb4/ptp: pass the sign of offset delta in FW CMD Date: Mon, 6 Apr 2020 20:00:52 -0400 Message-Id: <20200407000058.16423-30-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200407000058.16423-1-sashal@kernel.org> References: <20200407000058.16423-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Raju Rangoju [ Upstream commit 50e0d28d3808146cc19b0d5564ef4ba9e5bf3846 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 58a039c3224ad..af1f40cbccc88 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.20.1