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

pm: use braces for .pm_base inside anonymous union initializer #69270

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Feb 21, 2024

Fixes commit 25173f7 ("pm: device_runtime: Extend with synchronous runtime PM")

Fixes compilation with gcc 4.2-based toolchain used by SOF for TGL generation products. As seen in the error message below, that gcc version requires braces for initialization of anonymous unions:

zephyr/soc/xtensa/intel_adsp/common/mem_window.c:62:
   error: unknown field ‘pm_base’ specified in initializer
   warning: missing braces around initializer
   warning: (near initialization for ‘__device_dts_ord_66.<anonymous>’)

This is a well-known and recurring issue, see past example(s) in #68118

As the Zephyr build is deterministic, I could easily verify that this commit makes zero .obj difference (when using the Zephyr SDK).

Fixes commit 25173f7 ("pm: device_runtime: Extend with synchronous
runtime PM")

Fixes compilation with gcc 4.2-based toolchain used by SOF for TGL
generation products. As seen in the error message below, that gcc
version requires braces for initialization of anonymous unions:

```
zephyr/soc/xtensa/intel_adsp/common/mem_window.c:62:
   error: unknown field ‘pm_base’ specified in initializer
   warning: missing braces around initializer
   warning: (near initialization for ‘__device_dts_ord_66.<anonymous>’)
```

This is a well-known and recurring issue, see past example(s) in zephyrproject-rtos#68118

As the Zephyr build is deterministic, I could easily verify that this
commit makes zero .obj difference (when using the Zephyr SDK).

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb marc-hb marked this pull request as ready for review February 21, 2024 01:40
@zephyrbot zephyrbot added area: Device Model Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. labels Feb 21, 2024
@marc-hb marc-hb added bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug area: Toolchains Toolchains labels Feb 21, 2024
@marc-hb
Copy link
Collaborator Author

marc-hb commented Feb 21, 2024

Tentative P1 because this is a compilation failure and it blocks SOF from upgrading Zephyr thesofproject/sof#8818

@marc-hb marc-hb added the platform: Intel ADSP Intel Audio platforms label Feb 21, 2024
@henrikbrixandersen henrikbrixandersen added Release Blocker Use this label for justified release blockers and removed priority: high High impact/importance bug labels Feb 21, 2024
@henrikbrixandersen
Copy link
Member

Raising priority to Release Blocker as this block SOF, a key consumer of the Zephyr project.

@henrikbrixandersen henrikbrixandersen merged commit f91d473 into zephyrproject-rtos:main Feb 21, 2024
35 checks passed
@marc-hb marc-hb deleted the fix-pmbase-init branch February 21, 2024 23:48
@@ -906,7 +906,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
.state = (state_), \
.data = (data_), \
IF_ENABLED(CONFIG_DEVICE_DEPS, (.deps = (deps_),)) /**/ \
IF_ENABLED(CONFIG_PM_DEVICE, (.pm_base = (pm_),)) /**/ \
IF_ENABLED(CONFIG_PM_DEVICE, ({ .pm_base = (pm_),)}) /**/ \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I got ), ) } ) in the wrong order, should have been ), } ))!

Amazingly, no compiler cares!? @keith-packard any idea why?

Fix (and more) submitted in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Device Model area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug platform: Intel ADSP Intel Audio platforms Release Blocker Use this label for justified release blockers Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants