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

check-ipc-flood.sh does not work with IPC4 #1066

Closed
marc-hb opened this issue Jun 23, 2023 · 11 comments
Closed

check-ipc-flood.sh does not work with IPC4 #1066

marc-hb opened this issue Jun 23, 2023 · 11 comments
Assignees
Labels
P2 Critical bugs or normal features type:bug Something doesn't work as expected type:test coverage gap This requires a new test case, not just fixing one

Comments

@marc-hb
Copy link
Collaborator

marc-hb commented Jun 23, 2023

Example in https://sof-ci.01.org/softestpr/PR1057/build454/devicetest/index.html (or in Intel daily test run 28116)

2023-06-15 17:55:26 UTC _ /home/ubuntu/sof-test/test-case/check-ipc-flood.sh need debug version firmware
2023-06-15 17:55:26 UTC _ Starting func_exit_handler(), exit status=2, FUNCNAME stack:
2023-06-15 17:55:26 UTC _  main()  @  /home/ubuntu/sof-test/test-case/check-ipc-flood.sh

cc:

@marc-hb marc-hb added type:bug Something doesn't work as expected P2 Critical bugs or normal features type:test coverage gap This requires a new test case, not just fixing one area:IPC4 labels Jun 23, 2023
@ranj063
Copy link
Contributor

ranj063 commented Jun 27, 2023

I'm not sure if flood test will ever work with IPC4. This requires the addition of a new kind of IPC into IPC4 and I dont think there are any plans for it. Can we simply omit these from testing for IPC4?

@marc-hb
Copy link
Collaborator Author

marc-hb commented Jun 27, 2023

Can we simply omit these from testing for IPC4?

We sure can if everyone agrees. Where can we bring that question up?

BEFORE we remove that test from the corresponding test plans we need to fix the misleading error message. We can probably just add something like if ipc4; then skip_test "only IPC3 is supported"

@marc-hb marc-hb removed the type:test coverage gap This requires a new test case, not just fixing one label Jun 27, 2023
@ranj063
Copy link
Contributor

ranj063 commented Jun 28, 2023

Can we simply omit these from testing for IPC4?

We sure can if everyone agrees. Where can we bring that question up?

BEFORE we remove that test from the corresponding test plans we need to fix the misleading error message. We can probably just add something like if ipc4; then skip_test "only IPC3 is supported"

yes, lets just do that for now

@marc-hb
Copy link
Collaborator Author

marc-hb commented Aug 1, 2024

wontfix

@marc-hb marc-hb closed this as completed Aug 1, 2024
@marc-hb
Copy link
Collaborator Author

marc-hb commented Aug 13, 2024

I'll see if I can quickly fix the error message.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Aug 13, 2024

So to decide whether it should test or SKIP, the short (and pretty poorly written) check-ipc-flood.sh currently looks for this in the kernel logs:

Aug 13 18:08:19 jf-cml-sku0983-sdw-1 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:2:10-e05ca
Aug 13 18:08:19 jf-cml-sku0983-sdw-1 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:23:0 Kernel ABI 3:23:0
Aug 13 18:08:19 jf-cml-sku0983-sdw-1 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware debug build 65535 on dtermin.-extman - options:
                                              GDB: disabled
                                              lock debug: disabled
                                              lock vdebug: disabled

Instead of this:

Aug 13 11:17:35 up2 kernel: sof-audio-pci-intel-apl 0000:00:0e.0: Firmware info: version 2:2:0-57864
Aug 13 11:17:35 up2 kernel: sof-audio-pci-intel-apl 0000:00:0e.0: Firmware: ABI 3:22:1 Kernel ABI 3:23:0

In other words, if Firmware debug is found in the kernel log then it runs, otherwise it skips. (It does not even look for sof-audio... or ... build, sigh...)

This is quite ugly.

Is there some more reliable and hopefully generic (IPC-independent) way to check whether this IPC is supported?

sound/soc/sof/ipc3.c

[         943.437] (         142.500) c0 ipc                  src/ipc/ipc3/handler.c:1605 INFO ipc: new cmd 0xb0010000
[         951.771] (           8.333) c0 ipc                  src/ipc/ipc3/handler.c:1650 ERROR ipc: unknown command type 2952790016

EDIT: this is based on this kernel code, so it's not as "ugly" as I thought it was:

int sof_ipc3_validate_fw_version(struct snd_sof_dev *sdev)
{
        dev_info(sdev->dev,
                 "Firmware info: version %d:%d:%d-%s\n",  v->major, v->minor,
                 v->micro, v->tag);
        dev_info(sdev->dev,
                 "Firmware: ABI %d:%d:%d Kernel ABI %d:%d:%d\n",

 ....

        if (ready->flags & SOF_IPC_INFO_BUILD) {
                dev_info(sdev->dev,
                         "Firmware debug build %d on %s-%s - options:\n"
                         " GDB: %s\n"

@marc-hb
Copy link
Collaborator Author

marc-hb commented Aug 13, 2024

How about this:

root@up2:~# echo 1 > /sys/kernel/debug/sof/ipc_flood_count ; echo $?
-bash: echo: write error: Invalid argument
1

In other words, a "flood" of just 1 just to probe the feature. If that works, then flood "for real" with either the 10,000 default or the command line argument. Otherwise SKIP.

The risk is wrongly SKIPping because the entire flooding feature is broken (when it shouldn't be) and it fails even with 1.

cc: @ujfalusi

marc-hb added a commit to marc-hb/sof-test that referenced this issue Aug 13, 2024
Add is_firmware_file_zephyr() and a new SKIP message to stop telling
Zephyr users to build a "debug firmware" because it won't change
anything for them: IPC4 has no flood command right now, see
thesofproject#1066

Also clarify the XTOS skip message + other cosmetic improvements.

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

marc-hb commented Aug 13, 2024

Here's a much smaller and simpler SKIP message fix, please review:

@marc-hb marc-hb added the type:test coverage gap This requires a new test case, not just fixing one label Aug 13, 2024
marc-hb added a commit to marc-hb/sof-test that referenced this issue Aug 13, 2024
Add is_ipc4() call and a new SKIP message to stop telling
Zephyr users to build a "debug firmware" because it won't change
anything for them: IPC4 has no flood command right now, see
thesofproject#1066

Also clarify the XTOS skip message + other cosmetic improvements.

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

marc-hb commented Aug 14, 2024

Just noticed check-ipc-flood.sh does not care about firmware logs...

@ujfalusi
Copy link
Contributor

echo 1 > /sys/kernel/debug/sof/snd_sof.ipc_flood.0/ipc_flood_count 
-bash: echo: write error: Invalid argument

and in kernel:

[ 1579.215851] snd_sof:ipc3_log_header: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0xb0010000: GLB_TEST_MSG: IPC_FLOOD
[ 1579.215969] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0xb0010000 (msg/reply size: 8/0): -22
[ 1579.215977] snd_sof_ipc_flood_test snd_sof.ipc_flood.0: ipc flood test failed at 0 iterations

so, the firmware have the IPC flood test disabled, because the firmware is not built with CONFIG_DEBUG, there is not much the kernel do here, it cannot know this...

marc-hb added a commit that referenced this issue Aug 14, 2024
Add is_ipc4() call and a new SKIP message to stop telling
Zephyr users to build a "debug firmware" because it won't change
anything for them: IPC4 has no flood command right now, see
#1066

Also clarify the XTOS skip message + other cosmetic improvements.

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

marc-hb commented Aug 14, 2024

Thanks for the additional information @ujfalusi.

Better error message just merged with a reference to this issue. Closing as wontfix for now.

@marc-hb marc-hb closed this as completed Aug 14, 2024
@marc-hb marc-hb reopened this Aug 14, 2024
@marc-hb marc-hb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Critical bugs or normal features type:bug Something doesn't work as expected type:test coverage gap This requires a new test case, not just fixing one
Projects
None yet
Development

No branches or pull requests

3 participants