From 057d44b057755f31a38a3cb040960e8727b93610 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Fri, 26 Dec 2025 20:17:07 +0000 Subject: rust: Add soc_device support Allow SoC drivers in Rust to present metadata about their devices to userspace through /sys/devices/socX and other drivers to identify their properties through `soc_device_match`. Signed-off-by: Matthew Maurer Link: https://patch.msgid.link/20251226-soc-bindings-v4-1-2c2fac08f820@google.com Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 5b11839cba9d..6cce4538eda0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7700,6 +7700,7 @@ F: rust/kernel/devres.rs F: rust/kernel/driver.rs F: rust/kernel/faux.rs F: rust/kernel/platform.rs +F: rust/kernel/soc.rs F: samples/rust/rust_debugfs.rs F: samples/rust/rust_debugfs_scoped.rs F: samples/rust/rust_driver_platform.rs -- cgit v1.2.3 From d43a12e474351161bb6d7e2a17ab56f591b9302d Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Fri, 26 Dec 2025 20:17:09 +0000 Subject: rust: Add SoC Driver Sample Shows registration of a SoC device upon receipt of a probe. Signed-off-by: Matthew Maurer Link: https://patch.msgid.link/20251226-soc-bindings-v4-3-2c2fac08f820@google.com Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 6cce4538eda0..7120b894b182 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7705,6 +7705,7 @@ F: samples/rust/rust_debugfs.rs F: samples/rust/rust_debugfs_scoped.rs F: samples/rust/rust_driver_platform.rs F: samples/rust/rust_driver_faux.rs +F: samples/rust/rust_soc.rs DRIVERS FOR OMAP ADAPTIVE VOLTAGE SCALING (AVS) M: Nishanth Menon -- cgit v1.2.3 From 303db924fe0bb298242694c0c36fa1890cc9cf33 Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Tue, 13 Jan 2026 13:03:42 +0100 Subject: MAINTAINERS: update auxiliary bus entry The auxiliary bus is part of the driver-core infrastructure, hence add missing driver-core maintainers to the auxiliary bus entry. Signed-off-by: Danilo Krummrich Acked-by: Rafael J. Wysocki Link: https://patch.msgid.link/20260113120345.4639-1-dakr@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 4ef6015a34ed..54ea68a0883d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4164,6 +4164,8 @@ F: scripts/Makefile.autofdo AUXILIARY BUS DRIVER M: Greg Kroah-Hartman +M: "Rafael J. Wysocki" +M: Danilo Krummrich R: Dave Ertman R: Ira Weiny R: Leon Romanovsky -- cgit v1.2.3 From 62eb557580eb2177cf16c3fd2b6efadff297b29a Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Fri, 16 Jan 2026 08:02:33 +0000 Subject: revocable: Revocable resource management Some resources can be removed asynchronously, for example, resources provided by a hot-pluggable device like USB. When holding a reference to such a resource, it's possible for the resource to be removed and its memory freed, leading to use-after-free errors on subsequent access. The "revocable" mechanism addresses this by establishing a weak reference to a resource that might be freed at any time. It allows a resource consumer to safely attempt to access the resource, guaranteeing that the access is valid for the duration of its use, or it fails safely if the resource has already been revoked. The implementation uses a provider/consumer model built on Sleepable RCU (SRCU) to guarantee safe memory access: - A resource provider, such as a driver for a hot-pluggable device, allocates a struct revocable_provider and initializes it with a pointer to the resource. - A resource consumer that wants to access the resource allocates a struct revocable which acts as a handle containing a reference to the provider. - To access the resource, the consumer uses revocable_try_access(). This function enters an SRCU read-side critical section and returns the pointer to the resource. If the provider has already freed the resource, it returns NULL. After use, the consumer calls revocable_withdraw_access() to exit the SRCU critical section. The REVOCABLE_TRY_ACCESS_WITH() and REVOCABLE_TRY_ACCESS_SCOPED() are convenient helpers for doing that. - When the provider needs to remove the resource, it calls revocable_provider_revoke(). This function sets the internal resource pointer to NULL and then calls synchronize_srcu() to wait for all current readers to finish before the resource can be completely torn down. Acked-by: Danilo Krummrich Signed-off-by: Tzung-Bi Shih Link: https://patch.msgid.link/20260116080235.350305-2-tzungbi@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 54ea68a0883d..f873553d4543 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22368,6 +22368,13 @@ F: include/uapi/linux/rseq.h F: kernel/rseq.c F: tools/testing/selftests/rseq/ +REVOCABLE RESOURCE MANAGEMENT +M: Tzung-Bi Shih +L: linux-kernel@vger.kernel.org +S: Maintained +F: drivers/base/revocable.c +F: include/linux/revocable.h + RFKILL M: Johannes Berg L: linux-wireless@vger.kernel.org -- cgit v1.2.3 From cd7693419bb5abd91ad2f407dab69c480e417a61 Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Fri, 16 Jan 2026 08:02:34 +0000 Subject: revocable: Add Kunit test cases Add Kunit test cases for the revocable API. The test cases cover the following scenarios: - Basic: Verifies that a consumer can successfully access the resource provided via the provider. - Revocation: Verifies that after the provider revokes the resource, the consumer correctly receives a NULL pointer on a subsequent access. - Try Access Macro: Same as "Revocation" but uses the REVOCABLE_TRY_ACCESS_WITH() and REVOCABLE_TRY_ACCESS_SCOPED(). A way to run the test: $ ./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_REVOCABLE_KUNIT_TEST=y \ revocable_test Signed-off-by: Tzung-Bi Shih Link: https://patch.msgid.link/20260116080235.350305-3-tzungbi@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index f873553d4543..6762bcffb1aa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22373,6 +22373,7 @@ M: Tzung-Bi Shih L: linux-kernel@vger.kernel.org S: Maintained F: drivers/base/revocable.c +F: drivers/base/revocable_test.c F: include/linux/revocable.h RFKILL -- cgit v1.2.3 From 9d4502fef00fa7a798d3c0806d4da4466a7ffc6f Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Fri, 16 Jan 2026 08:02:35 +0000 Subject: selftests: revocable: Add kselftest cases Add kselftest cases for the revocable API. The test consists of three parts: - A kernel module (revocable_test.ko) that creates a debugfs interface with `/provider` and `/consumer` files. - A user-space C program (revocable_test) that uses the kselftest harness to interact with the debugfs files. - An orchestrating shell script (test-revocable.sh) that loads the module, runs the C program, and unloads the module. The test cases cover the following scenarios: - Basic: Verifies that a consumer can successfully access the resource provided via the provider. - Revocation: Verifies that after the provider revokes the resource, the consumer correctly receives a NULL pointer on a subsequent access. - Try Access Macro: Same as "Revocation" but uses the REVOCABLE_TRY_ACCESS_WITH() and REVOCABLE_TRY_ACCESS_SCOPED(). Signed-off-by: Tzung-Bi Shih Link: https://patch.msgid.link/20260116080235.350305-4-tzungbi@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 6762bcffb1aa..6aab211f1630 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22375,6 +22375,7 @@ S: Maintained F: drivers/base/revocable.c F: drivers/base/revocable_test.c F: include/linux/revocable.h +F: tools/testing/selftests/drivers/base/revocable/ RFKILL M: Johannes Berg -- cgit v1.2.3 From 61f5ec54c8a64c8b2d035215294389dd021318c7 Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Thu, 15 Jan 2026 23:03:31 +0100 Subject: MAINTAINERS: driver-core: add driver-model documentation Documentation/driver-api/driver-model/ is missing in the driver-core MAINTAINERS entry, hence add it. Reviewed-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20260115220350.6806-1-dakr@kernel.org Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 6aab211f1630..3cf5466c3948 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7686,6 +7686,7 @@ M: Danilo Krummrich S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git F: Documentation/core-api/kobject.rst +F: Documentation/driver-api/driver-model/ F: drivers/base/ F: fs/debugfs/ F: fs/sysfs/ -- cgit v1.2.3 From 428ad969c304bf94e11288dbfb4033baaa873a9f Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Tue, 20 Jan 2026 13:38:52 +0100 Subject: MAINTAINERS: Add driver-core mailing list Add the driver-core mailing list for all entries maintained under the driver-core tree. If existent, replace linux-kernel and rust-for-linux list entries, as they're automatically picked up by scripts/get_maintainer.pl. Acked-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20260120123925.28267-1-dakr@kernel.org Signed-off-by: Danilo Krummrich --- MAINTAINERS | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 3cf5466c3948..1f15d4a5b9a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4169,6 +4169,7 @@ M: Danilo Krummrich R: Dave Ertman R: Ira Weiny R: Leon Romanovsky +L: driver-core@lists.linux.dev S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git F: Documentation/driver-api/auxiliary_bus.rst @@ -7218,7 +7219,7 @@ DEVICE I/O & IRQ [RUST] M: Danilo Krummrich M: Alice Ryhl M: Daniel Almeida -L: rust-for-linux@vger.kernel.org +L: driver-core@lists.linux.dev S: Supported W: https://rust-for-linux.com B: https://github.com/Rust-for-Linux/linux/issues @@ -7469,7 +7470,7 @@ R: Abdiel Janulgue R: Daniel Almeida R: Robin Murphy R: Andreas Hindborg -L: rust-for-linux@vger.kernel.org +L: driver-core@lists.linux.dev S: Supported W: https://rust-for-linux.com T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git @@ -7683,6 +7684,7 @@ DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS M: Greg Kroah-Hartman M: "Rafael J. Wysocki" M: Danilo Krummrich +L: driver-core@lists.linux.dev S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git F: Documentation/core-api/kobject.rst @@ -9826,7 +9828,7 @@ FIRMWARE LOADER (request_firmware) M: Luis Chamberlain M: Russ Weight M: Danilo Krummrich -L: linux-kernel@vger.kernel.org +L: driver-core@lists.linux.dev S: Maintained F: Documentation/firmware_class/ F: drivers/base/firmware_loader/ @@ -13944,6 +13946,7 @@ F: tools/testing/selftests/kvm/x86/ KERNFS M: Greg Kroah-Hartman M: Tejun Heo +L: driver-core@lists.linux.dev S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git F: fs/kernfs/ -- cgit v1.2.3 From 7d3825bfb54239c49284c5770a4d421daf5470ba Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Tue, 20 Jan 2026 13:38:53 +0100 Subject: MAINTAINERS: Add missing T: entry for FIRMWARE LOADER The firmware loader is maintained through the driver-core tree, hence add a corresponding T: entry. Acked-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20260120123925.28267-2-dakr@kernel.org Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 1f15d4a5b9a5..7faf04cc4278 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9830,6 +9830,7 @@ M: Russ Weight M: Danilo Krummrich L: driver-core@lists.linux.dev S: Maintained +T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git F: Documentation/firmware_class/ F: drivers/base/firmware_loader/ F: rust/kernel/firmware.rs -- cgit v1.2.3 From 379a5aad4e8ce7bd0b1600c03ae0c9a28f66a183 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 4 Feb 2026 15:28:47 +0100 Subject: Revert "selftests: revocable: Add kselftest cases" This reverts commit 9d4502fef00fa7a798d3c0806d4da4466a7ffc6f. The new revocable functionality is fundamentally broken and at a minimum needs to be redesigned. Drop the revocable selftests to allow the implementation to be reverted. Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260204142849.22055-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index b277baee5eb6..7759e9103070 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22392,7 +22392,6 @@ S: Maintained F: drivers/base/revocable.c F: drivers/base/revocable_test.c F: include/linux/revocable.h -F: tools/testing/selftests/drivers/base/revocable/ RFKILL M: Johannes Berg -- cgit v1.2.3 From 7149ce34dd48886b3f69153c7f5533dd3fd5f47e Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 4 Feb 2026 15:28:48 +0100 Subject: Revert "revocable: Add Kunit test cases" This reverts commit cd7693419bb5abd91ad2f407dab69c480e417a61. The new revocable functionality is fundamentally broken and at a minimum needs to be redesigned. Drop the revocable Kunit tests to allow the implementation to be reverted. Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260204142849.22055-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 7759e9103070..93c07c645c68 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22390,7 +22390,6 @@ M: Tzung-Bi Shih L: linux-kernel@vger.kernel.org S: Maintained F: drivers/base/revocable.c -F: drivers/base/revocable_test.c F: include/linux/revocable.h RFKILL -- cgit v1.2.3 From 21bab791346e5b7902a04709231c0642ff6d69bc Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 4 Feb 2026 15:28:49 +0100 Subject: Revert "revocable: Revocable resource management" This reverts commit 62eb557580eb2177cf16c3fd2b6efadff297b29a. The revocable implementation uses two separate abstractions, struct revocable_provider and struct revocable, in order to store the SRCU read lock index which must be passed unaltered to srcu_read_unlock() in the same context when a resource is no longer needed. With the merged revocable API, multiple threads could however share the same struct revocable and therefore potentially overwrite the SRCU index of another thread which can cause the SRCU synchronisation in revocable_provider_revoke() to never complete. [1] An example revocable conversion of the gpiolib code also turned out to be fundamentally flawed and could lead to use-after-free. [2] An attempt to address both issues was quickly put together and merged, but revocable is still fundamentally broken. [3] Specifically, the latest design relies on RCU for storing a pointer to the revocable provider, but since the resource can be shared by value (e.g. as in the now reverted selftests) this does not work at all and can also lead to use-after-free: static void revocable_provider_release(struct kref *kref) { struct revocable_provider *rp = container_of(kref, struct revocable_provider, kref); cleanup_srcu_struct(&rp->srcu); kfree_rcu(rp, rcu); } void revocable_provider_revoke(struct revocable_provider __rcu **rp_ptr) { struct revocable_provider *rp; rp = rcu_replace_pointer(*rp_ptr, NULL, 1); ... kref_put(&rp->kref, revocable_provider_release); } int revocable_init(struct revocable_provider __rcu *_rp, struct revocable *rev) { struct revocable_provider *rp; ... scoped_guard(rcu) { rp = rcu_dereference(_rp); if (!rp) return -ENODEV; if (!kref_get_unless_zero(&rp->kref)) return -ENODEV; } ... } producer: priv->rp = revocable_provider_alloc(&priv->res); // pass priv->rp by value to consumer revocable_provider_revoke(&priv->rp); consumer: struct revocable_provider __rcu *rp = filp->private_data; struct revocable *rev; revocable_init(rp, &rev); as _rp would still be non-NULL in revocable_init() regardless of whether the producer has revoked the resource and set its pointer to NULL. Essentially revocable still relies on having a pointer to reference counted driver data which holds the revocable provider, which makes all the RCU protection unnecessary along with most of the current revocable design and implementation. As the above shows, and as has been pointed out repeatedly elsewhere, these kind of issues are not something that should be addressed incrementally. [4] Revert the revocable implementation until a redesign has been proposed and evaluated properly. Link: https://lore.kernel.org/all/20260124170535.11756-4-johan@kernel.org/ [1] Link: https://lore.kernel.org/all/aXT45B6vLf9R3Pbf@hovoldconsulting.com/ [2] Link: https://lore.kernel.org/all/20260129143733.45618-1-tzungbi@kernel.org/ [3] Link: https://lore.kernel.org/all/aXobzoeooJqxMkEj@hovoldconsulting.com/ [4] Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260204142849.22055-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 7 ------- 1 file changed, 7 deletions(-) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 93c07c645c68..1c5ceccc9928 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22385,13 +22385,6 @@ F: include/uapi/linux/rseq.h F: kernel/rseq.c F: tools/testing/selftests/rseq/ -REVOCABLE RESOURCE MANAGEMENT -M: Tzung-Bi Shih -L: linux-kernel@vger.kernel.org -S: Maintained -F: drivers/base/revocable.c -F: include/linux/revocable.h - RFKILL M: Johannes Berg L: linux-wireless@vger.kernel.org -- cgit v1.2.3