Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2228936/?format=api
{ "id": 2228936, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228936/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427135841.96266-4-tzungbi@kernel.org/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260427135841.96266-4-tzungbi@kernel.org>", "date": "2026-04-27T13:58:35", "name": "[v9,3/9] gpio: Add revocable provider handle for struct gpio_chip", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "01a9a342dd395e35d0a0720cba17e5b865ac1a38", "submitter": { "id": 83557, "url": "http://patchwork.ozlabs.org/api/1.1/people/83557/?format=api", "name": "Tzung-Bi Shih", "email": "tzungbi@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427135841.96266-4-tzungbi@kernel.org/mbox/", "series": [ { "id": 501655, "url": "http://patchwork.ozlabs.org/api/1.1/series/501655/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501655", "date": "2026-04-27T13:58:32", "name": "drivers/base: Introduce revocable", "version": 9, "mbox": "http://patchwork.ozlabs.org/series/501655/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228936/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228936/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-35576-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=UQFCB0i8;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35576-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=\"UQFCB0i8\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 4g450D0sxVz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 00:04:12 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 1725F3089175\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 13:59:42 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A60E73D1CA5;\n\tMon, 27 Apr 2026 13:59:41 +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 56D6E3D091F;\n\tMon, 27 Apr 2026 13:59:41 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 6BE6EC19425;\n\tMon, 27 Apr 2026 13:59:37 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777298381; cv=none;\n b=OjfbEbk9CMfJt13LVcYXjPzi+5ckVHJylSIAEtpu6MeisdHgWs5TxBM75PWcDxvX7lfZo9/avu7D2eMvw4pfU/jnJSyfp6buLJqLQkGNWPNpWTQ2GR2rOn+e12618J31UMw0GG3e/26oB13OlQ69xxn438ZWhzzecjAGmLH3Vg8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777298381; c=relaxed/simple;\n\tbh=irxhZkaKfHIdVHdouqfkKfKuqE/ET7mMdjnf9j6+Uqs=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=kDbGW1aU4D0q0r5X0J0+NsVjH5mx0QTeqxlQVRh5MiTj7zkQ82Mml3tEdVQXCsiGzCQ3MrFx2Q7klFXbMb6pmEbbTZJFKtVODlbmvUE8F9+pbP+XaLVEc3Qm4QuKn0MCuUDd6uF54fKOrbqwprxJcRP54V8b2DYGeFfEHA4lrXA=", "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=UQFCB0i8; 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=1777298381;\n\tbh=irxhZkaKfHIdVHdouqfkKfKuqE/ET7mMdjnf9j6+Uqs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=UQFCB0i8RnoicHTdB5ChZ9u5kx/wt8bHiruBuO6TOzJ4E1WFCJSYjUEjnObXvupAE\n\t ubwhaySFuk3vfT4udljzz1D8i8eictuz2oxMMl5gJouZ5YPMmWNc2pPjMNvltFYOVh\n\t qKY70/u64NryUQbffWGc6wU8Js3JZznCpMi09fnz94vz5l6/o6yfFxUcxwVC0uNt0u\n\t 5b7hrKqDtqwSNmoF+DMTnBj7swxbIcnrvb/JNJp7WKrijPCxPHHbqDnjLl7zc8HZeu\n\t cSGh3ai2LrbEPC5HfmFZYz56k1NHTpTwfJmUcKLVUXufcBwn+EYPU/GR6Nro5KeaKi\n\t YOVg5hjAIIrxg==", "From": "Tzung-Bi Shih <tzungbi@kernel.org>", "To": "Arnd Bergmann <arnd@arndb.de>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tBartosz Golaszewski <brgl@kernel.org>,\n\tLinus Walleij <linusw@kernel.org>", "Cc": "Benson Leung <bleung@chromium.org>,\n\ttzungbi@kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tchrome-platform@lists.linux.dev,\n\tdriver-core@lists.linux.dev,\n\tlinux-doc@vger.kernel.org,\n\tlinux-gpio@vger.kernel.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>", "Subject": "[PATCH v9 3/9] gpio: Add revocable provider handle for struct\n gpio_chip", "Date": "Mon, 27 Apr 2026 21:58:35 +0800", "Message-ID": "<20260427135841.96266-4-tzungbi@kernel.org>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260427135841.96266-1-tzungbi@kernel.org>", "References": "<20260427135841.96266-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---\nv9:\n- New to the series.\n- Use static allocated resource provider.\n- Rename \"chip_rp\" -> \"chip_rev\".\n\nv4 - v8:\n- Doesn't exist.\n\nv3: https://lore.kernel.org/all/20260213092958.864411-8-tzungbi@kernel.org\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---\n drivers/gpio/gpiolib.c | 7 +++++++\n drivers/gpio/gpiolib.h | 3 +++\n 2 files changed, 10 insertions(+)", "diff": "diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c\nindex 1e6dce430dca..20448d5aab93 100644\n--- a/drivers/gpio/gpiolib.c\n+++ b/drivers/gpio/gpiolib.c\n@@ -23,6 +23,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@@ -874,6 +875,7 @@ static void gpiodev_release(struct device *dev)\n \tsynchronize_srcu(&gdev->desc_srcu);\n \tcleanup_srcu_struct(&gdev->desc_srcu);\n \n+\trevocable_embed_destroy(&gdev->chip_rev);\n \tida_free(&gpio_ida, gdev->id);\n \tkfree_const(gdev->label);\n \tkfree(gdev->descs);\n@@ -1167,6 +1169,10 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \tif (ret)\n \t\tgoto err_cleanup_desc_srcu;\n \n+\tret = revocable_embed_init(&gdev->chip_rev, gc);\n+\tif (ret)\n+\t\tgoto err_cleanup_desc_srcu;\n+\n \tdevice_initialize(&gdev->dev);\n \t/*\n \t * After this point any allocated resources to `gdev` will be\n@@ -1389,6 +1395,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_rev);\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 dc4cb61a9318..4e2e98f61f5a 100644\n--- a/drivers/gpio/gpiolib.h\n+++ b/drivers/gpio/gpiolib.h\n@@ -16,6 +16,7 @@\n #include <linux/gpio/driver.h>\n #include <linux/module.h>\n #include <linux/notifier.h>\n+#include <linux/revocable.h>\n #include <linux/spinlock.h>\n #include <linux/string.h>\n #include <linux/srcu.h>\n@@ -55,6 +56,7 @@ struct fwnode_handle;\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_rev: 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@@ -82,6 +84,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\tchip_rev;\n \n #ifdef CONFIG_PINCTRL\n \t/*\n", "prefixes": [ "v9", "3/9" ] }