[PATCH] firmware: arm_ffa: Emit modalias for FF-A devices
Abdellatif El Khlifi
abdellatif.elkhlifi at arm.com
Fri Oct 6 06:31:31 PDT 2023
Hi Sudeep,
> In order to enable libkmod lookups for FF-A device objects to their
> corresponding module, add 'modalias' to the base attribute of FF-A
> devices.
>
> Cc: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla at arm.com>
> ---
Tested-by: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
More details:
We used this patch to autoload Arm FF-A TEE kernel module [1].
Please have a look at the tests logs [2].
The logs show:
- The aliases exported in sysfs by the FF-A bus for each FF-A device
- modinfo output for arm-ffa-tee.ko which uses an alias pattern matching the alias exported by the bus driver
- mdev (the device manager) command autorun at boot time, searches for the modalias entries in sysfs and passes them to modprobe
- modprobe matches between the sysfs alias and the kernel module
- lsmod shows that the module was loaded automatically at boot time
Cheers,
Abdellatif
[1]: arm-ffa-tee.ko: https://gitlab.arm.com/linux-arm/linux-trusted-services
[2]: logs for the tests made
root at corstone1000-fvp:~# uname -r
6.4.14-yocto-standard
root at corstone1000-fvp:~#
root at corstone1000-fvp:~# cat /sys/devices/arm-ffa-1/modalias
arm_ffa:8001:486178e0-e7f8-11e3-bc5e-0002a5d5c51broot at corstone1000-fvp:~#
root at corstone1000-fvp:~# cat /sys/devices/arm-ffa-2/modalias
arm_ffa:8002:46bb39d1-b4d9-45b5-88ff-040027dab249root at corstone1000-fvp:~#
root at corstone1000-fvp:~# cat /sys/devices/arm-ffa-3/modalias
arm_ffa:8003:00000000-0000-0000-0000-000000000000root at corstone1000-fvp:~#
root at corstone1000-fvp:~#
root at corstone1000-fvp:~# modinfo /lib/modules/6.4.14-yocto-standard/updates/arm-ffa-tee.ko
filename: /lib/modules/6.4.14-yocto-standard/updates/arm-ffa-tee.ko
version: 1.1.2
license: GPL v2
description: Arm FF-A TEE driver
author: Balint Dobszay <balint.dobszay at arm.com>
alias: arm_ffa:*:*
srcversion: 693E15C4E73D08A57E02B1E
depends:
name: arm_ffa_tee
vermagic: 6.4.14-yocto-standard SMP preempt aarch64
root at corstone1000-fvp:~#
root at corstone1000-fvp:~#
root at corstone1000-fvp:~# grep modalias /etc/init.d/mdev -A 4
find /sys/ -name modalias -print0 | \
xargs -0 sort -u | \
tr '\n' '\0' | \
xargs -0 modprobe -abq
}
root at corstone1000-fvp:~#
root at corstone1000-fvp:~# lsmod
Module Size Used by
arm_ffa_tee 12288 -2
root at corstone1000-fvp:~#
More information about the linux-arm-kernel
mailing list