-
Notifications
You must be signed in to change notification settings - Fork 325
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
k_usleep() and k_msleep() wrappers for xtos #5770
Conversation
@wszypelt can you check the CI, it looks like the logs are timing out on the test failure. Thanks ! |
@lgirdwood |
@jsarha can you rebase this PR on HEAD. Thanks |
The commit adds kernel.h header at the top level of xtos-wrapper include directory. The idea is to be able to write OS agnostic code using Zephyr kernel API calls and simply including kernel.h without worrying if we are building for XTOS or Zephyr. This first commit contains Zephyr API style k_msleep() and k_usleep() implementations. The functions in fact call the old wait_delay-functions. More implementations and declarations following Zephyr kernel.h content can be added as needed. Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
9a52847
to
4b25ba4
Compare
4b25ba4
to
b31443b
Compare
@wszypelt CI not showing logs for failure. Can you check ? Thanks ! |
@lgirdwood
|
@jsarha can you drop the IPC4 patch from this PR (i.e no change in IPC4 code) and we can try the CI again. If it's good we can merge the API update and come back to the IPC4 issue in a new PR. |
Use Zephyr API k_msleep() instead of obsolete wait_delay_ms(). In XTOS build the k_msleep() is implemented in xtos-wrapper/include/kernel.h and it actually calls the wait_delay_ms(). Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
b31443b
to
a4d2d85
Compare
Lots of sof logger already dead on CML_RVP_SDW_ZEPHYR rerun (and seen this on other PRs). |
SOFCI TEST |
@jsarha ok, this part looks good - the ipc4 part needs a look with @RanderWang . |
Hmm, now that I look the new Zephyr build setup, the kernel.h is not anymore directly under zephyr/include, but in zephyr/include/zephyr/. I wonder if I should still move the xtos-wrapper/include/kernel.h to xtos-wrapper/include/zephyr/kernel.h, to match the new location? |
However, the code still compiles fine as it is, but I wonder if there is extraneous "-I zephyr" hack somewhere... Well, this is of course easy to fix later too. |
@jsarha I can merge this one now, then another PR for the header move/rename (we could have a xtos/kernel.h) and the a PR for the IPC4 fix. |
@@ -430,7 +433,7 @@ int pipeline_trigger_run(struct pipeline *p, struct comp_dev *host, int cmd) | |||
list_init(&walk_ctx.pipelines); | |||
|
|||
if (data.delay_ms) | |||
wait_delay_ms(data.delay_ms); | |||
k_msleep(data.delay_ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note, that this might incur a context switch now, IIUC. Before it was a busy loop, now under Zephyr this can actually cause a context switch. Although this path is only taken for DMA-driven pipelines and only when that delay is non-zero... And there might not be any other threads to switch to. So in practice this should be harmless and have no effect in 99.99% of the cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, this is intended - and we do need to rework the DMA driver scheduling at some point.
@jsarha lets fix the IPC4 and header rename/move in other PRs |
I left out the k_sleep() for cycles alone, to avoid k_timeout_t definition for XTOS. It did not look like that was needed.