Article View: linux.kernel.netdev
Article #2623[PATCH net-next v8 0/3] net: stmmac: dwxgmac2: timestamp interrupt support + Agilex5 fix
From: Zxyan Zhu
Date: Tue, 13 Oct 2026 03:32
Date: Tue, 13 Oct 2026 03:32
54 lines
10856 bytes
10856 bytes
This series adds auxiliary snapshot (EXTTS) interrupt support to DWXGMAC2/DWXLGMAC2, fixes a stale TSIS race on the Agilex5 cross-timestamp path that the new handler would otherwise expose, and guards the shared aux snapshot handler against a zero channel mask. Patch 1 makes smtg_crosststamp() complete on the persistent ATSNS count instead of the transient TSIS bit, waits for the FIFO clear to complete, and holds aux_ts_lock across the whole trigger/poll/drain sequence so a concurrent EXTTS request cannot flush the snapshot FIFO mid-flight. Patch 2 guards the shared aux snapshot handler against a zero channel mask: ilog2() is applied to the mask without a zero check, and ilog2(0) yields an out-of-range event index that ptp_clock_event() feeds to test_bit() unchecked from hard IRQ context. Patch 3 adds a dedicated DWXGMAC2 timestamp interrupt handler. The XGMAC hwif entries used the generic ops, whose callback read the wrong register and whose enable mask omitted the timestamp interrupt, so the clock advertised the aux snapshot channels but no event was ever delivered. XGMAC_TSIE is not enabled by default; it is armed on demand from the EXTTS enable/disable path through a new callback, and the handler only touches the FIFO while the interrupt is armed and while no cross-timestamp owns it. The interrupt is disarmed on suspend and unregister and re-armed on resume. 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: https://lore.kernel.org/netdev/20260818132722.1852876-1-zxyan0222@gmail.com/ v4: https://lore.kernel.org/netdev/20260902131441.322167-1-zxyan0222@gmail.com/ v5: https://lore.kernel.org/netdev/20260910081020.86227-1-zxyan0222@gmail.com/ v6: https://lore.kernel.org/netdev/20260929073553.4136336-1-zxyan0222@gmail.com/ v7: https://lore.kernel.org/netdev/20261004120526.2728564-1-zxyan0222@gmail.com/ v8: - Gate the handler's FIFO drain on XGMAC_TSIE being armed; the handler runs for every MAC interrupt and must not touch the FIFO while the timestamp interrupt is disarmed. - Hold aux_ts_lock across the whole EXTTS enable, including the FIFO clear poll, so the re-arm cannot interleave with a suspend. - Drain an in-flight handler with stmmac_sync_timestamp_irq() when the FIFO is handed to the cross-timestamp and on the EXTTS disable path. - Roll a failed EXTTS enable back in hardware and software on the FIFO-clear timeout, and drop the EXTTS state when the resume re-arm cannot restore the channel. - Disarm XGMAC_TSIE on suspend and unregister; re-arm it on resume. - Initialise aux_ts_lock in probe and destroy it in remove, so it is valid for the whole device lifetime. - Only clear the software state in the resume-failure teardown, since the auxiliary snapshot register differs on DWMAC_CORE_MAC100/GMAC. -- 2.43.0
Technical Details
Message-ID:
<20261013033207.1684328-1-zxyan0222@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345373-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345373-linux-kernel-netdev=dewy.ru
From: zxyan0222@gmail.com (Zxyan Zhu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v8 0/3] net: stmmac: dwxgmac2: timestamp interrupt support + Agilex5 fix
Date: Tue, 13 Oct 2026 11:32:04 +0800
Organization: Usenet Network
Message-ID: <20261013033207.1684328-1-zxyan0222@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1951695"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8uGVcr0jAZZVRB81ijGUWp/v9d8= sha256:RCaw580jEujmt5q07zu+AqV3gdCYxcDmUwMtBuKLVqk=
sha1:QR5hs3wQyzFnD/jJPm2Kib2KAok= sha256:YcgcdMrUUXdNJFZDhIe0ZYBZkqkbWk37MD5quO0ja90=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 5F49310FD6F; Tue, 13 Oct 2026 06:37:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.749
X-Spam-Status: No, score=-0.749 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id P3e0yUDGvfWK;
Tue, 13 Oct 2026 06:37:40 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-345373-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 1C54410EC1B; Tue, 13 Oct 2026 06:37:31 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 6E5A83D494; Tue, 13 Oct 2026 03:32:16 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D978946D2D8;
Tue, 13 Oct 2026 03:32:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eahw3a89"
X-Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175])
(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 AEA66377AB4
for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 03:32:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791862335; cv=none; b=qZTL2nRKImZq7cq46+8K1yAQgCoq7PjlRILXSXQgFwQ93PEF8JeqPf33PbODPlQEiiKIOx92cE203ub4v+Z6ov8qCPG0Kum1Yv9AOlOpgeybvslNnMSFcKIrZa5EbbFRJmRWJEaKI2+wlxgwQrohYRIljjoIxRtF7CKx9qwaPN0=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791862335; c=relaxed/simple;
bh=IyheIQPFaBDT7+LxjdCL9KtVVA6tqApMSlyfFxvP220=;
h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NFwqSnb6iu74ioMd0M1qhHepZopPUPOY/TzgUSgIrGFSmRkec58eKjek2sLevqPIGLHvE1azKiSgHfBenlDiW3l+TLukWKe17mLla3BFNXW0Egj0J5isAupUObJPPbardUiCTS8ucTeuSDiZOLmoReMJAcJ+vpquSe0bTKItbMs=
X-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=eahw3a89; arc=none smtp.client-ip=209.85.214.175
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2e5d0ee1951so15420015ad.0
for <netdev@vger.kernel.org>; Mon, 12 Oct 2026 20:32:14 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1791862334; x=1792467134; 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=K5tVRnzC7/u+9J2k/n3TM+qJYjKV4r4MGpsSjnXhUFQ=;
b=eahw3a89k4aL49c5ZY/wZVXJZ6YEsjiQn48Z9UYjGKrKfaNPxTjcqtZzklzwbIRyQ8
Bl7OMnsPy7p7tTzn3oqsbL1ww8xyfcN8+QZkr00BNTuGg5wlaoTGsK7sYi8RsUr/6oJI
KtwCp4NwzWkTgh7kV9WIrPd5yCZyCiyuN851UyrAhDRTuj4tljNtVO48F5qosAqYZipl
g/ElFhRteaC3xDQWVMDB+qzDfVbwZKbjfBvmCyCARoe4m2ODvDrC/Yq1CDcj7NAbp1+/
rT3dL/mcE8pXegUC5Nck3Ql05jIUR8tAuNNcR7iWl9sPh0aWRTbGxQboMRM2zO2E5htQ
h+qA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1791862334; x=1792467134;
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=K5tVRnzC7/u+9J2k/n3TM+qJYjKV4r4MGpsSjnXhUFQ=;
b=EdmLAivLJztXB9cQOcd8qnT65w1fE3YSiib5MvQoGnVVUgWBovvgUX7QqPNuLx8bic
khfOVwq6/8gJk0WOSG5ZdoNbgqlUQuLoOLG2Xwp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d1-3ab3ac718f2mr10568795a91.50.1791862333896;
Mon, 12 Oct 2026 20:32:13 -0700 (PDT)
X-Received: from server227.. ([39.170.101.209])
by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ab36fdc75esm19541303a91.12.2026.10.12.20.32.10
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 12 Oct 2026 20:32:13 -0700 (PDT)
X-Cc: mcoquelin.stm32@gmail.com,
alexandre.torgue@foss.st.com,
richardcochran@gmail.com,
muhammad.nazim.amirul.nazle.asmade@altera.com,
rohan.g.thomas@altera.com,
netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.34.1
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>