Skip to content

Commit 10076ae

Browse files
rleongregkh
authored andcommitted
drivers/base: Extend documentation with preferred way to use auxbus
Document the preferred way to use auxiliary bus. Signed-off-by: Leon Romanovsky <leon@kernel.org> Link: https://lore.kernel.org/r/206e8c249f630abd3661deb36b84b26282241040.1743510317.git.leon@kernel.org [ reworded the text a bit - gregkh ] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 18daa52 commit 10076ae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/base/auxiliary.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@
156156
* },
157157
* .ops = my_custom_ops,
158158
* };
159+
*
160+
* Please note that such custom ops approach is valid, but it is hard to implement
161+
* it right without global locks per-device to protect from auxiliary_drv removal
162+
* during call to that ops. In addition, this implementation lacks proper module
163+
* dependency, which causes to load/unload races between auxiliary parent and devices
164+
* modules.
165+
*
166+
* The most easiest way to provide these ops reliably without needing to
167+
* have a lock is to EXPORT_SYMBOL*() them and rely on already existing
168+
* modules infrastructure for validity and correct dependencies chains.
159169
*/
160170

161171
static const struct auxiliary_device_id *auxiliary_match_id(const struct auxiliary_device_id *id,

0 commit comments

Comments
 (0)