Repository navigation
Conversation
|
Can one of the admins verify this patch?
|
There was a problem hiding this comment.
🟡 Changes recommended
The direct-ring path can misinterpret DMA stream IDs as host addresses and overrun small host rings, creating critical memory-corruption risks.
3 open issues
What changed in this PR
This PR repairs IPC3 probe setup and adds direct host-ring extraction for i.MX8MP, paired with the linked Linux probe client.
Changes:
- Fix probe-buffer lookup and zero-initialize DMA configuration structures.
- Add direct copies into a host-provided ring with a published byte counter.
- Enable probes with up to 16 probe points on the i.MX8MP EVK.
| File | Description |
|---|---|
src/probe/probe.c |
Fixes probe setup and adds IPC3 host-ring extraction. |
app/boards/imx8mp_evk_mimx8ml8_adsp.conf |
Enables probes and configures the probe-point limit. |
Review effort: Balanced
|
@ursus161 @bhiregoudar @DINESHKUMARK1 @LongWang100 @dbaluta looks like there is an issue with recent AMD update for IPC3 probes ? My platforms use IPC4 probes so I would recommend the IPC3 probes adopt a similar host interface for tooling reuse. |
|
@lgirdwood, 2 questions as i have to see if we got this correct:
|
The request is for IPC3 users to align on the host mechanisms for IPC3 config/control of probes, and the recommendation is to make it as close to IPC4 as possible for least effort in tool reuse.
Yes. This PR changes part of that change. |
We faced issues with finding the probe points with ipc_get_comp_by_id, so we used the ipc_get_buffer_by_id. Our changes are under macro, they won't affect other platforms. |
c452c06 to
a638664
Compare
Yes, this is a way we could do it, at first hand I implemented it using ipc_get_comp_dev and it went OK. I am pushing hot fixes for this PR and the kernel one for problems left untreated raised by Copilot. I have tested the workflow and all went good, we could use a similar model to existing IPC4 implementation for ease for the least effort, but do you see any problems with this implementation? If yes, please give me a hard time |
|
Hi all, Thanks, |
@ursus161 I'm not using IPC3 for probes, there are differences though with IPC4 probes so it really up to IPC3 user to align on IPC3 based protocol here. I would recommend ping other IPC3 users and keep going. If no other IPC3 users reply than we can probably merge next week. |
a638664 to
936180d
Compare
|
test this please |
936180d to
59b16a6
Compare
accc45e to
094789f
Compare
IPC3 PROBE_INIT carries no host buffer address: on Intel the kernel programs the destination into the HDA stream, so the firmware never needs one. On i.MX the host DMA (nxp_sof_host_dma) is configured by the firmware itself and was never given a destination, so the extraction channel had nowhere to deliver to and dma_reload() never moved any probe data. Have the kernel pass the bus address of a coherent host buffer in the PROBE_INIT stream_tag field. The buffer is a header page followed by a ring whose size is a power of two of at least the local probe ring. Before every transfer point the host DMA block at the bytes about to go out, at the offset given by the write counter, then let the common dma_reload() path copy them, exactly as on the other Zephyr-native platforms. The transfer size is already clamped at the end of the local ring and the host ring is a multiple of it, so the transfer never has to wrap in the host ring either. The host DMA reports no position, so after each transfer publish the write counter in the first word of the header page for the kernel to poll. Use channel 0 in probe_dma_init() under CONFIG_PROBE_IMX_HOST_DMA, since stream_tag carries an address there, not a channel index; every other IPC3 platform (e.g. AMD ACP, MediaTek) keeps its previous channel selection unchanged. Add the CONFIG_PROBE_IMX_HOST_DMA Kconfig option for this path and enable it, together with CONFIG_PROBE=y and CONFIG_PROBE_POINTS_MAX=16, for the i.MX8MP EVK ADSP board. Look up IPC3 probe points with ipc_get_buffer_by_id() on this path, as on AMD. Signed-off-by: Stefan Ghetu <stefan.ghetu@nxp.com>
094789f to
207e79a
Compare


Fixes IPC3 probes on i.MX8MP (Zephyr) and lets probe data reach the host.
every PROBE_POINT_ADD failed with -EINVAL.
a coherent buffer address in the PROBE_INIT stream_tag, and the firmware
memcpy()s packets into it and publishes a byte counter.
Kernel side: thesofproject/linux#6013
Tested on imx8mp-evk with the kernel PR (1 kHz tone extracted fine).