-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use firmware load path from sysfs #13
base: master
Are you sure you want to change the base?
Conversation
be0daaa
to
f00f4d7
Compare
Some distributions override firmware loading path using /sys/module/firmware_class/parameters/path. Kernel supports it, teach pd-mapper to support it too. Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
f00f4d7
to
96cb6f4
Compare
This PR suffered from the same issue as tqftpserv one for using path from sysfs: Now it is fixed in the same way as in linux-msm/tqftpserv@98d162c - dirname is only called once on a copy of argument, and |
@@ -220,6 +237,8 @@ static int pd_enumerate_jsons(struct assoc *json_set) | |||
size_t len; | |||
size_t n; | |||
|
|||
read_fw_path_from_sysfs(fw_sysfs_path, sizeof(fw_sysfs_path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rework the code so that this function always return a valid path. It should be either a path from sysfs or a FIRMWARE_BASE. Rename the function accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code for this function was taken from related tqftpserv PR, I though it would be easier to review if they are identical... But this can be done, yeah.. I'll think about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to get rid of complicated "if" below, where we first try this, then try that..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Some linux distributions override firmware loading path using
/sys/module/firmware_class/parameters/path
.Kernel supports it, teach pd-mapper to support it too.
Kernel supports only single firmware path specified in firmware_class path. In postmarketOS we created a service script msm-firmware-loader that runs in early boot stage and symlinks all firmware it can find on various device partitions into a single directory, which is then written into
/sys/module/firmware_class/parameters/path
.With this patch (and some extra logging output enabled) I can see that pd-mapper is able to successfully find all JSON files at startup and replies to messages when modem remoteproc is started: