From patchwork Sun Sep 27 21:59:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3524 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id BDD421C3164 for ; Mon, 28 Sep 2026 00:03:10 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-26356-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-26356-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id D70F131879 for ; Sun, 27 Sep 2026 22:01:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 517443D9058; Sun, 27 Sep 2026 22:00:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kf1ZJYfk" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-oo2-f43.google.com (mail-oo2-f43.google.com [74.125.231.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DFC83E7BD0 for ; Sun, 27 Sep 2026 22:00:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.231.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790546415; cv=none; b=HsVkswU/P4LsiPsjeDKnWHz62vSkQnz7kbC6h5EaV4fRTyBKCMQ0QEvzpRBdJVhG5g01EY9FHWrk0WIZU+HDe/2ErwC4dAyNRoH/ZLIl/fzX76emsVPjoGk6KRScseaoLFc546OYI99NknzQy8hp1kN1LG1ZWUIzXUOBcU3/yfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790546415; c=relaxed/simple; bh=Hx5UJuxKjwprvSGWaXQVjVJ0w0ttNwljukD9w8lrWm4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V4WPJeIy8zjYPzvfrPaB1i6fDUc1mm1wngO9XLYHRaYohZzli+bH3aju3tpeC26XUzBCvpgwXuPVmeUBenfOsHMEzNJJ0bCgf4Z4zSbmjbMuAMl2CHmmj8Yq1KbkWAsYa6qKlLmP8dmbvfXdN6Mg5px3vZkkApTLf2obbn8nNVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Kf1ZJYfk; arc=none smtp.client-ip=74.125.231.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo2-f43.google.com with SMTP id 46e09a7af769-81b15bca7dfso665628a34.0 for ; Sun, 27 Sep 2026 15:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790546401; x=1791151201; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=KfjvWDlH74aBokTz23r7fE1Dwv67vVeYYEoQzFsEUhQ=; b=Kf1ZJYfkSsohOGXX2fQGEe08jnlzpO4UWCengj13pS6SlYBdx+kgl5X0FY20C7PSnW FjZIsbpUqDjEtNbXRbhIfAF377bpboeTOscZjpMCuWaqqRp+l9jptMsky+XZN3nF7Pg5 /2mHyuZczTLGJpTVRBr3b3A9dtu+/timug5C4e5Uo57tLo/J+W9sTNwmN0O7MEv4CqQT DOEHsdFQI4i/vUQARziNuHmK1B7j2aZY417FZ2RsR/T51N2OViIyij+IeOZcfow5niDF Gp3xALthyrW4UiLvQRd5a9vmfC5hv9XWm+irOSuUs5iYqglOhcCdy0Igoa4DDyaFHoJF xPOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790546401; x=1791151201; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=KfjvWDlH74aBokTz23r7fE1Dwv67vVeYYEoQzFsEUhQ=; b=Yb8i+7MiRCIS1MEjou1Mr1yWZO7xIbC+xi00kZ9PUmlcRznq76ectV2gNXLP5iWTUr T7EvdOicH33tGY/Khaaoz6Bbpn20U2FsrcOjwu6QGP5gf//t4iXLF+tfVe6Cdqp5BFfp rTXYZquO9PjVtcp+mZzYdLMex88dh4PYuwHDKHAv1SrP86ah1rToDGtLi2AEvu/iLX5b j7MCa/GjxcdnjOoZsITKlIrBbecEzLlPgSOth0jrbdA9PCAyBVCtzcfmu/0V34OZIYtt QnQNur0QnHOK6ELRCRi8yvztyWMQRF1noUEPeBqEqnPZ2IRFroBo+EWvc5zcw+aSHb6j /dug== X-Forwarded-Encrypted: i=1; AKwUvBy3s2djg45KsitiHpyngaQEnPzIVr+orjyjU+0ku67AfPCGtbGqJWWOGaxDsujDXLXcpCiFLiSjlpbwGw==@lists.linux.dev X-Gm-Message-State: AFuF++k0oRLaaM5NZEbMg/QdpPEbO3J7E/ow65SWyq8vw8qcaHzabXQD nd8uK4rKX4Zekkk5H0ndfUsWpeD8HHw8mJ05NQHU/rB40okstSBiCG9z X-Gm-Gg: AYBFou3B9+BxhNsu/OOxBTclrmANTQz99I1cvwNYh+AUklwFICUKvlLCMlpZC76X55H OyYxWEafF2YIK7dN9BZJZ+CXfmTHO+moWkmCWMPzsWrHBTk79D1ooP7Jr05xvIqWAIfREwfXHr0 P3KYQXhQBiBjDN6XXxoGc8rPNOuqrNNN5QKI4piacHFkPEjzA/2THEeVQjAz0Thm+kEvm5j5weF NqyX8yfonAWk6iWvpnz4jZ+m7EFe3aCekkzyqd1+woGou0k+E0z0wrzh1nKdXpOY+UKZ3AEz0q8 u+S1yp0qA4AdPTj9paDgbd1SRe4LZaBkQ+Ra2Ih5oQPB8pXQsebt4qhrAw8W37m/TsWeNFsBzQ2 HsrCgRET4rExvL5cYAauxZ7E+6Mwb+Y6KK5UAF1CNXuWHGJ6/r8SRSB974XhcwlzR+XI1idyzXI LQSW71T0ftoEfZnQkdwNx43S/cPC0TOth4qjLWRuR2lDuB9OE5qTOhh+3O6sdpRobWH/OUqCGW3 DmqKkpFLmSecTS9DHxAhIOuLYJAwapvLLQswovRf4IcEd+JrrO2tkr9DeD8M14CGsoyzD+mdHU7 FVa0yifKP+Jdzwwv/iFQSO/XomtgISoD5aa307OVNQOdC3NTiQIE0hQodZnyt8p79JJlZ//mPXz dExbonKTzIXShBdVhrxstZA== X-Received: by 2002:a05:6830:25c4:b0:7fa:5c68:d04d with SMTP id 46e09a7af769-8178317f9a9mr11970434a34.23.1790546400973; Sun, 27 Sep 2026 15:00:00 -0700 (PDT) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-81b3de6f7e1sm4874147a34.22.2026.09.27.14.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2026 15:00:00 -0700 (PDT) From: James Hilliard Date: Sun, 27 Sep 2026 15:59:41 -0600 Subject: [PATCH net-next v5 06/19] net: stmmac: pass the desired EST enable state to est_configure() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260927-submit-stmmac-reset-fixes-v1-v5-6-feec6c14dd06@gmail.com> References: <20260927-submit-stmmac-reset-fixes-v1-v5-0-feec6c14dd06@gmail.com> In-Reply-To: <20260927-submit-stmmac-reset-fixes-v1-v5-0-feec6c14dd06@gmail.com> To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King (Oracle)" , Maxime Chevallier , Andrew Lunn , Maxime Coquelin , Alexandre Torgue , Christian Marangi , Tiezhu Yang , Huacai Chen , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Serge Semin , Suraj Jaiswal , Richard Cochran , Joao Pinto , Vladimir Oltean , Ong Boon Leong , Voon Weifeng , "Song, Yoong Siang" , Linus Walleij , Martin Blumenstingl , Magnus Karlsson , Maciej Fijalkowski , Simon Horman , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Thierry Reding , Jonathan Hunter , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jose Abreu , Yao Zi , Philipp Zabel Cc: Richard Genoud , Alastair D'Silva , Maxime Ripard , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org, ZhaoJinming , Lorenzo Bianconi , Ding Hui , Linkui Xiao , Linkui Xiao , linux-tegra@vger.kernel.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Lorenzo Bianconi Pass the desired EST enable state explicitly to est_configure() instead of having it derive the EEST/EST_INT_EN bits from cfg->enable. This decouples the hardware programming state from the priv->est.enable flag, which records whether the taprio offload is attached. No functional change intended: the callers keep toggling priv->est.enable around the EST programming, as before. Signed-off-by: Lorenzo Bianconi Signed-off-by: James Hilliard --- drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_est.c | 6 +++--- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index a8a5c8fdd5ed..1fd9f1ab316e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -617,7 +617,7 @@ struct stmmac_mmc_ops { struct stmmac_est_ops { int (*configure)(struct stmmac_priv *priv, struct stmmac_est *cfg, - unsigned int ptp_rate); + unsigned int ptp_rate, bool enable); void (*irq_status)(struct stmmac_priv *priv, struct net_device *dev, struct stmmac_extra_stats *x, u32 txqcnt); }; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c index afc516059b89..f15d4d046aa7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c @@ -26,7 +26,7 @@ static int est_write(void __iomem *est_addr, u32 reg, u32 val, bool gcl) } static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg, - unsigned int ptp_rate) + unsigned int ptp_rate, bool enable) { void __iomem *est_addr = priv->estaddr; int i, ret = 0; @@ -62,7 +62,7 @@ static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg, ctrl |= ((NSEC_PER_SEC / ptp_rate) * EST_GMAC5_PTOV_MUL) << EST_GMAC5_PTOV_SHIFT; } - if (cfg->enable) + if (enable) ctrl |= EST_EEST | EST_SSWL | EST_DFBS; else ctrl &= ~EST_EEST; @@ -70,7 +70,7 @@ static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg, writel(ctrl, est_addr + EST_CONTROL); /* Configure EST interrupt */ - if (cfg->enable) + if (enable) ctrl = EST_IECGCE | EST_IEHS | EST_IEHF | EST_IEBE | EST_IECC; else ctrl = 0; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c index 2a4099fe470c..64d890664421 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -74,7 +74,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta) mutex_lock(&priv->est_lock); priv->est.enable = false; stmmac_est_configure(priv, priv, &priv->est, - priv->plat->clk_ptp_rate); + priv->plat->clk_ptp_rate, false); mutex_unlock(&priv->est_lock); } @@ -104,7 +104,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta) priv->est.btr[1] = (u32)time.tv_sec; priv->est.enable = true; ret = stmmac_est_configure(priv, priv, &priv->est, - priv->plat->clk_ptp_rate); + priv->plat->clk_ptp_rate, true); mutex_unlock(&priv->est_lock); if (ret) netdev_err(priv->dev, "failed to configure EST\n"); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c index 357d1eaf0d7d..67c6fc32d0ea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c @@ -1082,7 +1082,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv, tc_taprio_map_maxsdu_txq(priv, qopt); ret = stmmac_est_configure(priv, priv, &priv->est, - priv->plat->clk_ptp_rate); + priv->plat->clk_ptp_rate, true); mutex_unlock(&priv->est_lock); if (ret) { netdev_err(priv->dev, "failed to configure EST\n"); @@ -1100,7 +1100,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv, mutex_lock(&priv->est_lock); priv->est.enable = false; stmmac_est_configure(priv, priv, &priv->est, - priv->plat->clk_ptp_rate); + priv->plat->clk_ptp_rate, false); /* Reset taprio status */ for (i = 0; i < priv->plat->tx_queues_to_use; i++) { priv->xstats.max_sdu_txq_drop[i] = 0;