-
Notifications
You must be signed in to change notification settings - Fork 132
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
ASoC: SOF: ipc4: Add support for split firmware releases #5270
ASoC: SOF: ipc4: Add support for split firmware releases #5270
Conversation
sound/soc/sof/ipc4-loader.c
Outdated
|
||
kfree(lib_filename); | ||
if (ret) | ||
break; |
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.
why break
? If any of the libraries fail loading you don't attempt the rest? In this case it kind of makes sense - if there's no "main" module bundle, there's probably no "debug" either, but isn't the general concept - here's a list of optional libraries, we try to load whatever is available?
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 sof_ipc4_load_library()
will only return error if there were real error for the loading, the bundle not present is not an error, but if the bundle loading fails then that is an error, something is not right and we will abort the probing altogethe.
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.
We should continue if a bundle fails, this way we still get base FW (and it may have some built-in modules) and a registered sound card. Yes we tell the user that we could not load the library and audio may not fully work as expected.
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.
We will fail to probe the card as the modules form the failed library are missing and the topology will not probe.
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.
OK, if we continue then the car will not come up, but the debugfs for SOF is going the be there to provide further clues.
36acd21
to
1664690
Compare
Changes since v1:
|
1664690
to
d09062a
Compare
Changes since v2:
|
d09062a
to
2096214
Compare
Changes since v3:
|
sound/soc/sof/ipc4-loader.c
Outdated
ret = firmware_request_nowarn(&fw_lib->sof_fw.fw, lib_filename, | ||
sdev->dev); | ||
if (ret < 0) { | ||
dev_dbg(sdev->dev, "Library file '%s' is not present\n", |
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.
@ujfalusi with the current releases where the openmodule/debug binaries are absent, will we always see this debug message? I think this will too much of a distraction. How about we check the presence of these files before requesting to load the libraries?
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.
Or not print here at all if does not exist...
2096214
to
8760089
Compare
Changes since v4:
|
sound/soc/sof/ipc4-loader.c
Outdated
* sof_ipc4_load_library_bundles - loads the library parts of a modular firmware | ||
* @sdev: SOF device | ||
* | ||
* With IPC4 the firmware can be monolithic or modular release. |
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.
@ujfalusi you want to remove the monolithic reference in this PR too?
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, I wanted to... ;)
8760089
to
8bc8b0c
Compare
Changes since v5:
|
SOFCI TEST |
1 similar comment
SOFCI TEST |
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.
works with thesofproject/sof#9702
@ranj063, can you check the patch again? |
sound/soc/sof/ipc4-loader.c
Outdated
if (!lib_name_base) | ||
return -ENOMEM; | ||
|
||
strscpy(lib_name_base, fw_filename, sizeof(lib_name_base)); |
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.
can you check the size please?
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.
which size?
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.
there's only one size - the last argument of strscpy()
. It's a size of a pointer, is that what is needed here?
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.
valid, it did worked on most platform with sof-123.ri pattern ;)
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.
it's because on 64-bit systems sizeof(char *) == 8
sound/soc/sof/ipc4-loader.c
Outdated
if (unlikely(ret)) | ||
goto release; | ||
|
||
kfree(fw_filename); | ||
|
||
(*lib_id)++; |
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.
what sense does it make incrementing this if the caller then ignores 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.
it is in the for loop, the lib_id is incremented for the next call?
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.
I think there were a reason why I did this, but cannot recall, I guess the increment can be done in a caller function.
Likely I had a different implementation which I reworked to arrive to this one..
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.
ah, right, it's a loop in sof_ipc4_complete_split_release()
, I only looked at sof_ipc4_load_library_by_uuid()
where it's just a single call. Ok, it's a bit confusing there, that a value is incremented but then ignored, but I see that it's actually ok. If you make a change, maybe just increment the lib_id
in the loop instead of in the function, then you also don't need to change an int
to a pointer at multiple locations in the function body
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.
2 comments seem too suspicious
A split SOF release consists of a base firmware and two libraries: <fw_filename>-openmodules.ri for processing (audio) modules <fw_filename>-debug.ri for debug and developer modules To handle this new release model add infrastructure to try to load the two library after boot optionally. This approach will allow flexibility on handling platforms in sof-bin with single or split configuration: single release: base firmware only split release: base firmware + openmodules + debug The files for the split firmware are located at the firmware directory. Signed-off-by: Peter Ujfalusi <[email protected]>
sound/soc/sof/ipc4-loader.c
Outdated
if (!lib_name_base) | ||
return -ENOMEM; | ||
|
||
strscpy(lib_name_base, fw_filename, sizeof(lib_name_base)); |
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.
it's because on 64-bit systems sizeof(char *) == 8
8bc8b0c
to
1f641c5
Compare
Changes since v6:
|
@lyakh, thank you for pointing the issues out, the strscpy() was a really bad from me :( |
A split SOF release consists of a base firmware and two libraries:
<fw_filename>-openmodules.ri for processing (audio) modules
<fw_filename>-debug.ri for debug and developer modules
To handle this new release model add infrastructure to try to load the two
library after boot optionally.
This approach will allow flexibility on handling platforms in sof-bin with
single or split configuration:
single release: base firmware only
split release: base firmware + openmodules + debug
The files for the split firmware are located at the firmware directory.
The documentation update is: thesofproject/sof-docs#505