Skip to content

audio: fix ipc tx timed out for 0x60060000 - #5857

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
andrula-song:align-api
May 26, 2022
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
andrula-song:align-api

Conversation

@andrula-song

Copy link
Copy Markdown
Contributor

Add local veriables to fix bug of ipc tx timed out for 0x60060000
(TRIG_PAUSE) when testing multiple-pause-resume on ADLP Chrome device.

Signed-off-by: Andrula Song xiaoyuan.song@intel.com

@andrula-song

Copy link
Copy Markdown
Contributor Author

compared with the function comp_get_copy_limits_with_lock,
` struct comp_buffer __sparse_cache *source_c, *sink_c;

source_c = buffer_acquire(source);
sink_c = buffer_acquire(sink);

comp_get_copy_limits(source_c, sink_c, cl);

buffer_release(source_c);
buffer_release(sink_c);`

maybe the root cause is the usage of local __sparse_cache variables.

Add local veriables to fix bug of ipc tx timed out for 0x60060000
(TRIG_PAUSE) when testing multiple-pause-resume on ADLP Chrome device.
Release the buffer locks symmetrically.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
struct comp_buffer *sink,
struct comp_copy_limits *cl)
{
source = buffer_acquire(source);

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.

@andrula-song whats the rationale for using a local variable? I understand it fixes the bug but how do we explain it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The bug is being fixed here as the ordering of the locking and unlocking is now symmetrical.

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.

@lgirdwood But the ordering of the locking and unlocking in function comp_get_copy_limits_with_lock is unsymmetrical too (And that will not lead to the bug).
Firstly I wanna test without transfer the order, but there would be failed issues of case check-suspend-resume-with-playback-5.sh and check-suspend-resume-with-capture-5.sh on WHL_UPEXT_HDA_ZEPHYR. After transfer the order of the locking and unlocking, these two failure are still exist. But both are not IPC time out.
@lyakh Can you help to introduce why we should use '__sparse_cache'?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lgirdwood But the ordering of the locking and unlocking in function comp_get_copy_limits_with_lock is unsymmetrical too (And that will not lead to the bug).

This need fixed too. Pls send a PR. Thanks.

@andrula-song

andrula-song commented May 26, 2022 •

Copy link
Copy Markdown
Contributor Author

@ranj063 I am not sure would this will fix the bug, but maybe @lyakh can help to explain why we should use comp_buffer with __sparse_cache.

@keqiaozhang

Copy link
Copy Markdown
Collaborator

Confirmed that this PR can fix #5850.

struct comp_buffer *sink,
struct comp_copy_limits *cl)
{
source = buffer_acquire(source);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The bug is being fixed here as the ordering of the locking and unlocking is now symmetrical.

@lgirdwood
lgirdwood marked this pull request as ready for review May 26, 2022 10:28
@lgirdwood
lgirdwood merged commit 13b6592 into thesofproject:main May 26, 2022
@marc-hb

marc-hb commented May 27, 2022

Copy link
Copy Markdown
Collaborator

but maybe @lyakh can help to explain why we should use comp_buffer with __sparse_cache.

So the local variables were required because __sparse_cache was required, correct?

In other words, the author of the fix does not fully understand the fix yet... very scary.

@andrula-song
andrula-song deleted the align-api branch July 26, 2022 01:28
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.

5 participants