From patchwork Tue Aug 1 15:44:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Zink X-Patchwork-Id: 13336970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 745C6C001DF for ; Tue, 1 Aug 2023 15:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TO5lz5EoUL6+ANDNLRumN5s6qyGFle6uCeqejNRZavI=; b=g5Jd4/VDTJ5cUJ zXk5gLIGZoDpr0HUrDnzBQAJGMCVgsfhfvbTsTMdmdLT0jRciGwrAhpKXQNcQjdG10A4imdmJo5MN DsbBcofdtEVLietncwmCUjScSqjUAZUn/sxq0b1BHRMyXsJs8PUou91ucPuwZY3UvLGcEtSaS5O5A R6cK2OBi5B77sijfTsKe/7JiE5EsX0pSKldFvUFip3ow91ea/U0RITK0hvLEwqc4o7pfCnYQbTbvx 3I8TjBU8EyNOhtJn4lciyvYXhTX1YNhlpPtFmqDeFI6tBs8OIOzv+mx1PRm60ClcYOl2yOa1l8nu9 TMYgma2HJPY7FlYbkhqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQrYI-002l2F-1B; Tue, 01 Aug 2023 15:44:50 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQrYE-002l0Q-27 for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 15:44:48 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qQrY8-0003zX-QC; Tue, 01 Aug 2023 17:44:40 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qQrY5-000Q2m-ON; Tue, 01 Aug 2023 17:44:37 +0200 Received: from localhost ([::1] helo=dude03.red.stw.pengutronix.de) by dude03.red.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qQrY4-00Bf3I-3L; Tue, 01 Aug 2023 17:44:36 +0200 From: Johannes Zink Subject: [PATCH v3 0/2] net: stmmac: correct MAC propagation delay Date: Tue, 01 Aug 2023 17:44:28 +0200 Message-Id: <20230719-stmmac_correct_mac_delay-v3-0-61e63427735e@pengutronix.de> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAFwoyWQC/42NzQqDMBAGX0VybopJJJqe+h6lSH5WDWgiiYoiv nuj11687XywMzuKECxE9Mp2FGCx0XqXgD0ypDvpWsDWJEY0pywvicBxGgapa+1DAD3V522glxs uaFlpJYxQmqD0rmQErIJ0uksCN/d9GscAjV2v3uebuLNx8mG78gs51xulhWCCS15JWZhcMFa8R 3DtPAXv7Po0gE7zQu/aaLIxxnnDKgAh+Z/tOI4ff9A1eSgBAAA= To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , Russell King Cc: patchwork-jzi@pengutronix.de, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Kurt Kanzenbach , kernel test robot , Johannes Zink X-Mailer: b4 0.12.2 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: j.zink@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_084446_715263_81837ADB X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --- Changes in v3: - work in Richard's review feedback. Thank you for reviewing my patch: - as some of the hardware may have no or invalid correction value registers: introduce feature switch which can be enabled in the glue code drivers depending on the actual hardware support - only enable the feature on the i.MX8MP for the time being, as the patch improves timing accuracy and is tested for this hardware - Link to v2: https://lore.kernel.org/r/20230719-stmmac_correct_mac_delay-v2-1-3366f38ee9a6@pengutronix.de Changes in v2: - fix builds for 32bit, this was found by the kernel build bot Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307200225.B8rmKQPN-lkp@intel.com/ - while at it also fix an overflow by shifting a u32 constant from macro by 10bits by casting the constant to u64 - Link to v1: https://lore.kernel.org/r/20230719-stmmac_correct_mac_delay-v1-1-768aa4d09334@pengutronix.de Tested-by: Kurt Kanzenbach # imx8mp --- Johannes Zink (2): net: stmmac: correct MAC propagation delay net: stmmac: dwmac-imx: enable MAC propagation delay correction for i.MX8MP drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 5 +++ drivers/net/ethernet/stmicro/stmmac/hwif.h | 3 ++ .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 43 ++++++++++++++++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++ drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h | 6 +++ include/linux/stmmac.h | 1 + 6 files changed, 64 insertions(+) --- base-commit: 01e6f8ad8d26ced14b0cf288c42e55d03a7c5070 change-id: 20230719-stmmac_correct_mac_delay-4278cb9d9bc1 Best regards,