Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/include/sof/audio/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -862,13 +862,15 @@ void comp_get_copy_limits_with_lock_frame_aligned(struct comp_buffer *source,
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.

sink = buffer_acquire(sink);
struct comp_buffer __sparse_cache *source_c, *sink_c;

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

comp_get_copy_limits_frame_aligned(source, sink, cl);
comp_get_copy_limits_frame_aligned(source_c, sink_c, cl);

buffer_release(source);
buffer_release(sink);
buffer_release(sink_c);
buffer_release(source_c);
}

/**
Expand Down