diff options
| author | Sudeep Holla <sudeep.holla@arm.com> | 2025-02-17 15:38:49 +0000 |
|---|---|---|
| committer | Sudeep Holla <sudeep.holla@arm.com> | 2025-02-17 15:42:04 +0000 |
| commit | 46dcd68aaccac0812c12ec3f4e59c8963e2760ad (patch) | |
| tree | 7838a3a07fd27e5f7b6959c9dbaad856c4f126e8 /include/linux/arm_ffa.h | |
| parent | 2f622a8b0722d332a2a149794a3add47bc9bdcf3 (diff) | |
firmware: arm_ffa: Unregister the FF-A devices when cleaning up the partitions
Both the FF-A core and the bus were in a single module before the
commit 18c250bd7ed0 ("firmware: arm_ffa: Split bus and driver into distinct modules").
The arm_ffa_bus_exit() takes care of unregistering all the FF-A devices.
Now that there are 2 distinct modules, if the core driver is unloaded and
reloaded, it will end up adding duplicate FF-A devices as the previously
registered devices weren't unregistered when we cleaned up the modules.
Fix the same by unregistering all the FF-A devices on the FF-A bus during
the cleaning up of the partitions and hence the cleanup of the module.
Fixes: 18c250bd7ed0 ("firmware: arm_ffa: Split bus and driver into distinct modules")
Tested-by: Viresh Kumar <viresh.kumar@linaro.org>
Message-Id: <20250217-ffa_updates-v3-8-bd1d9de615e7@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'include/linux/arm_ffa.h')
| -rw-r--r-- | include/linux/arm_ffa.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index e8b8ae8b192a..ca2ad5b0ac43 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -176,6 +176,7 @@ void ffa_device_unregister(struct ffa_device *ffa_dev); int ffa_driver_register(struct ffa_driver *driver, struct module *owner, const char *mod_name); void ffa_driver_unregister(struct ffa_driver *driver); +void ffa_devices_unregister(void); bool ffa_device_is_valid(struct ffa_device *ffa_dev); #else @@ -188,6 +189,8 @@ ffa_device_register(const struct ffa_partition_info *part_info, static inline void ffa_device_unregister(struct ffa_device *dev) {} +static inline void ffa_devices_unregister(void) {} + static inline int ffa_driver_register(struct ffa_driver *driver, struct module *owner, const char *mod_name) |
