get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217796/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217796,
    "url": "http://patchwork.ozlabs.org/api/patches/2217796/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/D1C3B3DF-960F-40C7-BBD7-994359F0C8AD@vanvalzah.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<D1C3B3DF-960F-40C7-BBD7-994359F0C8AD@vanvalzah.com>",
    "list_archive_url": null,
    "date": "2026-03-29T03:25:41",
    "name": "igc: fix Tx timestamp timeout caused by unlocked TIMINCA write in adj fine",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "5fedeca90bf67be6349586a623466c072e506e6d",
    "submitter": {
        "id": 93009,
        "url": "http://patchwork.ozlabs.org/api/people/93009/?format=api",
        "name": "Bob Van Valzah",
        "email": "bob@vanvalzah.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/D1C3B3DF-960F-40C7-BBD7-994359F0C8AD@vanvalzah.com/mbox/",
    "series": [
        {
            "id": 498057,
            "url": "http://patchwork.ozlabs.org/api/series/498057/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=498057",
            "date": "2026-03-29T03:25:41",
            "name": "igc: fix Tx timestamp timeout caused by unlocked TIMINCA write in adj fine",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498057/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217796/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217796/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=RT2+CUCK;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fkwFn5SJvz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 02:31:25 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 34A5C60BF2;\n\tMon, 30 Mar 2026 15:31:24 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id HSfzBoejrpfW; Mon, 30 Mar 2026 15:31:22 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id C8A1A60BF3;\n\tMon, 30 Mar 2026 15:31:22 +0000 (UTC)",
            "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by lists1.osuosl.org (Postfix) with ESMTP id 1677310F\n for <intel-wired-lan@lists.osuosl.org>; Sun, 29 Mar 2026 03:25:59 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 143AA408E1\n for <intel-wired-lan@lists.osuosl.org>; Sun, 29 Mar 2026 03:25:59 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id lVPVJZ3y9F_8 for <intel-wired-lan@lists.osuosl.org>;\n Sun, 29 Mar 2026 03:25:57 +0000 (UTC)",
            "from mail-oi1-x231.google.com (mail-oi1-x231.google.com\n [IPv6:2607:f8b0:4864:20::231])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 95977408DB\n for <intel-wired-lan@lists.osuosl.org>; Sun, 29 Mar 2026 03:25:56 +0000 (UTC)",
            "by mail-oi1-x231.google.com with SMTP id\n 5614622812f47-467fd082ffeso2160099b6e.1\n for <intel-wired-lan@lists.osuosl.org>; Sat, 28 Mar 2026 20:25:56 -0700 (PDT)",
            "from smtpclient.apple (c-76-16-6-204.hsd1.il.comcast.net.\n [76.16.6.204]) by smtp.gmail.com with ESMTPSA id\n 5614622812f47-46aa0efdb75sm2191961b6e.13.2026.03.28.20.25.52\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Sat, 28 Mar 2026 20:25:53 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org C8A1A60BF3",
            "OpenDKIM Filter v2.11.0 smtp4.osuosl.org 95977408DB"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1774884682;\n\tbh=Q3zHZR2nqCQ4BfQwwL3YtsGWqRQDle8jBml0c4WJz+U=;\n\th=From:Date:Cc:To:Subject:List-Id:List-Unsubscribe:List-Archive:\n\t List-Post:List-Help:List-Subscribe:From;\n\tb=RT2+CUCKz+lvvD1NEboQVMVYmU3Bjh+uhNdtO4OvG1ljdkGIeCsXSmDT6cgN93+zv\n\t Z7IJDbdk6K3iLZrbNI+MjP6KmCL9Egksb76TKgkbzQJoQ7BQzxtQYBG/xmhV5Aj+4G\n\t qlt6STlQwWrnFfaIo62yxilukiFrHYDlsCOQmc/hdLuFkTifu8OU+ATH3U/IfKryJr\n\t VuupmarAoA2SR2+krtlHBlsKrWqNvEfb7l1SmV71UZf8zPsQS3938PNJ4Exs0Zoywv\n\t 35uvgPbVc3JtdKrsDiTBAmeEEr19KcoVTzDYwaJ4OzJ3vglwvV/G77JHcmcAS1GurJ\n\t x+G6M2wShnf+w==",
        "Received-SPF": "None (mailfrom) identity=mailfrom;\n client-ip=2607:f8b0:4864:20::231; helo=mail-oi1-x231.google.com;\n envelope-from=bob@vanvalzah.com; receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp4.osuosl.org 95977408DB",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774754755; x=1775359555;\n h=to:cc:date:message-id:subject:mime-version:from:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=Q3zHZR2nqCQ4BfQwwL3YtsGWqRQDle8jBml0c4WJz+U=;\n b=jf8LRpZf41wuUXS25wbOg/XLKTEh3a0/5lWG01b5k1UHuYak3J+ZvZYF3b8sQzICqi\n qGBKBUAG7R5/w2SmOsveIebdr12VqEwlsfExca+N0T/R9Skx4fPL4cMqNznLY9KgssZ1\n zfE8cmp5CVZbIM25OJs5fxtyelTQpSNB7gun0H4J17rF2i7IUNWrt6zUIEc1uQuh8PMY\n Plb3hb+xj05fNdp8698kLh6nrng4iwsH94lobAvUJMQVCLOy60RiFVSLVK4vKMTZjSdA\n Hc9OLbTvEtsBwgpWA5In1EBveqhLO1tLwzhzcMMZTTbcV6cAM79qELNq2Zqp4/l2ZdQ+\n 2xZA==",
        "X-Gm-Message-State": "AOJu0YzrXA0Yu0b6G2ia517u6sQW36QUkR7fkLjbzb8M77aKBZdwaJQO\n gtFdP3WfA5GuRoJQwldGzNkB3BZfVPckHIieGFxQHVBrsFz94xfoAlmYEyWIRefjIOnqUb0as3O\n nh6SZfk4=",
        "X-Gm-Gg": "ATEYQzyvR8n4SQKSuk2UQ1J2cUtFEpoG5geR7kHRKx4JPiaJlLwrtQ43YT1eTbLU5p3\n sGkwU62aZrBXVjhX187cTc+kn4Ul/slIy9RUtpHnwT7P8odg0DFWmqyNm7TJU/OtE9yl9yVDm6/\n sQCdF+he+qjVoAs9M2YEkpG2VP9tAG9XaIeCE6Ysb1qI9eLu7tuEU6OtZX7N0+xuu8bTJwqHNya\n k2Hp3lZLbOyqTJMLXKGANDRyfV6FgZcNx0xfg7s/QDdEMXz+hrnxwN1ruviKy34ZzGeezVnb/P8\n Ua14UW7pDbhk64+A7UzStDYVvgm8EYl5UNML5u96v4m6gp1MYMubA88qhQBqPfomE95ruMGEMRO\n L4ERYXo9c1ImW+BfZ6xvQkviXtnX/S9dPkWbkUsi83OszRsztjUMReZ4FVAKZIkV37YfVF5E99O\n H1uMQBwt9XBk/27H7yz1bP2xpzj1cul/7fq9EY/dkBXWoOK745aKxPXt7/rIInWXZdVCl/5R4Zg\n Q==",
        "X-Received": "by 2002:a05:6808:1928:b0:467:5571:7f3c with SMTP id\n 5614622812f47-46a8a38f139mr3576274b6e.6.1774754754796;\n Sat, 28 Mar 2026 20:25:54 -0700 (PDT)",
        "From": "Bob Van Valzah <bob@vanvalzah.com>",
        "Content-Type": "multipart/mixed;\n boundary=\"Apple-Mail=_DAE5922D-DCB8-444B-BD9A-99F8AE183AD2\"",
        "Mime-Version": "1.0 (Mac OS X Mail 16.0 \\(3864.400.21\\))",
        "Message-Id": "<D1C3B3DF-960F-40C7-BBD7-994359F0C8AD@vanvalzah.com>",
        "Date": "Sat, 28 Mar 2026 22:25:41 -0500",
        "Cc": "anthony.l.nguyen@intel.com, netdev@vger.kernel.org, julianstj@fb.com,\n jeff@jeffgeerling.com",
        "To": "intel-wired-lan@lists.osuosl.org",
        "X-Mailer": "Apple Mail (2.3864.400.21)",
        "X-Mailman-Approved-At": "Mon, 30 Mar 2026 15:31:21 +0000",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=vanvalzah-com.20230601.gappssmtp.com; s=20230601; t=1774754755;\n x=1775359555;\n darn=lists.osuosl.org;\n h=to:cc:date:message-id:subject:mime-version:from:from:to:cc:subject\n :date:message-id:reply-to;\n bh=Q3zHZR2nqCQ4BfQwwL3YtsGWqRQDle8jBml0c4WJz+U=;\n b=QyLzBgoVhdGc+Lu+13otaBD7woDCizviGr5zHHMV+y/88xPKKlUyqjESYe/NmgCcRN\n 06d6cIkF2NhUiNKRmlmAgoCrm/9IiEBNGee9SNtb0OQE6vd2N6ItIuvYNo6pxOu43cbe\n md0Wf+uCZ9dAmnlBFt+Tc15oCubU1N7cThsgtdGkNoC2fIpfXf/AM9zAZwsnIYwvnOV7\n 4juHNnr1ydQkDRwIaRJqYm5AbgsDfsThch/qIoU2vtQTW+KzHw57UPW9L4+Tlndq4jOG\n PEUJvhrrHKUyXF9N8Qz5NPHHcv+DCRbh3V85BlxA1U9jz+9qDMnZ6W4anvSgsRz/PNiI\n P1pw==",
        "X-Mailman-Original-Authentication-Results": [
            "smtp4.osuosl.org;\n dmarc=none (p=none dis=none)\n header.from=vanvalzah.com",
            "smtp4.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=vanvalzah-com.20230601.gappssmtp.com\n header.i=@vanvalzah-com.20230601.gappssmtp.com header.a=rsa-sha256\n header.s=20230601 header.b=QyLzBgoV"
        ],
        "Subject": "[Intel-wired-lan] [PATCH] igc: fix Tx timestamp timeout caused by\n unlocked TIMINCA write in adj fine",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "Hi,\n\nWe found a race in igc_ptp_adjfine_i225() that causes \"Tx timestamp\ntimeout\" errors and eventually wedges EXTTS when a PTP grandmaster\n(ptp4l with hardware timestamping) runs concurrently with PHC\nfrequency discipline (any GPSDO calling clock_adjtime ADJ_FREQUENCY).\n\nRoot cause: igc_ptp_adjfine_i225() writes IGC_TIMINCA without holding\nany lock.  Every other PTP clock operation in igc_ptp.c (adjtime,\ngettime, settime) holds tmreg_lock, but adjfine does not.  When the\nincrement rate changes while the hardware is capturing a TX timestamp,\nthe captured value is corrupt.  The driver retries for\nIGC_PTP_TX_TIMEOUT (15s), then logs the timeout and frees the skb.\nRepeated occurrences eventually prevent EXTTS from delivering events.\n\nThe attached reproducer (triggers in ~17 seconds on i226):\n\n  One thread calling clock_adjtime(ADJ_FREQUENCY) at ~200k/s on the\n  PHC, another sending UDP packets with SO_TIMESTAMPING requesting\n  hardware TX timestamps at ~100k/s.  A Python reproducer is at:\n  https://github.com/bobvan/PePPAR-Fix/blob/main/tools/igc_tx_timeout_repro.py\n\n  At realistic rates (1 Hz adjfine from a GPSDO + ptp4l at 128 Hz\n  sync), the race triggers in ~30 minutes.\n\nThe attached patch holds ptp_tx_lock around the TIMINCA write and\nskips the write if any TX timestamps are pending (tx_tstamp[i].skb\n!= NULL), returning -EBUSY.  This doesn't fully close the hardware\nrace (a new TX capture can start between the check and the write),\nbut at realistic rates the residual probability gives ~25 year MTBF\nvs ~30 minutes without the patch.\n\nA complete fix would likely require either disabling TX timestamping\naround TIMINCA writes (via TSYNCTXCTL), or making the timeout recovery\npath more robust so a single corrupt timestamp doesn't wedge the\nsubsystem.  We'd welcome guidance from the igc maintainers on the\npreferred approach.\n\nTested on:\n  - Intel i226 (TimeHAT v5 board on Raspberry Pi 5)\n  - Kernel 6.12.62+rpt-rpi-2712 (Raspberry Pi OS)\n  - Intel out-of-tree igc driver 5.4.0-7642.46\n  - Stock upstream igc_ptp.c (same code, same bug)\n\n\tBob\n\n---\n\n drivers/net/ethernet/intel/igc/igc_ptp.c | 18 +++++++++++++++++-\n 1 file changed, 17 insertions(+), 1 deletion(-)\n\n        if (scaled_ppm < 0) {\n                neg_adj = 1;\n@@ -63,7 +65,21 @@ static int igc_ptp_adjfine_i225(struct ptp_clock_info *ptp, long scaled_ppm)\n        if (neg_adj)\n                inca |= ISGN;\n\n-       wr32(IGC_TIMINCA, inca);\n+       /* Changing the clock increment rate while a TX timestamp is being\n+        * captured by the hardware can corrupt the timestamp, causing the\n+        * driver to report \"Tx timestamp timeout\" and eventually wedging\n+        * the EXTTS subsystem.  Serialize with pending TX timestamps:\n+        * skip the rate change if any are in flight.\n+        */\n+       spin_lock_irqsave(&igc->ptp_tx_lock, flags);\n+       for (i = 0; i < IGC_MAX_TX_TSTAMP_REGS; i++) {\n+               if (igc->tx_tstamp[i].skb) {\n+                       spin_unlock_irqrestore(&igc->ptp_tx_lock, flags);\n+                       return -EBUSY;\n+               }\n+       }\n+       wr32(IGC_TIMINCA, inca);\n+       spin_unlock_irqrestore(&igc->ptp_tx_lock, flags);\n\n        return 0;\n }\n--\n2.39.2",
    "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c\nindex XXXXXXX..XXXXXXX 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ptp.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c\n@@ -47,8 +47,10 @@ static int igc_ptp_adjfine_i225(struct ptp_clock_info *ptp, long scaled_ppm)\n {\n        struct igc_adapter *igc = container_of(ptp, struct igc_adapter,\n                                               ptp_caps);\n        struct igc_hw *hw = &igc->hw;\n+       unsigned long flags;\n        int neg_adj = 0;\n        u64 rate;\n        u32 inca;\n+       int i;\n\n",
    "prefixes": []
}