Skip to content

[RFC] host: remove unused code - #7315

Open
lyakh wants to merge 1 commit into
thesofproject:mainfrom
lyakh:host
Open

lyakh wants to merge 1 commit into
thesofproject:mainfrom
lyakh:host

Conversation

@lyakh

@lyakh lyakh commented Mar 21, 2023

Copy link
Copy Markdown
Collaborator

After host functionality has been integrated into the copier, the host component interface became unused, remove it.

@lyakh
lyakh marked this pull request as ready for review March 21, 2023 15:28
@lyakh
lyakh requested a review from btian1 March 21, 2023 15:29
@lyakh

lyakh commented Mar 21, 2023

Copy link
Copy Markdown
Collaborator Author

Also tested with IPC3 / legacy.
CI failures: https://sof-ci.01.org/sofpr/PR7315/build4912/devicetest/index.html?model=MTLP_RVP_NOCODEC&testcase=check-suspend-resume-with-capture-5 is a suspend-resume failure, https://sof-ci.01.org/sofpr/PR7315/build4913/devicetest/index.html?model=TGLU_RVP_NOCODEC_IPC4ZPH&testcase=multiple-pause-resume-5 is a multiple-pause-release. The latter might indeed indicate a bug in SOF, but cannot be related to this PR, which only removes complete functions and a complete host component driver, so any failure caused by it would show as a failure to build a pipeline.

@ranj063

ranj063 commented Mar 21, 2023

Copy link
Copy Markdown
Collaborator

@lyakh this would mean IPC3+zephyr would not be an option at all right?

@lgirdwood

Copy link
Copy Markdown
Member

@lyakh this would mean IPC3+zephyr would not be an option at all right?

Its used on NXP platforms atm.

@btian1

btian1 commented Mar 22, 2023

Copy link
Copy Markdown
Contributor

better to remove it after some time? let the bullet fly for a while? in case, regression or other things happen.

@lyakh

lyakh commented Mar 22, 2023

Copy link
Copy Markdown
Collaborator Author

@lyakh this would mean IPC3+zephyr would not be an option at all right?

Its used on NXP platforms atm.

@lgirdwood @ranj063 is IPC3+Zephyr ever used with native Zephyr drivers?..

@juimonen

Copy link
Copy Markdown

@lyakh only some native drivers support ipc3 configs, so it would work only partially.

@lyakh

lyakh commented Mar 22, 2023

Copy link
Copy Markdown
Collaborator Author

@lyakh only some native drivers support ipc3 configs, so it would work only partially.

@juimonen and is it planned to support that configuration?

@juimonen

Copy link
Copy Markdown

@lyakh my humble understanding was that ipc3 + zephyr native drivers was kind of transition phase, and official support is for ipc4 only. OTH it would not be too big task to add the code to dmic, alh and hda. ssp supports ipc3. However, authors for these drivers are different, so there is no 1 single entity to do this or send bug reports. So I would not hold my breath...

@dbaluta

dbaluta commented Mar 22, 2023

Copy link
Copy Markdown
Collaborator

@lyakh this would mean IPC3+zephyr would not be an option at all right?

IPC3 + zephyr is used on NXP i.MX8 platforms. We are planning to transition to IPC4 but I don't see this happening in in Q2 or Q3.

@lgirdwood I think it is time for a new TSC .

@lgirdwood

Copy link
Copy Markdown
Member

@lyakh this would mean IPC3+zephyr would not be an option at all right?

IPC3 + zephyr is used on NXP i.MX8 platforms. We are planning to transition to IPC4 but I don't see this happening in in Q2 or Q3.

@lgirdwood I think it is time for a new TSC .

Ack, was planning this once v2.5 is tagged

@lyakh lyakh changed the title host: remove unused code [RFC] host: remove unused code Mar 22, 2023
@lyakh

lyakh commented Mar 22, 2023 •

Copy link
Copy Markdown
Collaborator Author

I was looking at removing some uses of the notifier API, particularly for the DMA copy operation, where performance is essential. The second commit in this PR is what a part of that removal can look like

@RanderWang RanderWang left a comment

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.

It is good for me for ipc4 side.

Comment thread src/audio/host-zephyr.c Outdated

@btian1 btian1 Mar 23, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are making host-zephyr from a device to a small lib, so at least, title may need change, it is not simply remove code, with your changes, host-zephyr.c may change to host-zephyr-lib.c

Also, DMA operation also got changed, may need add more explain in comments.

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 don't think we need to change the name of the file here. lib could indicate that it is built as part of a library.

@ranj063 ranj063 left a comment

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.

As long as we've agreed that we dont care about ipc3+zephyr anymore, this change is good.

@lyakh

lyakh commented Mar 23, 2023

Copy link
Copy Markdown
Collaborator Author

As long as we've agreed that we dont care about ipc3+zephyr anymore, this change is good.

@ranj063 I think it isn't that much about ipc3+Zephyr as about IPC3+Zephyr+native drivers. Whereas "native drivers" also seems not a very well defined condition. Does it mean all drivers? I.e. we cannot mix some drivers Zephyr native and some "legacy" SOF? I think that should be possible, right @juimonen? If it's possible, then in this case the condition is probably, that the DAI driver is a Zephyr driver?

@juimonen

Copy link
Copy Markdown

@lyakh mixing sof xtos audio drivers and zephyr native audio drivers is possible in theory, but not in practice. In a sense that you either use native "glue" code or xtos apis on sof. We don't have so refined separation as per driver you could choose which one to use. Terms have been heavily convoluted, but as said, trying to compile ipc3 sof with some audio drivers in zephyr side and some in xtos would not just work (unless you heavily modify makefiles). And as a consequence, zephyr native drivers with ipc3 will not be fully functional.

@dbaluta

dbaluta commented Mar 23, 2023

Copy link
Copy Markdown
Collaborator

As long as we've agreed that we dont care about ipc3+zephyr anymore, this change is good.

@ranj063 at least this year for i.MX we care about it. We are planning to completely switch to Zephyr but we are still using IPC3

@ranj063

ranj063 commented Mar 24, 2023

Copy link
Copy Markdown
Collaborator

As long as we've agreed that we dont care about ipc3+zephyr anymore, this change is good.

@ranj063 at least this year for i.MX we care about it. We are planning to completely switch to Zephyr but we are still using IPC3

@dbaluta did you see @juimonen 's comment? How are you testing this?

@lyakh

lyakh commented Mar 24, 2023

Copy link
Copy Markdown
Collaborator Author

Since we're unsure about the first of the two commits in this PR, I've pushed the second one separately as #7330 and I'll remove it from here

@lgirdwood

Copy link
Copy Markdown
Member

As long as we've agreed that we dont care about ipc3+zephyr anymore, this change is good.

@ranj063 at least this year for i.MX we care about it. We are planning to completely switch to Zephyr but we are still using IPC3

@dbaluta pls block this PR - we can do the cleanup after NXP is ready. @lyakh we can remove code that is unused on Intel platforms only for IPC3 + Zephyr.

@dbaluta dbaluta left a comment

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.

blocking this until we get a chance to test it

Cc @paulstelian97 @iuliana-prodan

@sys-pt1s

sys-pt1s commented Apr 6, 2023

Copy link
Copy Markdown

Can one of the admins verify this patch?

@btian1

btian1 commented Apr 13, 2023

Copy link
Copy Markdown
Contributor

@lyakh , this is also a memory optimization, if possible, please provide fw size reduction for this PR, I believe should > 1K

@lyakh

lyakh commented Apr 14, 2023

Copy link
Copy Markdown
Collaborator Author

@lyakh , this is also a memory optimization, if possible, please provide fw size reduction for this PR, I believe should > 1K

We can also #ifdef that code to achieve the same memory saving without potentially breaking any IPC3+Zephyr+native_driver non-Intel configurations. But that would of course be uglier

@lgirdwood

Copy link
Copy Markdown
Member

@dbaluta any update ?

@dbaluta

dbaluta commented Apr 27, 2023

Copy link
Copy Markdown
Collaborator

@paulstelian97 please give it a test.

@dbaluta

dbaluta commented Apr 27, 2023

Copy link
Copy Markdown
Collaborator

Looking at this:

if(CONFIG_ZEPHYR_NATIVE_DRIVERS)
»       zephyr_library_sources(
»       »       ${SOF_AUDIO_PATH}/host-zephyr.c                                                                           
»       )
else()
»       zephyr_library_sources(
»       »       ${SOF_AUDIO_PATH}/host-legacy.c
»       )
endif()

It looks like this doesn't affect us right now because NATIVE_DRIVERS is not enabled for IMX.

Anyhow, does this mean that when we will need to switch to native drivers will also need to switch to IPC4?

@dbaluta

dbaluta commented Apr 27, 2023

Copy link
Copy Markdown
Collaborator

This should be OK to merge after resolving the conflicts.

@kv2019i

kv2019i commented Apr 28, 2023

Copy link
Copy Markdown
Collaborator

@lyakh Status? Not marked as draft, has conflicts, "RFC" title, but then has a full set approvals.

@lyakh

lyakh commented May 2, 2023

Copy link
Copy Markdown
Collaborator Author

@lyakh Status? Not marked as draft, has conflicts, "RFC" title, but then has a full set approvals.

@kv2019i this PR breaks IPC3 + native Zephyr drivers. We can remove IPC3 support from "main" for Intel platforms, but from the discussion above it looks like other platforms might want to use that configuration at least temporarily for driver porting to Zephyr. In that case we probably shouldn't break it. I'll convert this to draft

@lyakh
lyakh marked this pull request as draft May 2, 2023 07:58
After host functionality has been integrated into the copier, the
host component interface became unused with IPC4, make it IPC3 only.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lyakh
lyakh marked this pull request as ready for review September 30, 2026 08:58
Copilot AI balanced review requested due to automatic review settings September 30, 2026 08:58
@lyakh
lyakh requested a review from kv2019i as a code owner September 30, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The guards consistently isolate IPC3-only code without affecting copier-shared functionality.

Review effort: Balanced
Findings: None

What changed in this PR

Restricts the legacy host component interface to IPC3 while retaining shared host DMA functionality for the IPC4 copier.

Changes:

  • Guards IPC3-only host callbacks and lifecycle operations.
  • Excludes host driver registration from IPC4 builds.
File Description
src/​audio/​host-zephyr.c Conditionally compiles the standalone host interface for IPC3.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants