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

sof-dump-status.py: don't crash on unknown Intel audio PCI devices #1204

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Jun 5, 2024

Set pci_info['hw_name'] to "PCI device unknown by SOF" and keep going.

Before this commit, any test that invokes sof-dump-status.py for any reason crashes like this when the PCI ID is unknown:

Traceback (most recent call last):
  File "sof-test/tools/sof-dump-status.py", line 497, in <module>
    sysinfo.loadPCI()
  File "sof-test/tools/sof-dump-status.py", line 139, in loadPCI
    pci_info['hw_name'] = self._pci_ids["0x" + tmp_line[4] + tmp_line[3]]
KeyError: '0xe328'

The lack of a known PCI ID does not have to be fatal: there are plenty of use cases where the PCI ID is not needed. This commit makes it possible to run all these test cases even when the PCI ID is unknown.

This could help with #288 too.

Set pci_info['hw_name'] to "PCI device unknown by SOF" and keep going.

Before this commit, any test that invokes sof-dump-status.py for any
reason crashes like this when the PCI ID is unknown:

```
Traceback (most recent call last):
  File "sof-test/tools/sof-dump-status.py", line 497, in <module>
    sysinfo.loadPCI()
  File "sof-test/tools/sof-dump-status.py", line 139, in loadPCI
    pci_info['hw_name'] = self._pci_ids["0x" + tmp_line[4] + tmp_line[3]]
KeyError: '0xe328'
```

The lack of a known PCI ID does not have to be fatal: there are plenty
of use cases where the PCI ID is not needed. This commit makes it
possible to run all these test cases even when the PCI ID is unknown.

This could help with thesofproject#288 too.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb marc-hb force-pushed the fix-unknown-PCI branch from 9356ee2 to f4a2fb2 Compare June 5, 2024 22:35
@marc-hb marc-hb marked this pull request as ready for review June 5, 2024 22:36
@marc-hb marc-hb requested a review from a team as a code owner June 5, 2024 22:36
@marc-hb
Copy link
Collaborator Author

marc-hb commented Jun 5, 2024

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.

good fix!

@marc-hb marc-hb merged commit 6571dcf into thesofproject:main Jun 6, 2024
4 of 7 checks passed
@marc-hb marc-hb deleted the fix-unknown-PCI branch June 6, 2024 05:54
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