Skip to content

Conversation

@makarukp
Copy link
Contributor

@makarukp makarukp commented Nov 23, 2022

This PR enables hardware support for HDA chain transfers (without deploying internal pipelines):
Content:

  • hda chain management
  • hda chain tasks and DMA logic implementation

Signed-off-by: Piotr Makaruk piotr.makaruk@intel.com

@makarukp makarukp force-pushed the hw_hda_chain_support branch from 190506e to 081ddd5 Compare November 29, 2022 12:21
@makarukp makarukp force-pushed the hw_hda_chain_support branch from a736998 to 4b4efff Compare November 30, 2022 08:39
@lgirdwood
Copy link
Member

@makarukp is this PR still pending validation or implementation completion or external dependencies ?

@makarukp
Copy link
Contributor Author

makarukp commented Dec 1, 2022

@lgirdwood This PR is still under development, it requires at lease one more commit with code completion before it is ready for validation.

@makarukp makarukp marked this pull request as ready for review December 14, 2022 14:24
@makarukp makarukp force-pushed the hw_hda_chain_support branch from 2b3c0fa to b508b85 Compare December 14, 2022 15:19
@makarukp makarukp changed the title [DO NOT MERGE]hda: hw support for hda chain hda: hw support for hda chain Dec 15, 2022
@makarukp
Copy link
Contributor Author

Code is completed. PR is ready for validation.

@makarukp makarukp force-pushed the hw_hda_chain_support branch 2 times, most recently from 896317d to 6eb4ac3 Compare January 12, 2023 13:57
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, this looks a bit suspicious. And in fact dw_dma_get_status() can return -EINVAL if the channel number is invalid, and that is a hard error and in that case stat isn't filled. So, this at least deserves a comment, much more so than the two comments above which explain something, that's pretty clear from the code itself.

@makarukp
Copy link
Contributor Author

makarukp commented Jan 13, 2023

@lyakh What do you think about such approach of critical error handling in response to 'dma_get_status()' ?

/* Status can return -ENODATA and current status if xrun occurs, then it is not critical
 * and flow shall continue. In worst case, when channel index exceeds max value, status can
 * return -EINVAL, then it is critical error.
 */
ret = dma_get_status(cd->chan_link->dma->z_dev, cd->chan_link->index, &stat);
switch (ret) {
case 0:
	break;
case -ENODATA:
	tr_warn(&chain_dma_tr, "chain_task_run(): dma_get_status() xrun occured, ret = %u",
	ret);
	break;
default:
	tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %u", ret);
	return SOF_TASK_STATE_COMPLETED;
}

@lyakh
Copy link
Collaborator

lyakh commented Jan 16, 2023

Status can return -ENODATA and current status if xrun occurs

According to https://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html -EPIPE is used by ALSA to indicate an xrun?

@makarukp
Copy link
Contributor Author

@lyakh Accually -EINVAL can be returned in current implementation only by dw_dma_get_status() which is used by GPDMA in Zephyr. DMA uses intel_adsp_hda_dma_status() and there is only assertion __ASSERT(channel < cfg->dma_channels, "Channel does not exist"); .

@makarukp makarukp force-pushed the hw_hda_chain_support branch from 6eb4ac3 to 36e1c70 Compare January 16, 2023 11:48
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

This starts to look good. A few minor issues, but no showstoppers.

@makarukp makarukp force-pushed the hw_hda_chain_support branch from 36e1c70 to ca41ffa Compare January 16, 2023 12:38
Copy link
Collaborator

Choose a reason for hiding this comment

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

ipc4_chain_manager_create() seems to be a better name for this, but it's already there

Hardware HDA chain require manager for controlling multiple streams tasks.
Enable support with LL task and DMA mandatory logic.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
HW chain dma support require new logic in handler

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
Enable building chain dma component on TGL platform

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
Enable building chain dma component on MTL platform

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
Enable building chain dma component on TGL-H platform

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
@makarukp makarukp force-pushed the hw_hda_chain_support branch from ca41ffa to 414a12c Compare January 17, 2023 08:13
Copy link
Member

Choose a reason for hiding this comment

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

@lyakh this looks resolved now, error code is checked ?

Copy link
Member

Choose a reason for hiding this comment

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

@ujfalusi resolved ?

@marc-hb
Copy link
Collaborator

marc-hb commented Jan 20, 2023

This apparently caused regressions #6975 and #6976.

It was also merged while failing a large number of tests: https://sof-ci.01.org/sofpr/PR6656/build3409/devicetest/index.html

@lgirdwood
Copy link
Member

There is a lot of test failures on ADL capture, I've created a revert PR that can be merged today prior to daily test runs if we don't have fixes ready in time.

@lgirdwood
Copy link
Member

@makarukp @mwasko @kv2019i @lyakh fyi - does anyone have fix PRs in progress otherwise we will have to revert ?

@mwasko
Copy link
Contributor

mwasko commented Jan 20, 2023

@makarukp @mwasko @kv2019i @lyakh fyi - does anyone have fix PRs in progress otherwise we will have to revert ?

@lgirdwood, @kv2019i the regression is affecting only cAVS targets which are not POR in Zephyr configuration. The tests were passing before on cAVS because they were using w/a in form of copier-copier solution which is not correct implementation. We should treat it as we have enabled feature for MTL and for cAVS it is a to do action (on best effort basis).

@lgirdwood
Copy link
Member

@makarukp @mwasko @kv2019i @lyakh fyi - does anyone have fix PRs in progress otherwise we will have to revert ?

@lgirdwood, @kv2019i the regression is affecting only cAVS targets which are not POR in Zephyr configuration. The tests were passing before on cAVS because they were using w/a in form of copier-copier solution which is not correct implementation. We should treat it as we have enabled feature for MTL and for cAVS it is a to do action (on best effort basis).

I'm fine to make this a MTL only feature, but it should not break legacy features on other platforms. Can this be fixed with a Kconfig ?

@makarukp
Copy link
Contributor Author

makarukp commented Jan 20, 2023

@makarukp @mwasko @kv2019i @lyakh fyi - does anyone have fix PRs in progress otherwise we will have to revert ?

@lgirdwood, @kv2019i the regression is affecting only cAVS targets which are not POR in Zephyr configuration. The tests were passing before on cAVS because they were using w/a in form of copier-copier solution which is not correct implementation. We should treat it as we have enabled feature for MTL and for cAVS it is a to do action (on best effort basis).

I'm fine to make this a MTL only feature, but it should not break legacy features on other platforms. Can this be fixed with a Kconfig ?

@lgirdwood Unfortunately it is not possible to fix it with Kconfig because legacy approach was erased by hw chain dma PR.

As for #6975 (comment) issue it does not look like a big deal. I will prepare debug FW which could probably solve that problem or provide at least more information.

As for #6976 (comment) issue I don't know what happened and still thinking about further steps for debug ...

@makarukp
Copy link
Contributor Author

I prepared fix for #6975:
#6983

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.