Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp633766pxv; Thu, 15 Jul 2021 12:03:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBb2eCgOgsV7OHzoaz5JZTEGj+AF88dmG4Eitcg7PY2uWcPa4TWIMgiNQMkastOBlrtFA2 X-Received: by 2002:a50:cdcb:: with SMTP id h11mr9121649edj.366.1626375814811; Thu, 15 Jul 2021 12:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375814; cv=none; d=google.com; s=arc-20160816; b=dEk4p6+VPxekUQjzrtsgb9yxaxxxcjISmXBISQ+adc8en6YMXCzyNEkBUZKLH+vAD+ /amh6EiDfS6EFvSuVJrZzSjnzwFy6OxjNOCU4kHBKf7rOLfc7VyPXDK7lLOK++5WAYZ7 9R2gowZOAqZM9bQZa+LDq7P2UKOUEADwnMpSf2od8uuLNdnoIo7b+6EbzpxqKJs/dhzI LaF3Fxbztd7L8qXRrK/STSYJfjkqPfncbW0OeKv6xb7MgkCjsteN8cyKNWnQ6209j1+0 jqPoYOdh/HyLV5H2e6zH+w7d1IKMst4PYq6UPAD23GAQPYCyR2lfWVBg/JXfkTzLWSJQ W1vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BHSI/flgIoa8Y//m5OdyVii/cDGP2MoDQvTiodECrxY=; b=t//OwPR0i1Iy/2NDkICfCJuu95DS5EQru7gcMMx8KwyMIyzAeW/aAN8BrRFNwiJc2y H8LQReMwLuOJq6+qfGGuKddyc6FkddYUtw0c+yl5sQ3Hg8SgJX0OBc5RcwlePdpba4u2 1UGSrurrd4BX4oWqJPHqN2gjxj4pagt1B0Hqyae6p/kp1DUGxwshHWuIz7faRQrDdCZO sUkNoCZwQraj1SMsnM8bXqFlwkV6lWg6yVSr+jJYNIILC2TOtH0MQIo8IWjkxzLrPrkk S7cq89RDBtBB1eN/Dih7K2EpJNZ4IrsYZcZJdkid7SVOpWEj1mqgfb10Txp6Zde3/IZV ghKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MzfqFH0G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si8419567edt.275.2021.07.15.12.03.11; Thu, 15 Jul 2021 12:03:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MzfqFH0G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243600AbhGOTEd (ORCPT + 99 others); Thu, 15 Jul 2021 15:04:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:59616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239944AbhGOSzQ (ORCPT ); Thu, 15 Jul 2021 14:55:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B700613DA; Thu, 15 Jul 2021 18:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375142; bh=+eZ0yTPFBqX/+7MawF+ewYY+p2odJue09D667njTbPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MzfqFH0GCh4xhoYQxC7+UEwlerbzyJy0iyilFRleDYvhjlPIRn1bLKu30P/6Qm2Vo 80g2p+wZiI0OaxZIrBW0SQYfUP+CF7TW87asH7dRPlNmj+frAmJ65yerkf4fqFEtxl FVH+PFBH5601CuoOc1LbcGKLYXwp6PWu0gqvx7Xo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Sergeev , Jesse Brandeburg , Tony Brelinski , Tony Nguyen Subject: [PATCH 5.10 176/215] i40e: fix PTP on 5Gb links Date: Thu, 15 Jul 2021 20:39:08 +0200 Message-Id: <20210715182630.580341150@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jesse Brandeburg commit 26b0ce8dd3dd704393dbace4dc416adfeffe531f upstream. As reported by Alex Sergeev, the i40e driver is incrementing the PTP clock at 40Gb speeds when linked at 5Gb. Fix this bug by making sure that the right multiplier is selected when linked at 5Gb. Fixes: 3dbdd6c2f70a ("i40e: Add support for 5Gbps cards") Cc: stable@vger.kernel.org Reported-by: Alex Sergeev Suggested-by: Alex Sergeev Signed-off-by: Jesse Brandeburg Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c @@ -11,13 +11,14 @@ * operate with the nanosecond field directly without fear of overflow. * * Much like the 82599, the update period is dependent upon the link speed: - * At 40Gb link or no link, the period is 1.6ns. - * At 10Gb link, the period is multiplied by 2. (3.2ns) + * At 40Gb, 25Gb, or no link, the period is 1.6ns. + * At 10Gb or 5Gb link, the period is multiplied by 2. (3.2ns) * At 1Gb link, the period is multiplied by 20. (32ns) * 1588 functionality is not supported at 100Mbps. */ #define I40E_PTP_40GB_INCVAL 0x0199999999ULL #define I40E_PTP_10GB_INCVAL_MULT 2 +#define I40E_PTP_5GB_INCVAL_MULT 2 #define I40E_PTP_1GB_INCVAL_MULT 20 #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1 BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT) @@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_ case I40E_LINK_SPEED_10GB: mult = I40E_PTP_10GB_INCVAL_MULT; break; + case I40E_LINK_SPEED_5GB: + mult = I40E_PTP_5GB_INCVAL_MULT; + break; case I40E_LINK_SPEED_1GB: mult = I40E_PTP_1GB_INCVAL_MULT; break;