On 1/23/26 20:12, Gregory Price wrote:
On Fri, Jan 23, 2026 at 06:25:26PM +0000, Jonathan Cameron wrote:
On Thu, 22 Jan 2026 19:34:10 -0500
Gregory Price <[email protected]> wrote:
Ah, this was lost on me.
unclear to me how to restrict a function to specific drivers, but i can
add add_and_online_memory_driver_managed() trivially so no big issue.
Is EXPORT_SYMBOL_GPL_FOR_MODULE() enough?
It's also fine for me to just limit add_memory_driver_managed() to
in-tree driver by using EXPORT_SYMBOL_FOR_MODULES.
But it might make nvidia unhappy :)
So maybe just adding a __add_memory_driver_managed() that gives us more
control and using EXPORT_SYMBOL_FOR_MODULES is being a bit nicer for OOT
modules.
(I guess __add_memory_driver_managed is a better name than
add_and_online_memory_driver_managed, thinking about it)
Is the issue just that add_memory_driver_manage is `extern`?
Heh, the "extern" is simply not necessary and can be dropped from all
such functions. Not related to this. It's all about EXPORT_SYMBOL_GPL
allowing anything that claims to be a GPL module to use this functionality.
If so
yeah, i can just do the EXPORT_*_GPL path.
If you prefer FOR_MODULE, then yes I can do this.
I'd go for
EXPORT_SYMBOL_FOR_MODULES(__add_memory_driver_managed, "dax")
(or would it be the kmem module?)
--
Cheers
David