[SRU][OEM-B-OSP1][PATCH 0/4] alsa/sof: fix the hang issue on Dell Nebula MP platforms

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-B-OSP1][PATCH 0/4] alsa/sof: fix the hang issue on Dell Nebula MP platforms

Hui Wang
BugLink: http://bugs.launchpad.net/bugs/1845904

[Impact]
Hanging after installation on Nebula MP.
Reported by ODM and we also can reproduce on the MP machine
that ODM provided

[Fix]
Intel debugged this issue for half month, finally they provided
4 patches to fix it. Intel tested these 4 patches on many many
sof machines, they worked well.

[Test Case]
Install oem image to Nebula MP machines, there is no hang anymore,
and the audio functions all work well.

[Regression Risk]
Low. Intel already tested these patches on many machines. And
we also teste them, the original issue is fixed by them and no
new issues found.


Pan Xiuli (1):
  ALSA: sof: refine stop-start sequence for driver and FW

Rander Wang (3):
  ALSA: hda: clear output link mappinp
  ALSA: SOF: disable L1SEN for capture stream
  ALSA: sof: disable debug message for production release

 include/sound/hda_register.h        |  2 ++
 sound/hda/ext/hdac_ext_controller.c |  3 +++
 sound/soc/sof/Makefile              |  2 --
 sound/soc/sof/intel/Makefile        |  2 --
 sound/soc/sof/intel/hda-pcm.c       | 18 ++++++++++++++++++
 sound/soc/sof/intel/hda.h           |  3 +++
 sound/soc/sof/pcm.c                 |  9 ++++++++-
 sound/soc/sof/sof-priv.h            |  1 +
 sound/soc/sof/xtensa/Makefile       |  2 --
 9 files changed, 35 insertions(+), 7 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-B-OSP1][PATCH 1/4] ALSA: hda: clear output link mappinp

Hui Wang
From: Rander Wang <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1845904

All streams are valid with default status. Clear it
to invalidate them when powered up

Signed-off-by: Rander Wang <[hidden email]>
(cherry picked from commit 9e87d43e4da566c810d39c1d3142ebdecd83c7a2
git://github.com/thesofproject/linux.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 include/sound/hda_register.h        | 2 ++
 sound/hda/ext/hdac_ext_controller.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/include/sound/hda_register.h b/include/sound/hda_register.h
index 0fd39295b426..dae21fbbe8e6 100644
--- a/include/sound/hda_register.h
+++ b/include/sound/hda_register.h
@@ -264,6 +264,8 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
 #define AZX_REG_ML_LOUTPAY 0x20
 #define AZX_REG_ML_LINPAY 0x30
 
+#define ML_LOSIDV_STREAM_MASK 0xFFFE
+
 #define ML_LCTL_SCF_MASK 0xF
 #define AZX_MLCTL_SPA (0x1 << 16)
 #define AZX_MLCTL_CPA (0x1 << 23)
diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c
index 60cb00fd0c69..a794c319add5 100644
--- a/sound/hda/ext/hdac_ext_controller.c
+++ b/sound/hda/ext/hdac_ext_controller.c
@@ -278,6 +278,9 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
 
  ret = snd_hdac_ext_bus_link_power_up(link);
 
+ snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV,
+ ML_LOSIDV_STREAM_MASK, 0);
+
  /*
  *  wait for 521usec for codec to report status
  *  HDA spec section 4.3 - Codec Discovery
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-B-OSP1][PATCH 2/4] ALSA: SOF: disable L1SEN for capture stream

Hui Wang
In reply to this post by Hui Wang
From: Rander Wang <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1845904

Fix noise issue when doing capture

Signed-off-by: Rander Wang <[hidden email]>
(cherry picked from commit b1221cb7ed6efbe2f078538278535717981930d5
git://github.com/thesofproject/linux.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/sof/intel/hda-pcm.c | 18 ++++++++++++++++++
 sound/soc/sof/intel/hda.h     |  3 +++
 sound/soc/sof/sof-priv.h      |  1 +
 3 files changed, 22 insertions(+)

diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c
index 5714a79fbe1a..bcd7a30d51ee 100644
--- a/sound/soc/sof/intel/hda-pcm.c
+++ b/sound/soc/sof/intel/hda-pcm.c
@@ -215,6 +215,15 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
  return -ENODEV;
  }
 
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+ sdev->capture_stream_num++;
+ if (sdev->capture_stream_num == 1)
+ snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR,
+ HDA_DSP_EM2,
+ HDA_DSP_L1SEN,
+ 0);
+ }
+
  /* binding pcm substream to hda stream */
  substream->runtime->private_data = &dsp_stream->hstream;
  return 0;
@@ -234,6 +243,15 @@ int hda_dsp_pcm_close(struct snd_sof_dev *sdev,
  return -ENODEV;
  }
 
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+ sdev->capture_stream_num--;
+ if (sdev->capture_stream_num == 0)
+ snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR,
+ HDA_DSP_EM2,
+ HDA_DSP_L1SEN,
+ 1);
+ }
+
  /* unbinding pcm substream to hda stream */
  substream->runtime->private_data = NULL;
  return 0;
diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h
index 3ab90266244a..598d529c73fc 100644
--- a/sound/soc/sof/intel/hda.h
+++ b/sound/soc/sof/intel/hda.h
@@ -332,6 +332,9 @@
 #define SOF_SKL_NUM_DAIS 8
 #endif
 
+#define HDA_DSP_EM2 0x1030
+#define HDA_DSP_L1SEN BIT(13)
+
 /* Intel HD Audio SRAM Window 0*/
 #define HDA_ADSP_SRAM0_BASE_SKL 0x8000
 
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index 62132d36d311..4608437bffbe 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -427,6 +427,7 @@ struct snd_sof_dev {
  u32 dtrace_error;
  u32 msi_enabled;
 
+ u32 capture_stream_num;
  void *private; /* core does not touch this */
 };
 
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-B-OSP1][PATCH 3/4] ALSA: sof: refine stop-start sequence for driver and FW

Hui Wang
In reply to this post by Hui Wang
From: Pan Xiuli <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1845904

Stop FW first, then stop HDA controller
Start HDA contorller first, then start FW

Signed-off-by: Pan Xiuli <[hidden email]>
Signed-off-by: Rander Wang <[hidden email]>
(cherry picked from commit 2424b716fd1df0518f07ce9f205b20c3289a99be
git://github.com/thesofproject/linux.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/sof/pcm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c
index c0f29eb8645d..38cc7eeb4476 100644
--- a/sound/soc/sof/pcm.c
+++ b/sound/soc/sof/pcm.c
@@ -314,6 +314,7 @@ static int sof_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
  struct snd_sof_pcm *spcm;
  struct sof_ipc_stream stream;
  struct sof_ipc_reply reply;
+ bool ipc_first = false;
  int ret;
 
  /* nothing to do for BE */
@@ -334,6 +335,7 @@ static int sof_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
  switch (cmd) {
  case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
  stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_PAUSE;
+ ipc_first = true;
  break;
  case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
  stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_RELEASE;
@@ -354,18 +356,23 @@ static int sof_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
  case SNDRV_PCM_TRIGGER_SUSPEND:
  case SNDRV_PCM_TRIGGER_STOP:
  stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_STOP;
+ ipc_first = true;
  break;
  default:
  dev_err(sdev->dev, "error: unhandled trigger cmd %d\n", cmd);
  return -EINVAL;
  }
 
- snd_sof_pcm_platform_trigger(sdev, substream, cmd);
+ if (!ipc_first)
+ snd_sof_pcm_platform_trigger(sdev, substream, cmd);
 
  /* send IPC to the DSP */
  ret = sof_ipc_tx_message(sdev->ipc, stream.hdr.cmd, &stream,
  sizeof(stream), &reply, sizeof(reply));
 
+ if (ipc_first)
+ snd_sof_pcm_platform_trigger(sdev, substream, cmd);
+
  if (ret < 0 || cmd != SNDRV_PCM_TRIGGER_SUSPEND)
  return ret;
 
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-B-OSP1][PATCH 4/4] ALSA: sof: disable debug message for production release

Hui Wang
In reply to this post by Hui Wang
From: Rander Wang <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1845904

It is clear for release version without many debug messages.

Signed-off-by: Rander Wang <[hidden email]>
(cherry picked from commit 6a4a82454644b858e9ad4f3d733b3b62a5aec5cc
git://github.com/thesofproject/linux.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/sof/Makefile        | 2 --
 sound/soc/sof/intel/Makefile  | 2 --
 sound/soc/sof/xtensa/Makefile | 2 --
 3 files changed, 6 deletions(-)

diff --git a/sound/soc/sof/Makefile b/sound/soc/sof/Makefile
index 33c3ded2b7e2..8f14c9d2950b 100644
--- a/sound/soc/sof/Makefile
+++ b/sound/soc/sof/Makefile
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
 
-ccflags-y += -DDEBUG
-
 snd-sof-objs := core.o ops.o loader.o ipc.o pcm.o pm.o debug.o topology.o\
  control.o trace.o utils.o
 
diff --git a/sound/soc/sof/intel/Makefile b/sound/soc/sof/intel/Makefile
index 03b22924d0c4..84a65c80f62a 100644
--- a/sound/soc/sof/intel/Makefile
+++ b/sound/soc/sof/intel/Makefile
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
 
-ccflags-y += -DDEBUG
-
 snd-sof-intel-byt-objs := byt.o
 snd-sof-intel-hsw-objs := hsw.o
 snd-sof-intel-bdw-objs := bdw.o
diff --git a/sound/soc/sof/xtensa/Makefile b/sound/soc/sof/xtensa/Makefile
index 34b27be0f7be..cc89c7472a38 100644
--- a/sound/soc/sof/xtensa/Makefile
+++ b/sound/soc/sof/xtensa/Makefile
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
 
-ccflags-y += -DDEBUG
-
 snd-sof-xtensa-dsp-objs := core.o
 
 obj-$(CONFIG_SND_SOC_SOF_XTENSA) += snd-sof-xtensa-dsp.o
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED Re: [SRU][OEM-B-OSP1][PATCH 0/4] alsa/sof: fix the hang issue on Dell Nebula MP platforms

Timo Aaltonen-6
In reply to this post by Hui Wang
On 30.9.2019 9.00, Hui Wang wrote:
> BugLink: http://bugs.launchpad.net/bugs/1845904
>
> [Impact]
> Hanging after installation on Nebula MP.
> Reported by ODM and we also can reproduce on the MP machine
> that ODM provided

applied to osp1 oem-next, thanks

--
t

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team