mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
eb7b52e6db
When arm_ffa firmware driver module is unloaded or removed we call
__ffa_devices_unregister on all the devices on the ffa bus. It must
unregister all the devices instead it is currently just releasing the
devices without unregistering. That is pure wrong as when we try to
load the module back again, it will result in the kernel crash something
like below.
-->8
CPU: 2 PID: 232 Comm: modprobe Not tainted 5.15.0-rc2+ #169
Hardware name: FVP Base RevC (DT)
Call trace:
dump_backtrace+0x0/0x1cc
show_stack+0x18/0x64
dump_stack_lvl+0x64/0x7c
dump_stack+0x18/0x38
sysfs_create_dir_ns+0xe4/0x140
kobject_add_internal+0x170/0x358
kobject_add+0x94/0x100
device_add+0x178/0x5f0
device_register+0x20/0x30
ffa_device_register+0x80/0xcc [ffa_module]
ffa_setup_partitions+0x7c/0x108 [ffa_module]
init_module+0x290/0x2dc [ffa_module]
do_one_initcall+0xbc/0x230
do_init_module+0x58/0x304
load_module+0x15e0/0x1f68
__arm64_sys_finit_module+0xb8/0xf4
invoke_syscall+0x44/0x140
el0_svc_common+0xb4/0xf0
do_el0_svc+0x24/0x80
el0_svc+0x20/0x50
el0t_64_sync_handler+0x84/0xe4
el0t_64_sync+0x1a0/0x1a4
kobject_add_internal failed for arm-ffa-8001 with -EEXIST, don't try to
register things with the same name in the same directory.
----
Fix the issue by calling device_unregister in __ffa_devices_unregister
which will also take care of calling device_release(which is mapped to
ffa_release_device)
Link: https://lore.kernel.org/r/20210924092859.3057562-2-sudeep.holla@arm.com
Fixes:
|
||
---|---|---|
.. | ||
arm_ffa | ||
arm_scmi | ||
broadcom | ||
efi | ||
imx | ||
meson | ||
psci | ||
smccc | ||
tegra | ||
xilinx | ||
arm_scpi.c | ||
arm_sdei.c | ||
dmi_scan.c | ||
dmi-id.c | ||
dmi-sysfs.c | ||
edd.c | ||
iscsi_ibft_find.c | ||
iscsi_ibft.c | ||
Kconfig | ||
Makefile | ||
memmap.c | ||
pcdp.c | ||
pcdp.h | ||
qcom_scm-legacy.c | ||
qcom_scm-smc.c | ||
qcom_scm.c | ||
qcom_scm.h | ||
qemu_fw_cfg.c | ||
raspberrypi.c | ||
scpi_pm_domain.c | ||
stratix10-rsu.c | ||
stratix10-svc.c | ||
sysfb_simplefb.c | ||
sysfb.c | ||
ti_sci.c | ||
ti_sci.h | ||
trusted_foundations.c | ||
turris-mox-rwtm.c |