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

intel-adsp: fix ACE power-off assembly #75706

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

lyakh
Copy link
Collaborator

@lyakh lyakh commented Jul 10, 2024

A recent commit fb53d2e ("ace: power: replace pseudo-assembly movi") contained a bug: the Xtensa "movi" assembly instruction must be written with the immediate argument already shifted left by 8, the compiler doesn't do that automatically. This still somehow worked on MTL but failed on LNL. Fix both occurrences.

Fixes: #75700

This is an alternative to reverting the offending commit as submitted in #75689

A recent commit fb53d2e ("ace: power: replace pseudo-assembly
movi") contained a bug: the Xtensa "movi" assembly instruction must
be written with the immediate argument already shifted left by 8, the
compiler doesn't do that automatically. This still somehow worked on
MTL but failed on LNL. Fix both occurrences.

Fixes: zephyrproject-rtos#75700
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Test in thesofproject/sof#9294 seems good, so this is better than the revert. Thanks @lyakh !

@dcpleung dcpleung added this to the v3.7.0 milestone Jul 10, 2024
@@ -38,7 +38,7 @@
movi \az, 0x2f5
slli \az, \az, 0xb
/* 8 * (\segment_index << 5) == (\segment_index << 5) << 3 == \segment_index << 8 */
addmi \az, \az, \segment_index
addmi \az, \az, \segment_index << 8
Copy link
Collaborator

Choose a reason for hiding this comment

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

For ACE MAX_MEMORY_SEGMENTS == 1, so segment_index is always 0. And so this shift cannot affect the problem.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@serhiy-katsyuba-intel Ack, the patch affects via LSPGCTL_HIGH which is also passed to addmi. So this change is to just correct all uses of addmi. @lyakh to confirm, but that's how I understood it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct. This is just a correctness fix, the real fix is the LSPGCTL_HIGH part

@marc-hb marc-hb added the bug The issue is a bug, or the PR is fixing a bug label Jul 11, 2024
@nashif nashif merged commit 46b356a into zephyrproject-rtos:main Jul 12, 2024
27 checks passed
@lyakh lyakh deleted the powerdown branch July 15, 2024 09:01
@marc-hb
Copy link
Collaborator

marc-hb commented Jul 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: Intel ADSP Intel Audio platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zephyr panic on system on system suspend on Intel ADSP ace20