Received: by 10.192.165.156 with SMTP id m28csp1104753imm; Wed, 11 Apr 2018 12:30:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/E2CDsjNDOBkL2yRf7J3cLxkJ22zlXNkI6Jp0t587L7D55XyDWEdcBBOOZ61Z3x8HLWRDH X-Received: by 10.98.11.144 with SMTP id 16mr5088186pfl.228.1523475015686; Wed, 11 Apr 2018 12:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523475015; cv=none; d=google.com; s=arc-20160816; b=LbaYu+G8SweNLnzb9AuTGZr7/9aho1NVdbh/Jqw2j08V4hd1WH78LpToxcztlP94tG EIZ5RHzoP6CA6BCZnq9RDB4RuXSPq2MAmpBNoDFzU3lxq/c5bX5R4wDyW6SDL+SzOLOm 6EinqAD1h+auFBJEDtFW/hDmOYpLRevvLvZKUx5MgBzkkIAIhq9KWYKr+en8ouweGOXU Dy983ZhG7tq9+z5jBcOkcqng4uRMzcl54IeyJR+TAjo+7JQohMf2iAy8IaoO85Vksgi9 Re2WwpGi19Nr2bI34Q5OJqG2GOz4DLG2hG1UAaN1L+Gki4+DlNRUjAuRgwyPkMiLMYOd Zetg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Vb4v2lAC9KmCu5bMuCaTCaoNNdAEOIFuILyywHKKnw8=; b=GgEV6SoY6C5CU62Zd+JGYhfe5NAWmmC9M8IldxXd3S5JGXMoJkfDyywK/7zCa6CFbL 68Qg+YJamUfMqsGkOG8XeDipk6xrHfD6mSEZgbnJxqRe8yrlcnhYWR5XxvBjKVbQqXRP 06oUjU+F/zTIVARtFTRIwqeE+hVULn9oZTfULGyrVnZoHfUZehw89ep19lqLdpcIlCmp Olfk2n+vdWLdMAZ8p1r6ym3iMckqTp29XCsY1By9EtMKl0ibld3QStWD34bg4ryM/L2F 3BsHXotO1+OlAAHDCi19y0TzfPYxWPvcfaVhASOsa85vdO7p2eXef9GKsrx8G0GJ0vEx A5vQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si1116204pgc.265.2018.04.11.12.29.38; Wed, 11 Apr 2018 12:30:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934638AbeDKTDS (ORCPT + 99 others); Wed, 11 Apr 2018 15:03:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38862 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934625AbeDKTDP (ORCPT ); Wed, 11 Apr 2018 15:03:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B5A6AE42; Wed, 11 Apr 2018 19:03:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Molitor , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 232/310] stmmac: fix ptp header for GMAC3 hw timestamp Date: Wed, 11 Apr 2018 20:36:11 +0200 Message-Id: <20180411183632.489154920@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mario Molitor [ Upstream commit fd6720aefde06eacf17404eed2cad65c6ec103e1 ] According the CYCLON V documention only the bit 16 of snaptypesel should set. (more information see Table 17-20 (cv_5v4.pdf) : Timestamp Snapshot Dependency on Register Bits) Fixes: d2042052a0aa ("stmmac: update the PTP header file") Signed-off-by: Mario Molitor Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 15 ++++++++++++--- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -478,7 +478,10 @@ static int stmmac_hwtstamp_ioctl(struct /* PTP v1, UDP, any kind of event packet */ config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; /* take time stamp for all event messages */ - snap_type_sel = PTP_TCR_SNAPTYPSEL_1; + if (priv->plat->has_gmac4) + snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; + else + snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA; @@ -510,7 +513,10 @@ static int stmmac_hwtstamp_ioctl(struct config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ - snap_type_sel = PTP_TCR_SNAPTYPSEL_1; + if (priv->plat->has_gmac4) + snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; + else + snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA; @@ -544,7 +550,10 @@ static int stmmac_hwtstamp_ioctl(struct config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ - snap_type_sel = PTP_TCR_SNAPTYPSEL_1; + if (priv->plat->has_gmac4) + snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; + else + snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA; --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h @@ -63,7 +63,8 @@ /* Enable Snapshot for Messages Relevant to Master */ #define PTP_TCR_TSMSTRENA BIT(15) /* Select PTP packets for Taking Snapshots */ -#define PTP_TCR_SNAPTYPSEL_1 GENMASK(17, 16) +#define PTP_TCR_SNAPTYPSEL_1 BIT(16) +#define PTP_GMAC4_TCR_SNAPTYPSEL_1 GENMASK(17, 16) /* Enable MAC address for PTP Frame Filtering */ #define PTP_TCR_TSENMACADDR BIT(18)