]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drivers/base: Extend documentation with preferred way to use auxbus
authorLeon Romanovsky <leon@kernel.org>
Tue, 1 Apr 2025 12:28:46 +0000 (15:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 16:10:28 +0000 (18:10 +0200)
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>
drivers/base/auxiliary.c

index afa4df4c5a3f371b91d8dd8c4325495d32ad1291..95717d509ca99d44b8beab381a3c895c3bd89236 100644 (file)
  *             },
  *             .ops = my_custom_ops,
  *     };
+ *
+ * Please note that such custom ops approach is valid, but it is hard to implement
+ * it right without global locks per-device to protect from auxiliary_drv removal
+ * during call to that ops. In addition, this implementation lacks proper module
+ * dependency, which causes to load/unload races between auxiliary parent and devices
+ * modules.
+ *
+ * The most easiest way to provide these ops reliably without needing to
+ * have a lock is to EXPORT_SYMBOL*() them and rely on already existing
+ * modules infrastructure for validity and correct dependencies chains.
  */
 
 static const struct auxiliary_device_id *auxiliary_match_id(const struct auxiliary_device_id *id,