Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ipc/ipc-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ void ipc_platform_send_msg_direct(const struct ipc_msg *msg)
intel_adsp_ipc_send_message_emergency(INTEL_ADSP_IPC_HOST_DEV, hdr->pri, hdr->ext);
}

int ipc_platform_poll_is_host_ready(void)
{
return intel_adsp_ipc_is_complete(INTEL_ADSP_IPC_HOST_DEV);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm too late to the review of the Zephyr side change, so I'm not going to block this here, but, but .... this does feel like a very common problem and problem that is typically solved without polling. I.e.

  • get PM resource (prevent power gaing)
  • send message
  • wait for ack
  • when ack received, release PM resource

But yeah, this kind of implements the same thing with a SOF side API, so this is probably good addition at this point.


int platform_ipc_init(struct ipc *ipc)
{
ipc_set_drvdata(ipc, NULL);
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ manifest:

- name: zephyr
repo-path: zephyr
revision: ca3dd23846c2aeb7c20c872627113de370060522
revision: 7d54586751cfe405d2cdcfd850f8100bc9844f63

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the detailed git commit message! I'm afraid you may need to udpate this now that we merged #7642 but that PR was older and had the approvals plus tests pass, so I merged that first.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No problem, I think that it's better if we do zephyr update in smaller jumps.

remote: zephyrproject

# Import some projects listed in zephyr/west.yml@revision
Expand Down
3 changes: 2 additions & 1 deletion zephyr/lib/pm_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sof_versions.h>
#include <stdint.h>
#include <zephyr/pm/policy.h>
#include <sof/ipc/driver.h>

LOG_MODULE_REGISTER(power, CONFIG_SOF_LOG_LEVEL);

Expand Down Expand Up @@ -46,7 +47,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks)
continue;

/* skipping when some ipc task is not finished */
if (ipc_get()->task_mask)
if (ipc_get()->task_mask || !ipc_platform_poll_is_host_ready())
continue;
}

Expand Down