-
Notifications
You must be signed in to change notification settings - Fork 142
[DNM] Random attempts to fix controller reset issue #4894
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,6 +188,7 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev) | |
| struct hdac_bus *bus = sof_to_bus(sdev); | ||
| struct hdac_stream *stream; | ||
| int sd_offset, ret = 0; | ||
| u32 gctl; | ||
|
|
||
| if (bus->chip_init) | ||
| return 0; | ||
|
|
@@ -196,6 +197,12 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev) | |
|
|
||
| hda_dsp_ctrl_misc_clock_gating(sdev, false); | ||
|
|
||
| /* clear WAKE_STS if not in reset */ | ||
| gctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_GCTL); | ||
| if (gctl & SOF_HDA_GCTL_RESET) | ||
| snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, | ||
| SOF_HDA_WAKESTS, SOF_HDA_WAKESTS_INT_MASK); | ||
|
|
||
| /* reset HDA controller */ | ||
| ret = hda_dsp_ctrl_link_reset(sdev, true); | ||
| if (ret < 0) { | ||
|
|
@@ -284,10 +291,6 @@ void hda_dsp_ctrl_stop_chip(struct snd_sof_dev *sdev) | |
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, | ||
| SOF_HDA_INT_ALL_STREAM, 0); | ||
|
|
||
| /* disable controller CIE and GIE */ | ||
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, | ||
| SOF_HDA_INT_CTRL_EN | SOF_HDA_INT_GLOBAL_EN, | ||
| 0); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question is does snd_sof_dsp_write need the interrupts?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if this is useful, what I was thinking is that disabling the interrupts and then stopping the commands makes no sense in general. If there was an in-flight command it would be blocked, be it with the CORB/RIRB or PIO mode. For now this doesn't have any effect so we can drop it. Still it'd be good to double-check this.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PIO mode is polling on the IC registers, it is not using interrupts, CORB/RIRB uses interrupts. |
||
|
|
||
| /* clear stream status */ | ||
| list_for_each_entry(stream, &bus->stream_list, list) { | ||
|
|
@@ -317,6 +320,11 @@ void hda_dsp_ctrl_stop_chip(struct snd_sof_dev *sdev) | |
| SOF_HDA_ADSP_DPUBASE, 0); | ||
| } | ||
|
|
||
| /* disable controller CIE and GIE */ | ||
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, | ||
| SOF_HDA_INT_CTRL_EN | SOF_HDA_INT_GLOBAL_EN, | ||
| 0); | ||
|
|
||
| bus->chip_init = false; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart @ujfalusi This is really curious. HDA-spec wise this clearing is not needed, the state will be reset with controller reset. But indeed in snd-hda-intel, this has been historically done to avoid bugs, but until now, we've not needed this in SOF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, based on my test, the commit does help on updating GCTL value in hda_dsp_ctrl_link_reset().
gctlwill be always 1 without this commit. But I don't get the reason why clear WAKE_STS helps on this. Looks like something is blocked?