mbox series

[v2,0/3] SOF: Fix HDMI probe errors on GLK devices

Message ID 20200120160117.29130-1-kai.vehmanen@linux.intel.com (mailing list archive)
Headers show
Series SOF: Fix HDMI probe errors on GLK devices | expand

Message

Kai Vehmanen Jan. 20, 2020, 4:01 p.m. UTC
Hi Mark and Pierre,
here's a patch series to address an issue that popped up
after SOF changed from hdac-hdmi to snd-hda-codec-hdmi:

"failed to get afg sub nodes on ChromeOS devices"
https://github.com/thesofproject/linux/issues/1642

v2 changes:
 - rebased on top of broonie/for-next
 - added Takashi's reviewed-by to the one HDA patch, agreed
   the series should go via asoc tree

This is fairly hard to hit and only occurs on some devices (most
current reports are Gemini Lake based Chromebooks), but when
it does, it is rather severe as the whole SOF probe fails
because of this, and user is left without sound.

First fix is to optimize out one power down/up cycle from
the probe process. On platforms such as GLK, each time
audio driver does acomp's get_power(), graphics typically
needs to do a modeset due to clocking requirements for the HDA
bus. This can cause display to flash when audio is probed, plus
in the reported cases on GLK, can lead to probe failures.

The above change doesn't cover all reported cases, so additionally
retry logic is added to snd_hda_get_sub_nodes() calls on
Intel platforms. Multiple other approaches were investigated,
but a simple retry -- although less than ideal -- in the end proved to
be most reliable solution. HDA dump on one affected Acer Chromebook
looks like this:

# codec initialization goes as normal with multiple successful cmds
           udevd-9486  [001] ....  3910.087791: hda_send_cmd: [0000:00:0e.0:2] val=0x207f1c00
           udevd-9486  [001] ....  3910.087857: hda_get_response: [0000:00:0e.0:2] val=0x18560010
           udevd-9486  [001] ....  3910.087858: hda_send_cmd: [0000:00:0e.0:2] val=0x207f0700
           udevd-9486  [001] ....  3910.087931: hda_get_response: [0000:00:0e.0:2] val=0x00000000
           udevd-9486  [001] ....  3910.087932: hda_send_cmd: [0000:00:0e.0:2] val=0x20bf8100
           udevd-9486  [001] ....  3910.088040: hda_get_response: [0000:00:0e.0:2] val=0x00000001
           udevd-9486  [001] ....  3910.088044: hda_send_cmd: [0000:00:0e.0:2] val=0x20b78103
# here get params for AC_PAR_NODE_COUNT fails, 0xffffffff is returned
           udevd-9486  [001] ....  3910.088048: hda_send_cmd: [0000:00:0e.0:2] val=0x201f0004
           udevd-9486  [001] ....  3911.090131: hda_get_response: [0000:00:0e.0:2] val=0xffffffff
# retry is successful
           udevd-9486  [001] ....  3911.090152: hda_send_cmd: [0000:00:0e.0:2] val=0x201f0004
           udevd-9486  [001] ....  3911.090288: hda_get_response: [0000:00:0e.0:2] val=0x00020006

Kai Vehmanen (3):
  ASoC: SOF: Intel: refactor i915_get/put functions
  ASoC: SOF: Intel: do not disable i915 power during probe
  ALSA: hda/hdmi - add retry logic to parse_intel_hdmi()

 sound/pci/hda/patch_hdmi.c      |  7 +++++--
 sound/soc/sof/intel/hda-codec.c | 21 ++++++---------------
 sound/soc/sof/intel/hda.c       |  3 ++-
 sound/soc/sof/intel/hda.h       |  7 +++----
 4 files changed, 16 insertions(+), 22 deletions(-)