Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3284087pxj; Tue, 1 Jun 2021 01:30:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnbjN+vmc2R9gA3W4d+F7Al1mIXWCWDjx9JI7o8VWtjfVicl6JdjKWXd6M9h/ocz1V6rsy X-Received: by 2002:a17:906:3181:: with SMTP id 1mr28458974ejy.36.1622536213609; Tue, 01 Jun 2021 01:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622536213; cv=none; d=google.com; s=arc-20160816; b=LMY36QWolHdiV7tEfN6gleDKNeUbOp7U22J4vlSCBdB1F9r0vc/8ncNTj1QwWVk/wG UpMoHU+2rXCrZMRy6BEhRjipgh0XZtWLDKN/T/n6yWcjvl0hTAtLRyDqYhLxIhA4NI8q DDdMi9u0qsCkKfxXZqjc58iX3wSblaaDrR0zmZDrnv6fChASeOq8FiWLTHvsyvKonVTM vvzRzqCVb+ZnuDnVMPiQrL3fZljFvj6XFegKceT/5AUHmX9O23jAjmDbZwlLsoLz3ADq qHMZzRm1r4UHulWJHXSz/KDBCahqTCaBjVskdxi4pI22Ef4AXA810AttM7fF9brwWeHn YSMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dkim-filter :dkim-signature:dkim-filter; bh=vWCv+MeGTvvz1WVA73qZXjvvuHB4aTe/cxgc3hg+kwE=; b=0CzDZ42sjnnpIL+nRQUk8kKwJku6Naknbx3hmJbdz9ZA7JuPjjT0T44NlWzjb9ViNl jsPW/ZJQzdzzxOBGgv4/UgbIsjaV7pCzWBI3z6Mr2q0BHr6dm/9XrXBNlx6KtrRTvqlk 7W4OaGzW3iaz0yoJAXqH51y3D0GODiKYzsC6vcJGxySi7CO7ZT8pv5S8LCl+Y3CyHnyB P66Uvs8E/wkK/KNFRdyWtJ/bFkHi6WqB7yLZAAMkm+RA26xISyyyA8Zu9NVHyBdFiOMs tkMpEzA1MrSc6Uq6xeZkgeVDSzKcV6LP4WFDhoP2lUuoT1O8xPXiUrmAqEl3JU8Tqm5i r/GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=nselector3 header.b=VG9n6A0R; 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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si18852087edj.72.2021.06.01.01.29.50; Tue, 01 Jun 2021 01:30:13 -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=@nxp.com header.s=nselector3 header.b=VG9n6A0R; 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233409AbhFAIaa (ORCPT + 99 others); Tue, 1 Jun 2021 04:30:30 -0400 Received: from inva020.nxp.com ([92.121.34.13]:46876 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232963AbhFAIa3 (ORCPT ); Tue, 1 Jun 2021 04:30:29 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B06841A3C1C; Tue, 1 Jun 2021 10:28:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 inva020.eu-rdc02.nxp.com B06841A3C1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=nselector3; t=1622536127; bh=vWCv+MeGTvvz1WVA73qZXjvvuHB4aTe/cxgc3hg+kwE=; h=From:To:Cc:Subject:Date:From; b=VG9n6A0RyiNUtHUejUzAqLT6FnL31SuW+5En8RdNlio7+Y0PmJ3tVfjJalxhgLygs G/xxWi3y0zAfVgCJycJnYYtViDyjbbQVucutgzgGxk2xpy1kfOBC3wgO9q1POWYg7C ZHsgS0oGff0HFORc9UGDQ05MKhzocTfeBo7/x7JmTz2a8gajtJPOknYugnFjhWw7wE izxOkhL1zmzsHMnTHvB9KoYRgrpF9BXVrEtTN+86L7YWB0Cm5WQt6D41vmIPdNbTg5 HQceHZ3s+/lic1fx1PkR2z9tH37P/sq9tdtxkuF8rcxrV4FhzqZ1ZOdkd8Y03YYuyj Q2Y95HtdTmlog== Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7C5FE1A3C23; Tue, 1 Jun 2021 10:28:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 inva020.eu-rdc02.nxp.com 7C5FE1A3C23 Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 75AF2402E9; Tue, 1 Jun 2021 16:28:28 +0800 (+08) From: Xiaoliang Yang To: davem@davemloft.net, joabreu@synopsys.com, kuba@kernel.org, alexandre.torgue@st.com, peppe.cavallaro@st.com, mcoquelin.stm32@gmail.com Cc: netdev@vger.kernel.org, boon.leong.ong@intel.com, weifeng.voon@intel.com, vee.khee.wong@intel.com, tee.min.tan@intel.com, mohammad.athari.ismail@intel.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, leoyang.li@nxp.com, vladimir.oltean@nxp.com, qiangqing.zhang@nxp.com, rui.sousa@nxp.com, mingkai.hu@nxp.com, yangbo.lu@nxp.com, xiaoliang.yang_1@nxp.com Subject: [PATCH v1 net-next 0/3] net: stmmac: re-configure tas basetime after ptp time adjust Date: Tue, 1 Jun 2021 16:38:10 +0800 Message-Id: <20210601083813.1078-1-xiaoliang.yang_1@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the DWMAC Ethernet device has already set the Qbv EST configuration before using ptp to synchronize the time adjustment, the Qbv base time may change to be the past time of the new current time. This is not allowed by hardware. This patch calculates and re-configures the Qbv basetime after ptp time adjustment. Xiaoliang Yang (3): net: stmmac: separate the tas basetime calculation function net: stmmac: add mutex lock to protect est parameters net: stmmac: ptp: update tas basetime after ptp adjust drivers/net/ethernet/stmicro/stmmac/stmmac.h | 3 ++ .../net/ethernet/stmicro/stmmac/stmmac_ptp.c | 41 ++++++++++++++++- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 46 +++++++++++++------ include/linux/stmmac.h | 1 + 4 files changed, 77 insertions(+), 14 deletions(-) -- 2.17.1