get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196251,
    "url": "http://patchwork.ozlabs.org/api/patches/2196251/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260213092958.864411-8-tzungbi@kernel.org/",
    "project": {
        "id": 42,
        "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api",
        "name": "Linux GPIO development",
        "link_name": "linux-gpio",
        "list_id": "linux-gpio.vger.kernel.org",
        "list_email": "linux-gpio@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260213092958.864411-8-tzungbi@kernel.org>",
    "list_archive_url": null,
    "date": "2026-02-13T09:29:54",
    "name": "[v3,07/11] gpio: Add revocable provider handle for struct gpio_chip",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a23c9ad7949918c10ed545abd3f6999b0199f9df",
    "submitter": {
        "id": 83557,
        "url": "http://patchwork.ozlabs.org/api/people/83557/?format=api",
        "name": "Tzung-Bi Shih",
        "email": "tzungbi@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260213092958.864411-8-tzungbi@kernel.org/mbox/",
    "series": [
        {
            "id": 492068,
            "url": "http://patchwork.ozlabs.org/api/series/492068/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=492068",
            "date": "2026-02-13T09:29:47",
            "name": "gpio: Adopt revocable mechanism for UAF prevention",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/492068/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196251/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196251/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-gpio+bounces-31664-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-gpio@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=PCboUjWN;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-31664-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"PCboUjWN\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fC6Sp0l6Gz1xxM\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 20:34:34 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 9823B316D735\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 09:31:24 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 3AB29310651;\n\tFri, 13 Feb 2026 09:31:24 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id ED35732FA0D;\n\tFri, 13 Feb 2026 09:31:23 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id EBE1DC19421;\n\tFri, 13 Feb 2026 09:31:20 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1770975084; cv=none;\n b=fY5r2b7rx3AqVeBIWGpoGQk6OD/fgED40PQp2IhleGPCuJ11AlaR5zMSgJ4A90K/rZ1x5eQdhpoySIi3KVgyfdsRjip1uY2g36S1CpYxvL+eWJjH+Tes/i29Y22goMt80Op4BOwFL3WnCVfssxI1gWJKPBdUZUeeU4vmvlpZTX0=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1770975084; c=relaxed/simple;\n\tbh=lOvVM0s0yLJNqglO3n3zKCRlmz00D9/9tjJ5GMv3RjA=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=CG6EisafcHklXUwnvXhkh9bsdV3mj0EEEhTea4GkqbTJGTcm9xKha5dzGGLhOkoQ2LeV9VavwrUDd/Wl+WFMXChsMmLmDTP3TsmV6YIowZGE7rb8D46CiM26yqe6upMNMzC18zF6TipZnw3fbYg9cmm3+7w3Oh4EVRdlgsWYW8s=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=PCboUjWN; arc=none smtp.client-ip=10.30.226.201",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1770975083;\n\tbh=lOvVM0s0yLJNqglO3n3zKCRlmz00D9/9tjJ5GMv3RjA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PCboUjWNXIBsPhFBy9G8zBOKrFO8/WfwUIKn++enI5Z0m7gs7D9eljeNQgMg2cTCf\n\t J5gdqHVzfIj1qT+AEqpatv8u4gEm7M5GE+Ap+jbJdcKNftkZs7jlbd1nJWQFlN3js0\n\t RlD3VvLokn00reGLZMosApmb5vLN8Axg9UHJAwySlzlZSxJNo9ye/nSaKK4gUAtoCb\n\t 18wnYfYGYO+5c0e5iY6KofHzQ/DGp1+HyqArQphTbmg8ryUdKVSfhfynSjLVNpSHm0\n\t q4OKcNokBcUUw1iRgYM/6/vIMGmPpPSzkMNelpisBw/3iBflgATl3ShZefXEwKPx+F\n\t 3FqGGecEORDkQ==",
        "From": "Tzung-Bi Shih <tzungbi@kernel.org>",
        "To": "Bartosz Golaszewski <brgl@kernel.org>,\n\tLinus Walleij <linusw@kernel.org>",
        "Cc": "Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\t\"Rafael J. Wysocki\" <rafael@kernel.org>,\n\tDanilo Krummrich <dakr@kernel.org>,\n\tJonathan Corbet <corbet@lwn.net>,\n\tShuah Khan <shuah@kernel.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tWolfram Sang <wsa+renesas@sang-engineering.com>,\n\tJason Gunthorpe <jgg@nvidia.com>,\n\tJohan Hovold <johan@kernel.org>,\n\t\"Paul E . McKenney\" <paulmck@kernel.org>,\n\tDan Williams <dan.j.williams@intel.com>,\n\tchrome-platform@lists.linux.dev,\n\ttzungbi@kernel.org,\n\tlinux-gpio@vger.kernel.org,\n\tlinux-kselftest@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org",
        "Subject": "[PATCH v3 07/11] gpio: Add revocable provider handle for struct\n gpio_chip",
        "Date": "Fri, 13 Feb 2026 09:29:54 +0000",
        "Message-ID": "<20260213092958.864411-8-tzungbi@kernel.org>",
        "X-Mailer": "git-send-email 2.53.0.310.g728cabbaf7-goog",
        "In-Reply-To": "<20260213092958.864411-1-tzungbi@kernel.org>",
        "References": "<20260213092958.864411-1-tzungbi@kernel.org>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-gpio@vger.kernel.org",
        "List-Id": "<linux-gpio.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "The underlying chip can be removed asynchronously.  `gdev->srcu` is used\nto ensure the synchronization before accessing `gdev->chip`.\n\nRevocable encapsulates the details.  Add revocable provider handle for\nthe corresponding struct gpio_chip in struct gpio_device so that it can\nstart to hide the synchronization details.\n\nSigned-off-by: Tzung-Bi Shih <tzungbi@kernel.org>\n---\nv3:\n- Change revocable API usages accordingly.\n\nv2: https://lore.kernel.org/all/20260203061059.975605-8-tzungbi@kernel.org\n- Change usages accordingly after applying\n  https://lore.kernel.org/all/20260129143733.45618-2-tzungbi@kernel.org.\n  - Add __rcu for `chip_rp`.\n  - Pass pointer of pointer to revocable_provider_revoke().\n- Rebase accordingly after applying\n  https://lore.kernel.org/all/20260203060210.972243-1-tzungbi@kernel.org.\n\nv1: https://lore.kernel.org/all/20260116081036.352286-13-tzungbi@kernel.org\n\n drivers/gpio/gpiolib.c | 16 ++++++++++++++--\n drivers/gpio/gpiolib.h |  2 ++\n 2 files changed, 16 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c\nindex 74ee7bfb974c..7ef4dc4e6e9e 100644\n--- a/drivers/gpio/gpiolib.c\n+++ b/drivers/gpio/gpiolib.c\n@@ -22,6 +22,7 @@\n #include <linux/nospec.h>\n #include <linux/of.h>\n #include <linux/pinctrl/consumer.h>\n+#include <linux/revocable.h>\n #include <linux/seq_file.h>\n #include <linux/slab.h>\n #include <linux/srcu.h>\n@@ -869,6 +870,8 @@ static void gpiodev_release(struct device *dev)\n \tsynchronize_srcu(&gdev->desc_srcu);\n \tcleanup_srcu_struct(&gdev->desc_srcu);\n \n+\tif (gdev->chip_rp)\n+\t\trevocable_put(gdev->chip_rp);\n \tida_free(&gpio_ida, gdev->id);\n \tkfree_const(gdev->label);\n \tkfree(gdev->descs);\n@@ -1115,6 +1118,12 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \t\tgoto err_put_device;\n \t}\n \n+\tgdev->chip_rp = revocable_alloc(gc);\n+\tif (!gdev->chip_rp) {\n+\t\tret = -ENOMEM;\n+\t\tgoto err_put_device;\n+\t}\n+\n \tgdev->can_sleep = gc->can_sleep;\n \trwlock_init(&gdev->line_state_lock);\n \tRAW_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);\n@@ -1144,7 +1153,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \t\t\tif (base < 0) {\n \t\t\t\tret = base;\n \t\t\t\tbase = 0;\n-\t\t\t\tgoto err_put_device;\n+\t\t\t\tgoto err_free_rp;\n \t\t\t}\n \n \t\t\t/*\n@@ -1164,7 +1173,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \t\tret = gpiodev_add_to_list_unlocked(gdev);\n \t\tif (ret) {\n \t\t\tgpiochip_err(gc, \"GPIO integer space overlap, cannot add chip\\n\");\n-\t\t\tgoto err_put_device;\n+\t\t\tgoto err_free_rp;\n \t\t}\n \t}\n \n@@ -1261,6 +1270,8 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \tscoped_guard(mutex, &gpio_devices_lock)\n \t\tlist_del_rcu(&gdev->list);\n \tsynchronize_srcu(&gpio_devices_srcu);\n+err_free_rp:\n+\trevocable_revoke(gdev->chip_rp);\n err_put_device:\n \tgpio_device_put(gdev);\n \tgoto err_print_message;\n@@ -1307,6 +1318,7 @@ void gpiochip_remove(struct gpio_chip *gc)\n \t/* Numb the device, cancelling all outstanding operations */\n \trcu_assign_pointer(gdev->chip, NULL);\n \tsynchronize_srcu(&gdev->srcu);\n+\trevocable_revoke(gdev->chip_rp);\n \tgpio_device_teardown_shared(gdev);\n \tgpiochip_irqchip_remove(gc);\n \tacpi_gpiochip_remove(gc);\ndiff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h\nindex 3abb90385829..56643f40e87e 100644\n--- a/drivers/gpio/gpiolib.h\n+++ b/drivers/gpio/gpiolib.h\n@@ -52,6 +52,7 @@\n  * @device_notifier: used to notify character device wait queues about the GPIO\n  *                   device being unregistered\n  * @srcu: protects the pointer to the underlying GPIO chip\n+ * @chip_rp: revocable provider handle for the corresponding struct gpio_chip.\n  * @pin_ranges: range of pins served by the GPIO driver\n  *\n  * This state container holds most of the runtime variable data\n@@ -79,6 +80,7 @@ struct gpio_device {\n \tstruct workqueue_struct\t*line_state_wq;\n \tstruct blocking_notifier_head device_notifier;\n \tstruct srcu_struct\tsrcu;\n+\tstruct revocable\t*chip_rp;\n \n #ifdef CONFIG_PINCTRL\n \t/*\n",
    "prefixes": [
        "v3",
        "07/11"
    ]
}