Received: by 10.213.65.68 with SMTP id h4csp2113228imn; Sun, 8 Apr 2018 20:03:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx48TaIIvZayk2SJipTtdcFVnrA/BsNuYZAV/fbXzNSXEft41312j2Dwxoi9uIU3X3QoH/jxl X-Received: by 2002:a17:902:4225:: with SMTP id g34-v6mr37627192pld.297.1523242991627; Sun, 08 Apr 2018 20:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242991; cv=none; d=google.com; s=arc-20160816; b=B/OWweXyXZu7/tDj95Ty0fBuM24Nh6KGW66wsznV1g048Hm+Tt8sQMZt3VD7XpiZKt oiavzsn5Knl1Nn7geaqd5a4N/7rx5iEjHzOhhtOjDNYw/BckBlM6rgW9RKNC8mKuif8M kghSN/64tvnPSIEC5CIKAGXLCQ7+Th5DHKM3N9vsmVaw2C6mmDQI1C9b9hOV84R2NpVY cgoDTgxrEdToJa+ZiZdnCwiG5hhJnRhvKiqzudLKEqmPSUU5aUsnsE1SAXLmFYkY6SP+ ebPfT1YovNzwYKZB2vdMZwi+dFfcogXVqb2tcb6IpQK3us7K9tLfDd++BUWh1W1quSKU fC0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=HmxERGSuezbB9tIc0D81Hc6U3yuTk4J2ST99XQk8t+E=; b=atBbI+IImcjpmWgBflHbkhlCog8sadCyI/F4mz6Opq0JUgkdLD2pBWwOAoGjsXvlZq fEMPchljc12JlIxYgMphigW4e5wZYkill3h6WmuDdpV+iLjBJEbxtRh/HGiO0idN4yBs 9uLKhBEFGz9qVyPNp7uqpDkWXIo8mJJyVEzeMxlkoyx8e4I5qVquJbwERdk3zlredcUx geg3Y05b7SKQ5JJsFc7DDdk+iiwsfQR/XLu2L7eoxiu8mN2HjpLDV0YcR+BJdgbQyXKR kKGVIZLaBUd8f3eBOCfzNDV2fBU7DU2VipQgWoKMd4Pk/rxoU4fZxBDN62GlkskK/gvo nYtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=AcxP9V9H; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14-v6si15377881plk.706.2018.04.08.20.02.34; Sun, 08 Apr 2018 20:03:11 -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=@microsoft.com header.s=selector1 header.b=AcxP9V9H; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754680AbeDIA1C (ORCPT + 99 others); Sun, 8 Apr 2018 20:27:02 -0400 Received: from mail-by2nam03on0133.outbound.protection.outlook.com ([104.47.42.133]:46250 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754647AbeDIA0u (ORCPT ); Sun, 8 Apr 2018 20:26:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HmxERGSuezbB9tIc0D81Hc6U3yuTk4J2ST99XQk8t+E=; b=AcxP9V9HNr5Mcybypo9ZVGScXvyAkUNKdrcilbaAuGMdUVSku8CMwr8Z/Y/9GuVAVTtJRSH6TpeuRpHjO+5SoBM1WYz9TRMEqwK8PY+bJAIykWvu9A00h0zpcKPcMiHOD/X9htUmG1ob2bHk3BO60jX7ppu906IT8z3kSl+w1dQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:43 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:43 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mario Molitor , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 023/293] stmmac: fix ptp header for GMAC3 hw timestamp Thread-Topic: [PATCH AUTOSEL for 4.9 023/293] stmmac: fix ptp header for GMAC3 hw timestamp Thread-Index: AQHTz5jvtd+9hZey4Ee/y9MqytTWrQ== Date: Mon, 9 Apr 2018 00:23:07 +0000 Message-ID: <20180409002239.163177-23-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0885;7:MHTWkjoViM6v4yugeNdS2sF14P7mSAd3LjV/wEGp/gLgL4MQtGnRz+mTZVSCkVlnDY6C1mdvqMdHbtBUpcCWSDY80zJCkc3oAc9de0lVyyOUfScfhnMMKEUjfC0H3tH7MUNaOiuFa94Le30MjRTQTxCkICw/dOelrr9F+6ZISB7vE91TOspR5QUfi7+AipOCdnnJOvM0xxUSYTEwPSXEsCOr4HY2JsyktOaCROiZ8HHoygzqdrWn4r9u37i8ubGd;20:ZK86enE+U6VLv/RB5K351ZlAFxWg5+ABRibG4ajUAhWyFUF9MEylO/CdZGrKIL4/zCreyZ0GA98telfn8nJ/egFraEqtY4+TiRzGSXGHa/KBJ1QYwi9Dfpsz0p+wpxK1FSmJbg+6aFqn60Gc5agToi+SPyp35YWt6zxuyWsiwMk= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 4b7c4461-3682-4ae6-edc8-08d59db0920b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(245156298449039); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0885;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0885; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(396003)(39380400002)(189003)(199004)(2906002)(68736007)(22452003)(316002)(6512007)(5660300001)(6666003)(54906003)(110136005)(486006)(6486002)(102836004)(36756003)(14454004)(99286004)(86612001)(105586002)(72206003)(106356001)(2900100001)(1076002)(97736004)(10090500001)(3280700002)(5250100002)(6436002)(3660700001)(6116002)(575784001)(3846002)(305945005)(86362001)(59450400001)(66066001)(10290500003)(186003)(81166006)(8936002)(478600001)(476003)(25786009)(81156014)(8676002)(4326008)(7736002)(2501003)(107886003)(6506007)(2616005)(26005)(76176011)(446003)(53936002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0885;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: cTWsmG9U2ueAQ8UL3WeozykWO5qkvsMW3FaaBICoa+2Jt9TmJNGoaCh1G71XmHPqGHOxelCf+6+5RiZEObqkobBjfAFqQv6zNUS6xUYv174aNt8fhpPOxAc+975qkfcTiJxMVzuwh9Xt9qtGVAf/Ny7Tmrg6QYvQtKkulO+Uox63y4wwhf2E2A66a/jV6p4DCB3zPYoZHgQJig4XRcmZT/wb1x/eZZ2zwF2PY3pWyRjE1HcWPUNSq6yvzFxc5iBS4vX2QNu/FnzwMyg1nkSmLYdLMn2Pb8wwA5EgTAInC9YerOjn5XCXTr+EcVzrU0v7zCSZGbknDxIH7NfEPsc9IqDUz3JuypqEs4wbOEXR95tZju/EmYsdFFikvqTvyt4XX2vITfcZENMbYJh2r5HKzSCT2YnMArTYCXf+3f+i/mg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b7c4461-3682-4ae6-edc8-08d59db0920b X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:07.9873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 98bbb91336e4..c212d1dd8bfd 100644 --- 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 net_device *de= v, struct ifreq *ifr) /* PTP v1, UDP, any kind of event packet */ config.rx_filter =3D HWTSTAMP_FILTER_PTP_V1_L4_EVENT; /* take time stamp for all event messages */ - snap_type_sel =3D PTP_TCR_SNAPTYPSEL_1; + if (priv->plat->has_gmac4) + snap_type_sel =3D PTP_GMAC4_TCR_SNAPTYPSEL_1; + else + snap_type_sel =3D PTP_TCR_SNAPTYPSEL_1; =20 ptp_over_ipv4_udp =3D PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp =3D PTP_TCR_TSIPV6ENA; @@ -510,7 +513,10 @@ static int stmmac_hwtstamp_ioctl(struct net_device *de= v, struct ifreq *ifr) config.rx_filter =3D HWTSTAMP_FILTER_PTP_V2_L4_EVENT; ptp_v2 =3D PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ - snap_type_sel =3D PTP_TCR_SNAPTYPSEL_1; + if (priv->plat->has_gmac4) + snap_type_sel =3D PTP_GMAC4_TCR_SNAPTYPSEL_1; + else + snap_type_sel =3D PTP_TCR_SNAPTYPSEL_1; =20 ptp_over_ipv4_udp =3D PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp =3D PTP_TCR_TSIPV6ENA; @@ -544,7 +550,10 @@ static int stmmac_hwtstamp_ioctl(struct net_device *de= v, struct ifreq *ifr) config.rx_filter =3D HWTSTAMP_FILTER_PTP_V2_EVENT; ptp_v2 =3D PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ - snap_type_sel =3D PTP_TCR_SNAPTYPSEL_1; + if (priv->plat->has_gmac4) + snap_type_sel =3D PTP_GMAC4_TCR_SNAPTYPSEL_1; + else + snap_type_sel =3D PTP_TCR_SNAPTYPSEL_1; =20 ptp_over_ipv4_udp =3D PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp =3D PTP_TCR_TSIPV6ENA; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net= /ethernet/stmicro/stmmac/stmmac_ptp.h index c06938c47af5..174777cd888e 100644 --- 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) =20 --=20 2.15.1