get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2146962,
    "url": "http://patchwork.ozlabs.org/api/patches/2146962/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20251008073139.373796-2-mikhail.kshevetskiy@iopsys.eu/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20251008073139.373796-2-mikhail.kshevetskiy@iopsys.eu>",
    "list_archive_url": null,
    "date": "2025-10-08T07:31:38",
    "name": "[v2,1/2] net: airoha: simplify rx/free packet logic a bit",
    "commit_ref": "ec127937199d7ec7116f07bb1642565ab6671a36",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ea1b6b7134076b363f85586a797d513e14080af0",
    "submitter": {
        "id": 84987,
        "url": "http://patchwork.ozlabs.org/api/people/84987/?format=api",
        "name": "Mikhail Kshevetskiy",
        "email": "mikhail.kshevetskiy@iopsys.eu"
    },
    "delegate": {
        "id": 157425,
        "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api",
        "username": "jforissier",
        "first_name": "Jerome",
        "last_name": "Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251008073139.373796-2-mikhail.kshevetskiy@iopsys.eu/mbox/",
    "series": [
        {
            "id": 476692,
            "url": "http://patchwork.ozlabs.org/api/series/476692/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=476692",
            "date": "2025-10-08T07:31:37",
            "name": "net: airoha: improvements",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/476692/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2146962/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2146962/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=iopsys.eu header.i=@iopsys.eu header.a=rsa-sha256\n header.s=selector1 header.b=MiW3aDJu;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=iopsys.eu",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=iopsys.eu header.i=@iopsys.eu header.b=\"MiW3aDJu\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=iopsys.eu",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=mikhail.kshevetskiy@genexis.eu",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=iopsys.eu;"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4chPpk2QKMz1y1V\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Oct 2025 18:32:14 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 9FAF9839E8;\n\tWed,  8 Oct 2025 09:32:07 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id DA4F883956; Wed,  8 Oct 2025 09:32:03 +0200 (CEST)",
            "from DU2PR03CU002.outbound.protection.outlook.com\n (mail-northeuropeazlp170110003.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c200::3])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 8ECC383981\n for <u-boot@lists.denx.de>; Wed,  8 Oct 2025 09:32:01 +0200 (CEST)",
            "from GV2PR08MB8121.eurprd08.prod.outlook.com (2603:10a6:150:7d::22)\n by AM8PR08MB6579.eurprd08.prod.outlook.com (2603:10a6:20b:356::8)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9182.20; Wed, 8 Oct\n 2025 07:31:56 +0000",
            "from GV2PR08MB8121.eurprd08.prod.outlook.com\n ([fe80::4cd3:da80:2532:daa0]) by GV2PR08MB8121.eurprd08.prod.outlook.com\n ([fe80::4cd3:da80:2532:daa0%3]) with mapi id 15.20.9182.017; Wed, 8 Oct 2025\n 07:31:55 +0000"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=Xe388rKQnyyk+ekGA6kRS7vNL85zbxuj44VDg7gR01kM8wA6JfO+Fwslu7cNSOCnhpL7HwDOAXyZPoU0qZApI17DFTZ6V0VIjH5PdvlcTL2fIThEp99/fxj8d/aOtApSEcxKtEuns+zHhv05woluUhxe1cNkA+2X2TNO3QoOYSX1SuJR8hXEyJrOj8yDumchNnCtGoTrAfTyddnvdfbMy/T8cwVNrbk80x+vAeu26mXAIDjNq9O1PvYiT5ABFRP5KoySsDo/Zmi3ryNoFoT6k+AQiFW4NIgcm2lL6oLqKGxQVDAAYpgM5Lb3e8zQus1NyDCeys0Abur5asM5yaBk1g==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=xKthlr+1eUHrEiMB39VuKH/tZLvqA7VpD1y4ipWK6KQ=;\n b=BLRLFWU7ACxKb2/M0wT7R5jydWT7lF6odcoM4b1iIecZSLUaja/LJLV7JSV6xDTiyjUb9rDWC+RVCtQkZofj6iceokVHZsPd+UzPzNtgUDsNp+rFclETKfueJWUjzETIrD+xkT5aNXkfGY687zP0NDLfljHStkdZ3+kHnSXjq+b7up5nDK2ZyDKTmkXj0jBGeqJsU1MH+PXcI8yaHc8rxJVd7yTV4WUbH8YTEd1aFD+QJ0l+PDleTgfIwAXyLWI4KC8X858x+GTU/Zx2M2UWdtRVw8f7CZL9VZi+Ba5YoiReicyTDNAjLwujTyDoojHwZO5zUZOnoCE1KOOHlOl+7g==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=genexis.eu; dmarc=pass action=none header.from=iopsys.eu;\n dkim=pass header.d=iopsys.eu; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=iopsys.eu;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=xKthlr+1eUHrEiMB39VuKH/tZLvqA7VpD1y4ipWK6KQ=;\n b=MiW3aDJuoP36z4w5Dvebf1luke4hiukfAdKzAL8Xgbw2JVPPO6Fwi084yWabEryX3mbWy31KMa6z5s7rMoCVTQJoTgHA/OF/nsc+t7Ld5PEazDmlsQuM/dpv27jm4mrMIaGAx026gHkMBM33X5lVMdDo1lEHP6ua9IXhk6CBiZG76LLh6YEacGwjT3g8kluw4TRPdPekrfpeNKEUJv6CxJK3Ntx4OJqh0KBmqhfb+y1IFqZegIawFLxFS1b4HsuC2WuADx/5n2Arjzd0lhGhie8JjyAh9Lti0AAz9Yz19JhqtASTj3q1zfgSQkGmKqifKuNR9gImNVX71g0LPERthw==",
        "From": "Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>",
        "To": "Christian Marangi <ansuelsmth@gmail.com>, Tom Rini <trini@konsulko.com>,\n Joe Hershberger <joe.hershberger@ni.com>,\n Ramon Fried <rfried.dev@gmail.com>,\n Jerome Forissier <jerome.forissier@linaro.org>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>, u-boot@lists.denx.de",
        "Cc": "Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Andreas Gnau <andreas.gnau@iopsys.eu>",
        "Subject": "[PATCH v2 1/2] net: airoha: simplify rx/free packet logic a bit",
        "Date": "Wed,  8 Oct 2025 10:31:38 +0300",
        "Message-ID": "<20251008073139.373796-2-mikhail.kshevetskiy@iopsys.eu>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<20251008073139.373796-1-mikhail.kshevetskiy@iopsys.eu>",
        "References": "<20251008073139.373796-1-mikhail.kshevetskiy@iopsys.eu>",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "GV3P280CA0014.SWEP280.PROD.OUTLOOK.COM\n (2603:10a6:150:b::29) To GV2PR08MB8121.eurprd08.prod.outlook.com\n (2603:10a6:150:7d::22)",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "GV2PR08MB8121:EE_|AM8PR08MB6579:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "737b5693-0a47-478c-735e-08de063cc19e",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|366016|1800799024|376014|52116014|38350700014;",
        "X-Microsoft-Antispam-Message-Info": "\n JUex8H1WLItmpcxoy1tVCWtpW/Z1gFChzNDwPUDfAVC+pKsCF3vXNC4WivwuO2rcVkdSlEAJouXx4X0/A9Clj1lAi6NWjrOcSyi2oKa4AUGURWdQr+gcgyVWYUiJMCTwFSUszkMxXp1i3UzFdXmy+dK0yQkA4Mo5lbtHz9OHgAvaUKwITRArVFFfGvcpk3CYHrzLNNn+DqfTn3AaBvEILEwhWGd/yP7jcai98auGRAnjQGJlV6V49Tmmhx0IXdi5S0pabqOZ0KR4d6rijuvACZgkkJ6LKIKkswHliU+Ez6YsrbOU2epqWdK5vZgjd9LnHsivHyIE6AWdP8m6Ea/DrB3vpKAoMaNNj0RizGr5Sm61O6kVvhoiGKRdMNhqz9hlrM9w/bU8JEcUZlwQ2ULCpAdDfRVdSqhuT9dQ0ofZGzXFmkxDX9qQKYCv4OSjpUEtNhc6VQSf0dvPfiZ+aHXeK05MY+5WKw4Cg2Nqzcj8xqniuppNpo5Pque6bzv0N3NUc0zQ3WGyWXjZKC6wZ/HNnLu7kc82mPqAagvG21OC420xBWCoa3yeoVjewE5IAYhBbhYNkX91ukjSILc9SOBupm5LEAF5GqzrB5cQOEH10VSgyp6rqL/N4XzWD3iBDDqkwDrujnOBFxjFGm9zygzbctmpKth6uSDA3kEMAlLFUl1OfscGudeFLqbWlSlh+ZUK0af87AUp9hdSTU2u8v/gm27RpvonKufXnu/8D33Xu4C+ybdO9ZHT5up5mIg9yvXToB/qh5xhOeheGe/VD+nr/o6y5eQ/ElehC5lfQLxZnKQAErbjtR7sSF/+Qj7kebw/qg8t21yVHM7lDCyRxGrbtoxEjqzL6cgSiUW2IjbF8DzDMHW0sQrv9hTAoQdRj6H02ejYuPgrKUSkCI6QEAH+ZaTq+739LdhM1F1SGNEpcdAQvi7oHElUB92pN+lTVdLC5p68RlPprXqSNRG93JA6nSkQBpuRZfNZQkspsh+IuRozWOgFfM0law5O86OwPOPXuZpMWCgh7mdveaUdVcGHrlP905IByJzIe6jTwp4RuLiW2DZt7kEEZT/t02bP0G184shKb5aSBQd2UqFlglVhNxIqgqG8o5a1M+iYRHiuRgDtSzzUwMmS/ekqZKdtY0v5ECCPS711oYM5Fvl+FxcctqPv7LzQvenFDdonhjAJLX/uhZyGK3a6+xUTNR/K+zjkdyGSgtM4N1NPdFgnV+nFvOwWPXv6h9Q7Hbq64+gnTs+aU326JRtPap64JNiLIqkV7Dn6wO75PsP7iEreD/0EiHU1dcscSwXNt5B74r0tlS9w75WXFC7DWzOk+euX2dcC70dei3rMdlC8CliyJ2MAEv/KcleoGoUh2fgL1zb5uxmKHbgETIziHa3r0vmxOSZL8Uiw9NkYlJqL073JhFMqvnCeKa1OKMWOhi/5AKvarP2yhKe10iNlIVZ5ercPVjxX072/KULfkM3EB5fWPdjYyf76xLhpvivTrIf6qqCLnPsqCp8bN1X719McbXzsb/48",
        "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:GV2PR08MB8121.eurprd08.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT;\n SFP:1102;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n ew4621AEHW2VuZ9jSM31MrrkTUs1qnOQnkgXHgJHjhKaH0kRfzTaNsyzJ1Et50piIRoInjAjAq9OO0G0PIGLKUIshtGdAp5m4Nx16ZeoSJi+zDgOp5LzrVIO7rSMEcGN0fGsLlNijcdYv9J0G2D0fXC7S3ToObM1lrIVhPxZ7mUc308js4tcFAnN9TbwUvpomX4DOEWOuZOkRJU6Pm3H6zFkxJv1lD+Uo5mwuDAr+Eu6b4cn1k49QcN2djT/NhyVnGHBqN0xOF1vF3YFR9UHM87CXwXWHTe+EjK0JAw3jFsYYXY/94QtoxcIj+TGWoMYe1muH2aAlm2IFmh4n23oTQdeValVKTyuk/wYhYZe1VnkXeiQIjtkkmxPQbspk3iAAFJfQsAOKXWfU7SKMKPiC3XIRubDvjXPlloBwourofikOggdLVxHmq37OLQ2YfguuDjHMf09dWbF+Gx+iouQeP0KiZpG5c6pwR3ET5HmeokGaSewGvjH/vC2qqm3h5TmH3vvgQ4fc11mqmbBy+fhxKsb6+mGFoNjVib+ng3tRe8DHkzaMBdVpGx/xuvK/hkWyOwb3iuCEt80imqXUl8UMSuEJZS1jP7w3LQhaSXa1WOl3V0fIpgttmx96bu33SA/47NodJ2TLJ8inH0N/82fCFZovMgZ9o08TSvM0YE+ZnGfJ9PQx1VWxn2EvFIy+h9b01JJ7Xw+NcDmBg7djD+mrozlhRujkaLmEtc+wn0ZqYGy9u4YpBN5tq83ymQL3iwOk2wVrffExu0COlqzDwcsxzdOfScWHBSBmUNwyldDCdzyFvCW0J7pffl27QppzGvSPxJvzcXuYiVTrZCdtOuHat18eHAoavXMhPrxzw2whc/0nM/OucHGSrPvLvK/YptvOwnOAzOIY237+y1vAwKjoHaboVmBTFBHF3EsARsiOFHSdmBQv47Dcc4eOpDnx/mKesagy0aH66lCVtWrfLfN56LrE62OfF1uCrsCrwjS+C5R0RAgW/Ug3Tip9vosNo9zS1UZY7pOg6ESTMR+9fl65rbBPewhxoY4GIpcyT7LYYpAMLiPfT9xThVtde12pmoWLU4vhyAhw/B5C55IrUpCxHEz0VR8wfFNhWbjyicH20ye4pVcvFMKyaTEuVHw28VutdQRe4LzYYkjWMxwpB0pKlnuu9cbZecLQ5Rpbrsd5U7L+138z+ktXEgbgHiLIPs1l7S7nprvpQCK6dF/6lTzdq0finae0wDCBVSxuoDkMHJdw6RdyEiOisw0PQHujtcmpKe8Gu3iG8uAbSKHTcGbcF4XrOUR8UL9Uk0u5zBd+3ul6xlJORf8KtRYHc5XA7G8LYnhz9Q9mm87MkCDvkTjCLUMfYhDaBtXQDv2ahUrLo7Iuf7OjrDUfPZC2gGcpWfQ8DQjajGrvLPd0TMYhEp7WtnWzQHjoM9F018cbgC6kuZrN/SijNjrb76ccj+aQLrVsLldzAvjU6XJLJ6ba7s1sk4jYccZjXO27Yn49a2i6QCbYKuFaUlZSMHbFL9E/x6Hs+vfTsWgIYWxFCbkgXsgoxL6OkX25P3y3m/9Pp/GQzO02Bal8yaFln4E93eBwQM7ROVCCuXkvo2JUitS1CtBnQdsSUQg9OYZZltDJRb4EaA=",
        "X-OriginatorOrg": "iopsys.eu",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 737b5693-0a47-478c-735e-08de063cc19e",
        "X-MS-Exchange-CrossTenant-AuthSource": "GV2PR08MB8121.eurprd08.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "08 Oct 2025 07:31:55.1596 (UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "8d891be1-7bce-4216-9a99-bee9de02ba58",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n u23niNfAs+CA5OFHbO2AtvehaEuVOPco3+Fg/9ZoxJvOKnp7yKiJrXOjIaqjl9B9WibAA1Z+/Hx0PHDfkl61gI4anfJQ99m1AwoZ6SXbgFQ=",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM8PR08MB6579",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "The commit 997786bbf473 (\"drivers/net/airoha_eth: fix stalling in package\nreceiving\") can be improved. Instead of returning previous descriptor\nit's possible:\n * do nothing in even descriptor case\n * return 2 descriptor to the queue (current and previous) in the odd\n   descriptor case.\n\nThis patch:\n * implements above approach\n * remove logic not required within new approach\n * adds note that PKTBUFSRX must be even and larger than 7\n   for reliable driver operations\n\nSigned-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>\n---\n drivers/net/airoha_eth.c | 40 +++++++++++++++++++++-------------------\n 1 file changed, 21 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c\nindex 6588eb3a806..19c3d60044c 100644\n--- a/drivers/net/airoha_eth.c\n+++ b/drivers/net/airoha_eth.c\n@@ -449,14 +449,10 @@ static int airoha_qdma_init_rx_queue(struct airoha_queue *q,\n \t\t\tRX_RING_SIZE_MASK,\n \t\t\tFIELD_PREP(RX_RING_SIZE_MASK, ndesc));\n \n-\t/*\n-\t * See arht_eth_free_pkt() for the reasons used to fill\n-\t * REG_RX_CPU_IDX(qid) register.\n-\t */\n \tairoha_qdma_rmw(qdma, REG_RX_RING_SIZE(qid), RX_RING_THR_MASK,\n \t\t\tFIELD_PREP(RX_RING_THR_MASK, 0));\n \tairoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,\n-\t\t\tFIELD_PREP(RX_RING_CPU_IDX_MASK, q->ndesc - 3));\n+\t\t\tFIELD_PREP(RX_RING_CPU_IDX_MASK, q->ndesc - 1));\n \tairoha_qdma_rmw(qdma, REG_RX_DMA_IDX(qid), RX_RING_DMA_IDX_MASK,\n \t\t\tFIELD_PREP(RX_RING_DMA_IDX_MASK, q->head));\n \n@@ -920,7 +916,6 @@ static int arht_eth_free_pkt(struct udevice *dev, uchar *packet, int length)\n \tstruct airoha_qdma *qdma = &eth->qdma[0];\n \tstruct airoha_queue *q;\n \tint qid;\n-\tu16 prev, pprev;\n \n \tif (!packet)\n \t\treturn 0;\n@@ -930,22 +925,29 @@ static int arht_eth_free_pkt(struct udevice *dev, uchar *packet, int length)\n \n \t/*\n \t * Due to cpu cache issue the airoha_qdma_reset_rx_desc() function\n-\t * will always touch 2 descriptors:\n-\t *   - if current descriptor is even, then the previous and the one\n-\t *     before previous descriptors will be touched (previous cacheline)\n-\t *   - if current descriptor is odd, then only current and previous\n-\t *     descriptors will be touched (current cacheline)\n+\t * will always touch 2 descriptors placed on the same cacheline:\n+\t *   - if current descriptor is even, then current and next\n+\t *     descriptors will be touched\n+\t *   - if current descriptor is odd, then current and previous\n+\t *     descriptors will be touched\n \t *\n-\t * Thus, to prevent possible destroying of rx queue, only (q->ndesc - 2)\n-\t * descriptors might be used for packet receiving.\n+\t * Thus, to prevent possible destroying of rx queue, we should:\n+\t *   - do nothing in the even descriptor case,\n+\t *   - utilize 2 descriptors (current and previous one) in the\n+\t *     odd descriptor case.\n+\t *\n+\t * WARNING: Observations shows that PKTBUFSRX must be even and\n+\t *          larger than 7 for reliable driver operations.\n \t */\n-\tprev  = (q->head + q->ndesc - 1) % q->ndesc;\n-\tpprev = (q->head + q->ndesc - 2) % q->ndesc;\n-\tq->head = (q->head + 1) % q->ndesc;\n+\tif (q->head & 0x01) {\n+\t\tairoha_qdma_reset_rx_desc(q, q->head - 1);\n+\t\tairoha_qdma_reset_rx_desc(q, q->head);\n \n-\tairoha_qdma_reset_rx_desc(q, prev);\n-\tairoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,\n-\t\t\tFIELD_PREP(RX_RING_CPU_IDX_MASK, pprev));\n+\t\tairoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,\n+\t\t\t\tFIELD_PREP(RX_RING_CPU_IDX_MASK, q->head));\n+\t}\n+\n+\tq->head = (q->head + 1) % q->ndesc;\n \n \treturn 0;\n }\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}