Skip to content

Conversation

@jason77-wang
Copy link

@jason77-wang jason77-wang commented Nov 3, 2021

On the latest Lenovo Thinkstation laptops, we often experience the
speaker failure after rebooting, check the dmesg, we could see:
sof-audio-pci-intel-tgl 0000:00:1f.3: codec #0 probe error, ret: -5

The analogue codec on the machine is ALC287, then we designed a
testcase to reboot and check the codec probing result repeatedly, we
found the analogue codec probing always failed at least once within
several minutes to several hours (roughly 1 reboot per min). This
issue happens on all laptops of this Thinkstation model, but with
legacy HDA driver, we couldn't reproduce this issue on those laptops.
And so far, this issue is not reproduced on machines which don't
belong to this model.

We tried to make the hda_dsp_ctrl_init_chip() same as
hda_intel_init_chip() which is the controller init routine in the
legacy HDA driver, but it didn't help.

We found when issue happens, the resp is -1, and if we let driver
re-run send_cmd() and get_response(), it will get the correct response
10ec0287, then driver continues the rest work, finally boot to the
desktop and all audio function work well.

Here adding codec probing retries to 3 times, it could fix the issue
on this Thinkstation model, and it doesn't bring impact to other
machines.

Signed-off-by: Hui Wang hui.wang@canonical.com

bardliao
bardliao previously approved these changes Nov 3, 2021
Copy link
Collaborator

@bardliao bardliao left a comment

Choose a reason for hiding this comment

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

LGTM

kv2019i
kv2019i previously approved these changes Nov 9, 2021
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.

With the conclusions in discussion 545d7ec#r745535189 , I think this is the best way to address this problem now.

@kv2019i kv2019i requested a review from plbossart November 9, 2021 11:43
On the latest Lenovo Thinkstation laptops, we often experience the
speaker failure after rebooting, check the dmesg, we could see:
 sof-audio-pci-intel-tgl 0000:00:1f.3: codec #0 probe error, ret: -5

The analogue codec on the machine is ALC287, then we designed a
testcase to reboot and check the codec probing result repeatedly, we
found the analogue codec probing always failed at least once within
several minutes to several hours (roughly 1 reboot per min). This
issue happens on all laptops of this Thinkstation model, but with
legacy HDA driver, we couldn't reproduce this issue on those laptops.
And so far, this issue is not reproduced on machines which don't
belong to this model.

We tried to make the hda_dsp_ctrl_init_chip() same as
hda_intel_init_chip() which is the controller init routine in the
legacy HDA driver, but it didn't help.

We found when issue happens, the resp is -1, and if we let driver
re-run send_cmd() and get_response(), it will get the correct response
10ec0287, then driver continues the rest work, finally boot to the
desktop and all audio function work well.

Here adding codec probing retries to 3 times, it could fix the issue
on this Thinkstation model, and it doesn't bring impact to other
machines.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
@kv2019i kv2019i merged commit 1c276e0 into thesofproject:topic/sof-dev Nov 15, 2021
marc-hb added a commit to marc-hb/sof-test that referenced this pull request Feb 18, 2022
Now that the test has been just fixed in commit 71a9cca, of course
it started failing:

https://sof-ci.01.org/sofpr/PR5383/build12069/devicetest/?model=BYT_MB_NOCODEC&testcase=check-kmod-load-unload-after-playback

This proves the older version wasn't testing anything: classic case of
"green failure"
https://github.com/thesofproject/sof-test/issues?q=+label%3A%22False+Pass+%2F+green+failure%22+

Firmware does not boot instantly. We even have retries:

thesofproject/linux#3255
thesofproject/linux@2a3c9269474c

So, poll journalctl for a maximum of 5 seconds before failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
marc-hb added a commit to marc-hb/sof-test that referenced this pull request Feb 18, 2022
Now that the test has been just fixed in commit 71a9cca, of course
it started failing:

https://sof-ci.01.org/sofpr/PR5383/build12069/devicetest/?model=BYT_MB_NOCODEC&testcase=check-kmod-load-unload-after-playback

This proves the older version wasn't testing anything: classic case of
"green failure"
https://github.com/thesofproject/sof-test/issues?q=+label%3A%22False+Pass+%2F+green+failure%22+

Firmware does not boot instantly. We even have retries for when it
fails:

thesofproject/linux#3255
thesofproject/linux@2a3c9269474c

So, poll journalctl for a maximum of 5 seconds before failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
marc-hb added a commit to marc-hb/sof-test that referenced this pull request Feb 18, 2022
Now that the test has been just fixed in commit 71a9cca, of course
it started failing:

https://sof-ci.01.org/sofpr/PR5383/build12069/devicetest/?model=BYT_MB_NOCODEC&testcase=check-kmod-load-unload-after-playback

This proves the older version wasn't testing anything: classic case of
"green failure"
https://github.com/thesofproject/sof-test/issues?q=+label%3A%22False+Pass+%2F+green+failure%22+

Firmware does not boot instantly. We even have retries for when it
fails:

thesofproject/linux#3255
thesofproject/linux@2a3c9269474c

So, poll journalctl for a maximum of 10 seconds before failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
marc-hb added a commit to thesofproject/sof-test that referenced this pull request Feb 23, 2022
Now that the test has been just fixed in commit 71a9cca, of course
it started failing:

https://sof-ci.01.org/sofpr/PR5383/build12069/devicetest/?model=BYT_MB_NOCODEC&testcase=check-kmod-load-unload-after-playback

This proves the older version wasn't testing anything: classic case of
"green failure"
https://github.com/thesofproject/sof-test/issues?q=+label%3A%22False+Pass+%2F+green+failure%22+

Firmware does not boot instantly. We even have retries for when it
fails:

thesofproject/linux#3255
thesofproject/linux@2a3c9269474c

So, poll journalctl for a maximum of 10 seconds before failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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.

4 participants