Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASOC: SOF: Intel: hda-loader: add debug to IOC timeout #5142

Conversation

kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Aug 7, 2024

Debug patch to help test out the case #5136 is addressing.

kv2019i added 2 commits August 7, 2024 16:28
When a single-shot DMA is complete, hda_dsp_stream_get_position()
will point to hstream->bufsize.

Current code zeros out the returned position in this case as
ALSA core does not expect to get such values in its pointer callback.
While valid in the ALSA case, this is no helpful when debugging
other DMA usages, e.g. firmware loading.

Allow valid value of hstream->bufsize to be returned as a position.

Signed-off-by: Kai Vehmanen <[email protected]>
Print out DMA position upon failure to get IOC notification.

Signed-off-by: Kai Vehmanen <[email protected]>
@kv2019i
Copy link
Collaborator Author

kv2019i commented Aug 7, 2024

Uses debugging approach proposed in #5141 (but applies to the IOC error case).

@@ -1082,7 +1082,7 @@ snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream,
break;
}

if (pos >= hstream->bufsize)
if (pos > hstream->bufsize)
Copy link
Collaborator

Choose a reason for hiding this comment

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

you could make this conditional and apply it to non cyclic (one shot) transfers only, like the fw loading, library loading.

dev_err(sdev->dev, "Code loader DMA did not complete\n");
struct hdac_stream *hstream = &hext_stream->hstream;
snd_pcm_uframes_t pos = hda_dsp_stream_get_position(hstream, SNDRV_PCM_STREAM_PLAYBACK, 0);
dev_err(sdev->dev, "Code loader DMA did not complete, DMA pos %lu/%u\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Empty line between variable declaration and code block.

@kv2019i kv2019i closed this Sep 3, 2024
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.

2 participants