Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp696673pxx; Thu, 29 Oct 2020 12:11:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTFuBuv5t+9ELhJKzjC6B7dpx7d0AlqfMCYyDoBLsoIQ5F/0pTs/bXURD+bRjwPcO+qRKc X-Received: by 2002:a17:906:a119:: with SMTP id t25mr5923086ejy.67.1603998687973; Thu, 29 Oct 2020 12:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603998687; cv=none; d=google.com; s=arc-20160816; b=Yv8H73uCuV97XTXw19A4JMmxvFkOTTVlkHB7z7TEd3HNKVjtlmIshcASdw0lJu0iuC IuK45jLmrujlh3UdciMpePImZQODpiurK4So14zKP4IvF5eZXS73sag62H7UUfdz52Go 4nerlRa8GdasOAhA2qeT9RLaOXmAVuVmLviN5KIeFkWALuOlpWRPFYCAHylxe8vsU6IL 0NXIbVBOt5Yel6X8KIP/jHgAlcmehGEEwq0WAzSdF/XuBC8vgFnWgp/Gxk8r8XmWFFHQ Yrhk4KOUgXb9vNVx4tHnaScd7ve6GeiC/kyUK6cyP1N1NOfatE5VL9U7bE45xh9GyHzj tb4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=98LQ/K/4JWA4RQGtsstxjKLqHusEqhxMQVJCpeQvN10=; b=nyEZIaButHfvFJdj5UhoNiMHTBVCueS0tn4vgLOp+Jh3qfI73cEdlXZPeAJbo5HbbM 41ckZAWSM+w6kOCLCdNQDQluUYkvqq/Qkr16ILuElGzSkUuIhTAo2sJAI/IeCgLrKFuJ i3gHy3wBqjkGLxqEj1L9Z8tCAPDOkT4L0pWYDWp0QRVlpu1cb4Ha9hOEGa/NW2jazaNv RPc09vK37WD3Pt6nnJ7lm65CvljPMc1xNL11e3d+vtBPI3O0BJ8ZUYk854ofAEvdudGi MwAD9Q8z48j0Dfqqov/59xkn1CruLql60F0OCOayhHBoxAFBUEcuTMxyzkf6yaovlLH+ tlhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fXaqcHV2; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si2619409ejj.86.2020.10.29.12.11.02; Thu, 29 Oct 2020 12:11:27 -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=@ti.com header.s=ti-com-17Q1 header.b=fXaqcHV2; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725863AbgJ2TJg (ORCPT + 99 others); Thu, 29 Oct 2020 15:09:36 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:58626 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbgJ2TJf (ORCPT ); Thu, 29 Oct 2020 15:09:35 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 09TJ9AYE086622; Thu, 29 Oct 2020 14:09:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1603998550; bh=98LQ/K/4JWA4RQGtsstxjKLqHusEqhxMQVJCpeQvN10=; h=From:To:CC:Subject:Date; b=fXaqcHV29wwJ/Z2yafPDiBzOT7CUhLr+Pv0eD5pnDoxDeRi99mjSoyJlgUn1/12qH aTiu5GD8Z0ltj63WeIEE/ZH/gnQQdy0tVBhWqXPm5DJZIeVOo1VhKbQK6DY1J5MuIU 2w74HG/dfb7AkiDvYgCiXvv5+g7NpUeFziHA/vFo= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 09TJ9Aj8118103 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 29 Oct 2020 14:09:10 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 29 Oct 2020 14:09:10 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 29 Oct 2020 14:09:10 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 09TJ99s1083876; Thu, 29 Oct 2020 14:09:09 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski , Vignesh Raghavendra CC: Sekhar Nori , , , Grygorii Strashko Subject: [PATCH] net: ethernet: ti: cpsw: disable PTPv1 hw timestamping advertisement Date: Thu, 29 Oct 2020 21:09:10 +0200 Message-ID: <20201029190910.30789-1-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The TI CPTS does not natively support PTPv1, only PTPv2. But, as it happens, the CPTS can provide HW timestamp for PTPv1 Sync messages, because CPTS HW parser looks for PTP messageType id in PTP message octet 0 which value is 0 for PTPv1. As result, CPTS HW can detect Sync messages for PTPv1 and PTPv2 (Sync messageType = 0 for both), but it fails for any other PTPv1 messages (Delay_req/resp) and will return PTP messageType id 0 for them. The commit e9523a5a32a1 ("net: ethernet: ti: cpsw: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter") added PTPv1 hw timestamping advertisement by mistake, only to make Linux Kernel "timestamping" utility work, and this causes issues with only PTPv1 compatible HW/SW - Sync HW timestamped, but Delay_req/resp are not. Hence, fix it disabling PTPv1 hw timestamping advertisement, so only PTPv1 compatible HW/SW can properly roll back to SW timestamping. Fixes: e9523a5a32a1 ("net: ethernet: ti: cpsw: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter") Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw_ethtool.c | 1 - drivers/net/ethernet/ti/cpsw_priv.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw_ethtool.c b/drivers/net/ethernet/ti/cpsw_ethtool.c index 4d02c5135611..4619c3a950b0 100644 --- a/drivers/net/ethernet/ti/cpsw_ethtool.c +++ b/drivers/net/ethernet/ti/cpsw_ethtool.c @@ -728,7 +728,6 @@ int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) (1 << HWTSTAMP_TX_ON); info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) | - (1 << HWTSTAMP_FILTER_PTP_V1_L4_EVENT) | (1 << HWTSTAMP_FILTER_PTP_V2_EVENT); return 0; } diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c index 51cc29f39038..31c5e36ff706 100644 --- a/drivers/net/ethernet/ti/cpsw_priv.c +++ b/drivers/net/ethernet/ti/cpsw_priv.c @@ -639,13 +639,10 @@ static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr) break; case HWTSTAMP_FILTER_ALL: case HWTSTAMP_FILTER_NTP_ALL: - return -ERANGE; case HWTSTAMP_FILTER_PTP_V1_L4_EVENT: case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: - priv->rx_ts_enabled = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; - cfg.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; - break; + return -ERANGE; case HWTSTAMP_FILTER_PTP_V2_L4_EVENT: case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: -- 2.17.1