-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: loader: do not warn about unknown firmware headers #2519
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: loader: do not warn about unknown firmware headers #2519
Conversation
|
@fredoh9 and @ktrzcinx I know this conflicts with #2459 and #2297 , but I'd like to get this in first and have a separate commit for it. Emitting a warning on a codepath that is basicly run every time user plays any sound on the machine, is pretty big no-no unless something is really wrong. So let's downgrade the warning and make the ABI changes in this area a bit easier and less likely to leak dmesg spam into upstream kernels. |
fredoh9
left a comment
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.
Looks good!
sound/soc/sof/loader.c
Outdated
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.
typo unnessary in commit message
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.
Oops, thanks, fixed. The checkpatch codespell doesn't catch much...
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.
well it missed one more fraffic haha
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.
maybe we need dev_warn_once()
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 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.
@ktrzcinx That's indeed useful, but at least for this example, it seems better for sof-logger to detect the debugfs interface is missing and print out an error to user that your kernel is missing memory tracing feature, please upgrade. This is especially true as parsing a manifest header does not mean the kernel has all patches needed for this feature.
@xiulipan That's another option to limit parsing only for first boot. There's a small risk in there, in that we have no guarantees the firmware is not updated on a running system.. it's actually very likely sequence of events when systems are upgraded (there is no forced reboot), so I'd be cautious to build a lot of if-firstboot-then type of logic. Printing warnings like this would maybe qualify (not really an issue if warnings don't get printed until system is fully rebooted).
Even still, let's make sure our warnings and errors do really count. Whenever we emit one, a bug gets reported and it creates work for multiple organizations (integrators, distro maintainers, our customer support and so forth), so even if it's once per boot, it still matters. If the warning can ensure, we can analyze a bug, then it's ok,but let's consider each case on its own merits.
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.
@kv2019i Interesting topic, will runtime PM be influenced by firmware change on rootfs?
To me I think the first_boot will be reset with kmod reload and that's when the FW change take effect(we will call require firmware). So we should make ext manifest parser every time we require firmware from rootfs, then we are good with mismatch risk.
I will try to check our FW load sequence to confirm this.
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.
@xiulipan I now checked the codepaths and I think we are safe with this.
FW:
sof_resume -> snd_sof_load_firmware() -> snd_sof_load_firmware_raw()
There's a check for "plat_data->fw" and if FW was already loaded, it's not loaded again from rootfs.
Topology is only loaded at sof-audio probe. So if you do a system upgrade on a live system, you need to reload the SOF driver modules to refresh FW and topology, and then all first_boot checks will be done.
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.
@kv2019i the commit message mentions IPC data but we're not really talking IPCs here right? Its purely extended manifest headers, isnt 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.
@ranj063 Yes, I think we have add some ext_manifest both in FW (eg. SOF_IPC_EXT_CC_INFO by IPC for old drviers) and ext_manifest (parse after FW load from rootfs)
@kv2019i I am OK with this as this part will be removed in few versions right? I think it won't break anything as no new feature in driver will relay on the ext data.
64d0284 to
bea20d6
Compare
sound/soc/sof/loader.c
Outdated
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.
maybe we need dev_warn_once()
xiulipan
left a comment
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.
@kv2019i I double check the kernel, it seems runtime PM will not output this warning message.
The function snd_sof_fw_ext_man_parse is called alongside with request_firmware, so this warning will only take effect when boot up or kmod reload.
linux/sound/soc/sof/loader.c
Line 687 in d0a335d
ext_man_size = snd_sof_fw_ext_man_parse(sdev, plat_data->fw);
As runtime pm is enabled on most platforms and
snd_sof_fw_parse_ext_data() is called for every DSP boot, this creates
unnessary kernel dmesg fraffic.
What you said in commit will never happen
|
@kv2019i ha, I found I was mislead by the commit title
But what you change is actually extend data from DSP IPC Lines 473 to 475 in d0a335d
But still, I think a better solution would be only call see my previous comments about |
Ack, you are correct. I tested by observing "DSP is ready" trace after each runtime-resume, but alas, that's emitted on L458, just before the boottime check. @xiulipan Maybe using "manifest" word was misleading, I did specifically intend to change snd_sof_fw_parse_ext_data() -- it's really the same data, we just used the fw_ready IPC before we had the ext-manifest, but to me it's really the same data. But yeah, agreed, better to use extended data. |
bea20d6 to
383deba
Compare
xiulipan
left a comment
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.
If we do not need to add anything new to IPC_EXT data, it is OK to lower the message level.
sound/soc/sof/loader.c
Outdated
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.
@ranj063 Yes, I think we have add some ext_manifest both in FW (eg. SOF_IPC_EXT_CC_INFO by IPC for old drviers) and ext_manifest (parse after FW load from rootfs)
@kv2019i I am OK with this as this part will be removed in few versions right? I think it won't break anything as no new feature in driver will relay on the ext data.
The firmware extended data IPC and manifest structures are designed to be extendable without breaking the driver-firmware ABI. Driver should not raise a warning in case a new header type is detected at firmware boot. There are already checks for IPC ABI compatibility in snd_sof_ipc_valid() and if the versions are deemed compatible, extra fields in IPC messages should not trigger warnings. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
383deba to
6308e36
Compare
|
Sorry all, the patch revision in review was not correct. :( Commit message was correct, but the changes to use dev_info were not in. I now pushed the new version, please check again. Sorry for the noise. |
ktrzcinx
left a comment
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.
Now I'm not puzzled what's going on 👍🏼
|
Thanks all for the reviews, merging this. |
The firmware extended data IPC and manifest structures are designed to
be extendable without breaking the driver-firmware ABI. Driver should
not raise a warning in case a new header type is detected at
firmware boot. There are already checks for IPC ABI compatibility in
snd_sof_ipc_valid() and if the versions are deemed compatible, extra
fields in IPC messages should not trigger warnings.
Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com