From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 C7BED477292 for ; Tue, 18 Aug 2026 13:27:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787059661; cv=none; b=uOvZktR/OQ3o7zhjOphwqDX71jL8qrwvHmvWKgLMmgKxcrmesWDOS5tzjhj/YJYl+aQsW3sfrGqH+CTf6qurMXYLxF5uJsPwLE0cAyg8lUWJvzG1qKz3HyjT1xumBX+axTcQrahl0ebVnG7vrisZ4T2uxk5ltT++l9BpYFbbnIY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787059661; c=relaxed/simple; bh=Ydyy/Hj73xf7iU1OPDBxYLZO4MLEAqdL03I2QiMdhIs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Z/IiAF054Dj4W/felUhOnqa6b20fug9ZJrqOKuJamITv+LcLuMg7khfoENKCkL4Y1IrSCkkUzKzQfYryf7ByrLUPqsnanpFbulsV2gM488ox6h/SnT9GVdSLQTt8f3A/O3NKTwPKz6lq1iSJPgom00qcj8oYXpZQukEqMDCDIP4= 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=q8dnRxGh; arc=none smtp.client-ip=209.85.128.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q8dnRxGh" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4995b0343c1so43458105e9.3 for ; Tue, 18 Aug 2026 06:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787059658; x=1787664458; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=fRt75Cw0D3zOWFN+00SWJIuIxB+ErtT9mg4MKtDgEDI=; b=q8dnRxGhSVCd8883N3Nh/5unrrCiB7751H6n25PtF+JZDjB0eInESZswhPkECQoGAb KjSnFDHbcbtAGcF3wnwUEA+JMaCsyKsJifYXrXC3gWp+bkZakLQe9CTevyilqgnDHODW TKx7AxZb3N83/yGH8At/8what/YA6QTNPSEF9VO7r7j8OCYQJ8ZGsEU9eprRldPpXve8 e0tMUEW3i3wCwEF/AH3q4XdfDxGQtU0SLWDV6ZFX8J+KUuCqQuPXcdtJ685xkZIDOA8t Yu1TdxNJY00EV4Q6qdvsTEaDS7G84KuKynO8Va8FXF5w7bp5Uo1VY5ZUTSVE5wphaH9r +z5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787059658; x=1787664458; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=fRt75Cw0D3zOWFN+00SWJIuIxB+ErtT9mg4MKtDgEDI=; b=iwT6MHCYY0YB+ANEC1aZf4+b8b4FQbQIKs8OU0ozqabQQXtIlTa/WAr2QWoC0S/3SM B7IEDf3/02Yk68hC46LEkctjAb0WnOt9vmJUhj3gTWRTu9HJ2e9QtdYo8Pq8fDBJ9Sb9 dZ9sNKw1cNDZjRMmhUkPA/t+qaXISdwdCHcF8NIykeVJA80tVe52mtC7C4bvXx7qedCa dmNbRS3hyY1MWRHFIQfIXsU92WYvWlgi4euAi9bYbB34uhZbjfKISyIyalLhucJm6NpZ hf1ImeevNdHG6znrvHIqxmUSJz2okff1kgzlnh27ki3NFaHQbwVgm+oss0MztaKC7kEl XimA== X-Forwarded-Encrypted: i=1; AHgh+Rp7iHQtTn7AxRiXPdWuQxQiQ6uzcRMuCLboSIG+xtqgUzUb33B0RRegbvB/ahsWcVRQeDjp9J1dTL//PJc=@vger.kernel.org X-Gm-Message-State: AOJu0YxkSGEZBNkKSZfJOHmlSvY7y1vxmRR89ITW8rbkeaFrcXUDul8o 8ZV2Q5vT81EDHT5Nl/AxJyMYpFVkfvmfSdSqw0OxDSh1Mz/U6YVfgc2YPqGNKH4r X-Gm-Gg: AR+sD110xfhY8afjYJAkNKnWwux32xBM7CPBmMm9Wg1OAfrraoDK4TYZIMy+lBLp+vK Q6F3QPjkVNa1toaeEloM1x57Rip+RTGHALcWwUEuhxtJnXXc33BbHISdaxOEzXxLpHczI9/EjMn L3sAKm5zkd7fpTMsrrNtAeCV908rNcrYwPRy+uK1/47hgaYpk+UaMFw+ygq1cJV3BCSwbBNWZFl 0nJGH+TR9cJu4RT3yBsNHetm6kRm/V7mPjfYVdZB6jsRjtcdTstA+c2Lrx9YAa1IfPrtX/uzwH3 1dZFokgdBsNUhGKvRw3S+iFBojQPjC+2+2D0yIzgYAt/gLcB9ZSbCTrZn5b1BvlVg9Hf7+d4aHU sqkGeELaGwDarqf3IIGvalmMFXuRc9I+OcsoatYMXzT4+8yBCpU4rDmuP6Syk27lYEOu44cUZ99 wPi1kETTgFGPlzoVN4NGu/gILh/bSmkUhcScZEIkKcvPT6Ve9PdUjQtx3ZuxA= X-Received: by 2002:a05:600c:5286:b0:499:621a:2ec2 with SMTP id 5b1f17b1804b1-4998933fd79mr572811735e9.3.1787059657466; Tue, 18 Aug 2026 06:27:37 -0700 (PDT) Received: from server227.. ([39.170.101.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482a5a7c568sm12140145f8f.18.2026.08.18.06.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 06:27:37 -0700 (PDT) From: Zxyan Zhu To: maxime.chevallier@bootlin.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, andrew+netdev@lunn.ch, richardcochran@gmail.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, muhammad.nazim.amirul.nazle.asmade@altera.com, Zxyan Zhu Subject: [PATCH net-next v3 0/2] net: stmmac: dwxgmac2: timestamp interrupt + Agilex5 fix Date: Tue, 18 Aug 2026 21:27:20 +0800 Message-Id: <20260818132722.1852876-1-zxyan0222@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series adds auxiliary snapshot (EXTTS) interrupt support to DWXGMAC2/DWXLGMAC2 and fixes a regression it would introduce on the Agilex5 cross-timestamp path. Patch 1 wires up a dedicated DWXGMAC2 timestamp interrupt handler. Before this change the XGMAC hwif entries used the generic stmmac_ptp ops, whose timestamp_interrupt callback read the dwmac4 offset GMAC_TIMESTAMP_STATUS (0xb20) instead of the XGMAC register at 0xd20, and XGMAC_TSIE was never enabled, so auxiliary snapshot events were never reported on XGMAC platforms. Patch 1 also unmasks XGMAC_TSIE in XGMAC_INT_DEFAULT_EN. That makes the new handler run from hardirq on every XGMAC timestamp event, which races with the Agilex5 smtg_crosststamp() poll loop: the handler clears TSIS by reading XGMAC_TIMESTAMP_STATUS before the poll loop in process context can observe it, so getcrosststamp() times out. Patch 2 fixes this by masking XGMAC_TSIE for the duration of the cross-timestamp so the handler cannot steal TSIS while smtg_crosststamp() owns the snapshot FIFO. Patch 2 has been verified on Agilex5 hardware: with both patches applied, smtg_crosststamp() no times out (no "Wait for time sync operation timeout" in dmesg) and the PTP clock registers and operates normally. v1: https://lore.kernel.org/netdev/20260806-dwxgmac2-timestamp-irq-v1-1-c051c79c9d90@gmail.com/ v2: https://lore.kernel.org/netdev/20260810100221.9166-1-zxyan0222@gmail.com/ v3: - Add patch 2 to mask XGMAC_TSIE during the Agilex5 cross-timestamp, so enabling XGMAC_TSIE in patch 1 does not break getcrosststamp() on Agilex5 XGMAC (reported by the netdev sashiko review, fixed approach discussed with Maxime). - Patch 2 verified on Agilex5 by Nazim Amirul (Tested-by tag carried on patch 2). Zxyan Zhu (2): net: stmmac: dwxgmac2: add XGMAC timestamp interrupt support net: stmmac: dwmac-socfpga: mask XGMAC_TSIE during cross-timestamp .../ethernet/stmicro/stmmac/dwmac-socfpga.c | 11 +++++ .../net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 +- .../ethernet/stmicro/stmmac/dwxgmac2_core.c | 43 +++++++++++++++++++ drivers/net/ethernet/stmicro/stmmac/hwif.c | 4 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 1 + .../ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 12 ++++++ .../net/ethernet/stmicro/stmmac/stmmac_ptp.h | 1 + 7 files changed, 71 insertions(+), 3 deletions(-) -- 2.34.1