Skip to content
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

Add and start using generic functions fw_reldir() and fw_relfilepath() #1224

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Jul 22, 2024

Add two generic functions fw_reldir() and fw_relfilepath() which search in this order:

  1. /sys/kernel/debug/sof/fw_profile/
  2. /sys/module/snd_sof_pci/parameters/
  3. Kernel logs.

The 3., slower, "legacy" option is kept because it's useful with either old kernels or when the modules have been unloaded.

Start using these two generic functions in is_firmware_file_zephyr() and get_ldc_subdir().

Minor fixes to prepare support for /sys/kernel/debug/sof/fw_profile/

- Move emptiness test and error message from caller to function.
- Give a much more specific name
- Call journalctl directly, no need for the journalctl_cmd() indirection
  here.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Jul 23, 2024

Usual LNL failures in https://sof-ci.01.org/softestpr/PR1224/build686/devicetest/index.html, everything else 100% green (even suspend/resume!)

EDIT after force-push:
GLK missing in https://sof-ci.01.org/softestpr/PR1224/build692/devicetest/index.html everything green

Usual LNL failures in https://sof-ci.01.org/softestpr/PR1224/build690/devicetest/index.html

everything else green.

Unifies all 3 possible ways to find the relative firmware directory. To
be used in find_ldc_file() and is_firmware_file_zephyr().

Signed-off-by: Marc Herbert <[email protected]>
Simplify get_ldc_subdir() but using the new, universal fw_reldir().

Signed-off-by: Marc Herbert <[email protected]>
Add new, "universal" fw_relfilepath() function modelled after
fw_reldir(). To be used in `is_firmware_file_zephyr()` and others.

Signed-off-by: Marc Herbert <[email protected]>
case-lib/lib.sh Outdated
@@ -825,22 +825,30 @@ is_zephyr_ldc()
# https://github.com/thesofproject/linux/issues/3867 and friends. Keep this existing
# journalctl_cmd() code as a fallback for older kernels or when the firmware has been
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

journalctl_cmd() -> journalctl

@@ -840,6 +840,45 @@ fw_reldir()
printf '%s' "$(dirname "$from_klogs")"
}

# Prints the relative firmware filepath: e.g. `intel/sof-ipc4/tgl/community/sof-tgl.ri`
#
# Some of the code duplicates fw_reldir() above. Unfortunately can't re-use and invoke
Copy link
Collaborator

@fredoh9 fredoh9 Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to put a comment of duplication and possible re-use, but good comment here

Copy link
Collaborator

@fredoh9 fredoh9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed commit by commit. much make sense than reviewing entire change. Easy to follow.
Thank you for fixing the annoying error.

@fredoh9 fredoh9 requested a review from ssavati July 24, 2024 21:39
@marc-hb marc-hb merged commit a74f994 into thesofproject:main Jul 25, 2024
5 of 7 checks passed
@marc-hb marc-hb deleted the new-fw-path branch July 25, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants