From: Greg Kroah-Hartman Date: Tue, 1 Dec 2020 08:42:54 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.4.247~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c0d4bf5af9ac8f31da11901b0939c91499255db;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: asoc-intel-allow-for-rom-init-retry-on-cnl-platforms.patch asoc-intel-multiple-i-o-pcm-format-support-for-pipe.patch asoc-intel-skylake-automatic-dmic-format-configuration-according-to-information-from-nhlt.patch asoc-intel-skylake-await-purge-request-ack-on-cnl.patch asoc-intel-skylake-enable-codec-wakeup-during-chip-init.patch asoc-intel-skylake-remove-superfluous-chip-initialization.patch asoc-intel-skylake-select-hda-configuration-permissively.patch asoc-intel-skylake-shield-against-no-nhlt-configurations.patch --- diff --git a/queue-5.4/asoc-intel-allow-for-rom-init-retry-on-cnl-platforms.patch b/queue-5.4/asoc-intel-allow-for-rom-init-retry-on-cnl-platforms.patch new file mode 100644 index 00000000000..24ed3caaeeb --- /dev/null +++ b/queue-5.4/asoc-intel-allow-for-rom-init-retry-on-cnl-platforms.patch @@ -0,0 +1,91 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:45 +0100 +Subject: ASoC: Intel: Allow for ROM init retry on CNL platforms +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Cezary Rojewski +Message-ID: <20201129114148.13772-6-cezary.rojewski@intel.com> + +From: Cezary Rojewski + +commit 024aa45f55ccd40704cfdef61b2a8b6d0de9cdd1 upstream. + +Due to unconditional initial timeouts, firmware may fail to load during +its initialization. This issue cannot be resolved on driver side as it +is caused by external sources such as CSME but has to be accounted for +nonetheless. + +Fixes: cb6a55284629 ("ASoC: Intel: cnl: Add sst library functions for cnl platform") +Signed-off-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200305145314.32579-7-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/bxt-sst.c | 2 -- + sound/soc/intel/skylake/cnl-sst.c | 15 ++++++++++----- + sound/soc/intel/skylake/skl-sst-dsp.h | 1 + + 3 files changed, 11 insertions(+), 7 deletions(-) + +--- a/sound/soc/intel/skylake/bxt-sst.c ++++ b/sound/soc/intel/skylake/bxt-sst.c +@@ -38,8 +38,6 @@ + /* Delay before scheduling D0i3 entry */ + #define BXT_D0I3_DELAY 5000 + +-#define BXT_FW_ROM_INIT_RETRY 3 +- + static unsigned int bxt_get_errorcode(struct sst_dsp *ctx) + { + return sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE); +--- a/sound/soc/intel/skylake/cnl-sst.c ++++ b/sound/soc/intel/skylake/cnl-sst.c +@@ -109,7 +109,7 @@ static int cnl_load_base_firmware(struct + { + struct firmware stripped_fw; + struct skl_dev *cnl = ctx->thread_context; +- int ret; ++ int ret, i; + + if (!ctx->fw) { + ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev); +@@ -131,12 +131,16 @@ static int cnl_load_base_firmware(struct + stripped_fw.size = ctx->fw->size; + skl_dsp_strip_extended_manifest(&stripped_fw); + +- ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size); +- if (ret < 0) { +- dev_err(ctx->dev, "prepare firmware failed: %d\n", ret); +- goto cnl_load_base_firmware_failed; ++ for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) { ++ ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size); ++ if (!ret) ++ break; ++ dev_dbg(ctx->dev, "prepare firmware failed: %d\n", ret); + } + ++ if (ret < 0) ++ goto cnl_load_base_firmware_failed; ++ + ret = sst_transfer_fw_host_dma(ctx); + if (ret < 0) { + dev_err(ctx->dev, "transfer firmware failed: %d\n", ret); +@@ -158,6 +162,7 @@ static int cnl_load_base_firmware(struct + return 0; + + cnl_load_base_firmware_failed: ++ dev_err(ctx->dev, "firmware load failed: %d\n", ret); + release_firmware(ctx->fw); + ctx->fw = NULL; + +--- a/sound/soc/intel/skylake/skl-sst-dsp.h ++++ b/sound/soc/intel/skylake/skl-sst-dsp.h +@@ -67,6 +67,7 @@ struct skl_dev; + + #define SKL_FW_INIT 0x1 + #define SKL_FW_RFW_START 0xf ++#define BXT_FW_ROM_INIT_RETRY 3 + + #define SKL_ADSPIC_IPC 1 + #define SKL_ADSPIS_IPC 1 diff --git a/queue-5.4/asoc-intel-multiple-i-o-pcm-format-support-for-pipe.patch b/queue-5.4/asoc-intel-multiple-i-o-pcm-format-support-for-pipe.patch new file mode 100644 index 00000000000..ced0366438f --- /dev/null +++ b/queue-5.4/asoc-intel-multiple-i-o-pcm-format-support-for-pipe.patch @@ -0,0 +1,179 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:47 +0100 +Subject: ASoC: Intel: Multiple I/O PCM format support for pipe +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Pavan K S +Message-ID: <20201129114148.13772-8-cezary.rojewski@intel.com> + +From: Mateusz Gorski + +commit 1b450791d517d4d6666ab9ab6d9a20c8819e3572 upstream. + +For pipes supporting multiple input/output formats, kcontrol is +created and selection of pipe input and output configuration +is done based on control set. + +If more than one configuration is supported, then this patch +allows user to select configuration of choice +using amixer settings. + +Signed-off-by: Mateusz Gorski +Signed-off-by: Pavan K S +Reviewed-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200427132727.24942-3-mateusz.gorski@linux.intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/sound/skl-tplg-interface.h | 1 + sound/soc/intel/skylake/skl-topology.c | 95 ++++++++++++++++++++++++++++++++ + sound/soc/intel/skylake/skl-topology.h | 1 + 3 files changed, 97 insertions(+) + +--- a/include/uapi/sound/skl-tplg-interface.h ++++ b/include/uapi/sound/skl-tplg-interface.h +@@ -18,6 +18,7 @@ + */ + #define SKL_CONTROL_TYPE_BYTE_TLV 0x100 + #define SKL_CONTROL_TYPE_MIC_SELECT 0x102 ++#define SKL_CONTROL_TYPE_MULTI_IO_SELECT 0x103 + + #define HDA_SST_CFG_MAX 900 /* size of copier cfg*/ + #define MAX_IN_QUEUE 8 +--- a/sound/soc/intel/skylake/skl-topology.c ++++ b/sound/soc/intel/skylake/skl-topology.c +@@ -579,6 +579,38 @@ static int skl_tplg_unload_pipe_modules( + return ret; + } + ++static bool skl_tplg_is_multi_fmt(struct skl_dev *skl, struct skl_pipe *pipe) ++{ ++ struct skl_pipe_fmt *cur_fmt; ++ struct skl_pipe_fmt *next_fmt; ++ int i; ++ ++ if (pipe->nr_cfgs <= 1) ++ return false; ++ ++ if (pipe->conn_type != SKL_PIPE_CONN_TYPE_FE) ++ return true; ++ ++ for (i = 0; i < pipe->nr_cfgs - 1; i++) { ++ if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) { ++ cur_fmt = &pipe->configs[i].out_fmt; ++ next_fmt = &pipe->configs[i + 1].out_fmt; ++ } else { ++ cur_fmt = &pipe->configs[i].in_fmt; ++ next_fmt = &pipe->configs[i + 1].in_fmt; ++ } ++ ++ if (!CHECK_HW_PARAMS(cur_fmt->channels, cur_fmt->freq, ++ cur_fmt->bps, ++ next_fmt->channels, ++ next_fmt->freq, ++ next_fmt->bps)) ++ return true; ++ } ++ ++ return false; ++} ++ + /* + * Here, we select pipe format based on the pipe type and pipe + * direction to determine the current config index for the pipeline. +@@ -601,6 +633,14 @@ skl_tplg_get_pipe_config(struct skl_dev + return 0; + } + ++ if (skl_tplg_is_multi_fmt(skl, pipe)) { ++ pipe->cur_config_idx = pipe->pipe_config_idx; ++ pipe->memory_pages = pconfig->mem_pages; ++ dev_dbg(skl->dev, "found pipe config idx:%d\n", ++ pipe->cur_config_idx); ++ return 0; ++ } ++ + if (pipe->conn_type == SKL_PIPE_CONN_TYPE_NONE) { + dev_dbg(skl->dev, "No conn_type detected, take 0th config\n"); + pipe->cur_config_idx = 0; +@@ -1315,6 +1355,56 @@ static int skl_tplg_pga_event(struct snd + return 0; + } + ++static int skl_tplg_multi_config_set_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol, ++ bool is_set) ++{ ++ struct snd_soc_component *component = ++ snd_soc_kcontrol_component(kcontrol); ++ struct hdac_bus *bus = snd_soc_component_get_drvdata(component); ++ struct skl_dev *skl = bus_to_skl(bus); ++ struct skl_pipeline *ppl; ++ struct skl_pipe *pipe = NULL; ++ struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; ++ u32 *pipe_id; ++ ++ if (!ec) ++ return -EINVAL; ++ ++ if (is_set && ucontrol->value.enumerated.item[0] > ec->items) ++ return -EINVAL; ++ ++ pipe_id = ec->dobj.private; ++ ++ list_for_each_entry(ppl, &skl->ppl_list, node) { ++ if (ppl->pipe->ppl_id == *pipe_id) { ++ pipe = ppl->pipe; ++ break; ++ } ++ } ++ if (!pipe) ++ return -EIO; ++ ++ if (is_set) ++ pipe->pipe_config_idx = ucontrol->value.enumerated.item[0]; ++ else ++ ucontrol->value.enumerated.item[0] = pipe->pipe_config_idx; ++ ++ return 0; ++} ++ ++static int skl_tplg_multi_config_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return skl_tplg_multi_config_set_get(kcontrol, ucontrol, false); ++} ++ ++static int skl_tplg_multi_config_set(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return skl_tplg_multi_config_set_get(kcontrol, ucontrol, true); ++} ++ + static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol, + unsigned int __user *data, unsigned int size) + { +@@ -1854,6 +1944,11 @@ static const struct snd_soc_tplg_kcontro + .get = skl_tplg_mic_control_get, + .put = skl_tplg_mic_control_set, + }, ++ { ++ .id = SKL_CONTROL_TYPE_MULTI_IO_SELECT, ++ .get = skl_tplg_multi_config_get, ++ .put = skl_tplg_multi_config_set, ++ }, + }; + + static int skl_tplg_fill_pipe_cfg(struct device *dev, +--- a/sound/soc/intel/skylake/skl-topology.h ++++ b/sound/soc/intel/skylake/skl-topology.h +@@ -306,6 +306,7 @@ struct skl_pipe { + struct skl_path_config configs[SKL_MAX_PATH_CONFIGS]; + struct list_head w_list; + bool passthru; ++ u32 pipe_config_idx; + }; + + enum skl_module_state { diff --git a/queue-5.4/asoc-intel-skylake-automatic-dmic-format-configuration-according-to-information-from-nhlt.patch b/queue-5.4/asoc-intel-skylake-automatic-dmic-format-configuration-according-to-information-from-nhlt.patch new file mode 100644 index 00000000000..f52627a4fa3 --- /dev/null +++ b/queue-5.4/asoc-intel-skylake-automatic-dmic-format-configuration-according-to-information-from-nhlt.patch @@ -0,0 +1,143 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:48 +0100 +Subject: ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com +Message-ID: <20201129114148.13772-9-cezary.rojewski@intel.com> + +From: Mateusz Gorski + +commit 2d744ecf2b98405723a2138a547e5c75009bc4e5 upstream. + +Automatically choose DMIC pipeline format configuration depending on +information included in NHLT. +Change the access rights of appropriate kcontrols to read-only in order +to prevent user interference. + +Signed-off-by: Mateusz Gorski +Reviewed-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200427132727.24942-4-mateusz.gorski@linux.intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/sound/skl-tplg-interface.h | 1 + sound/soc/intel/skylake/skl-topology.c | 64 ++++++++++++++++++++++++++++++-- + 2 files changed, 62 insertions(+), 3 deletions(-) + +--- a/include/uapi/sound/skl-tplg-interface.h ++++ b/include/uapi/sound/skl-tplg-interface.h +@@ -19,6 +19,7 @@ + #define SKL_CONTROL_TYPE_BYTE_TLV 0x100 + #define SKL_CONTROL_TYPE_MIC_SELECT 0x102 + #define SKL_CONTROL_TYPE_MULTI_IO_SELECT 0x103 ++#define SKL_CONTROL_TYPE_MULTI_IO_SELECT_DMIC 0x104 + + #define HDA_SST_CFG_MAX 900 /* size of copier cfg*/ + #define MAX_IN_QUEUE 8 +--- a/sound/soc/intel/skylake/skl-topology.c ++++ b/sound/soc/intel/skylake/skl-topology.c +@@ -1405,6 +1405,18 @@ static int skl_tplg_multi_config_set(str + return skl_tplg_multi_config_set_get(kcontrol, ucontrol, true); + } + ++static int skl_tplg_multi_config_get_dmic(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return skl_tplg_multi_config_set_get(kcontrol, ucontrol, false); ++} ++ ++static int skl_tplg_multi_config_set_dmic(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return skl_tplg_multi_config_set_get(kcontrol, ucontrol, true); ++} ++ + static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol, + unsigned int __user *data, unsigned int size) + { +@@ -1949,6 +1961,11 @@ static const struct snd_soc_tplg_kcontro + .get = skl_tplg_multi_config_get, + .put = skl_tplg_multi_config_set, + }, ++ { ++ .id = SKL_CONTROL_TYPE_MULTI_IO_SELECT_DMIC, ++ .get = skl_tplg_multi_config_get_dmic, ++ .put = skl_tplg_multi_config_set_dmic, ++ } + }; + + static int skl_tplg_fill_pipe_cfg(struct device *dev, +@@ -3109,12 +3126,21 @@ static int skl_tplg_control_load(struct + case SND_SOC_TPLG_CTL_ENUM: + tplg_ec = container_of(hdr, + struct snd_soc_tplg_enum_control, hdr); +- if (kctl->access & SNDRV_CTL_ELEM_ACCESS_READWRITE) { ++ if (kctl->access & SNDRV_CTL_ELEM_ACCESS_READ) { + se = (struct soc_enum *)kctl->private_value; + if (tplg_ec->priv.size) +- return skl_init_enum_data(bus->dev, se, +- tplg_ec); ++ skl_init_enum_data(bus->dev, se, tplg_ec); + } ++ ++ /* ++ * now that the control initializations are done, remove ++ * write permission for the DMIC configuration enums to ++ * avoid conflicts between NHLT settings and user interaction ++ */ ++ ++ if (hdr->ops.get == SKL_CONTROL_TYPE_MULTI_IO_SELECT_DMIC) ++ kctl->access = SNDRV_CTL_ELEM_ACCESS_READ; ++ + break; + + default: +@@ -3584,6 +3610,37 @@ static int skl_manifest_load(struct snd_ + return 0; + } + ++static void skl_tplg_complete(struct snd_soc_component *component) ++{ ++ struct snd_soc_dobj *dobj; ++ struct snd_soc_acpi_mach *mach = ++ dev_get_platdata(component->card->dev); ++ int i; ++ ++ list_for_each_entry(dobj, &component->dobj_list, list) { ++ struct snd_kcontrol *kcontrol = dobj->control.kcontrol; ++ struct soc_enum *se = ++ (struct soc_enum *)kcontrol->private_value; ++ char **texts = dobj->control.dtexts; ++ char chan_text[4]; ++ ++ if (dobj->type != SND_SOC_DOBJ_ENUM || ++ dobj->control.kcontrol->put != ++ skl_tplg_multi_config_set_dmic) ++ continue; ++ sprintf(chan_text, "c%d", mach->mach_params.dmic_num); ++ ++ for (i = 0; i < se->items; i++) { ++ struct snd_ctl_elem_value val; ++ ++ if (strstr(texts[i], chan_text)) { ++ val.value.enumerated.item[0] = i; ++ kcontrol->put(kcontrol, &val); ++ } ++ } ++ } ++} ++ + static struct snd_soc_tplg_ops skl_tplg_ops = { + .widget_load = skl_tplg_widget_load, + .control_load = skl_tplg_control_load, +@@ -3593,6 +3650,7 @@ static struct snd_soc_tplg_ops skl_tplg_ + .io_ops_count = ARRAY_SIZE(skl_tplg_kcontrol_ops), + .manifest = skl_manifest_load, + .dai_load = skl_dai_load, ++ .complete = skl_tplg_complete, + }; + + /* diff --git a/queue-5.4/asoc-intel-skylake-await-purge-request-ack-on-cnl.patch b/queue-5.4/asoc-intel-skylake-await-purge-request-ack-on-cnl.patch new file mode 100644 index 00000000000..9e0d3008559 --- /dev/null +++ b/queue-5.4/asoc-intel-skylake-await-purge-request-ack-on-cnl.patch @@ -0,0 +1,90 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:46 +0100 +Subject: ASoC: Intel: Skylake: Await purge request ack on CNL +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Cezary Rojewski +Message-ID: <20201129114148.13772-7-cezary.rojewski@intel.com> + +From: Cezary Rojewski + +commit 7693cadac86548b30389a6e11d78c38db654f393 upstream. + +Each purge request is sent by driver after master core is powered up and +unresetted but before it is unstalled. On unstall, ROM begins processing +the request and initializing environment for FW load. Host should await +ROM's ack before moving forward. Without doing so, ROM init poll may +start too early and false timeouts can occur. + +Fixes: cb6a55284629 ("ASoC: Intel: cnl: Add sst library functions for cnl platform") +Signed-off-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200305145314.32579-8-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/bxt-sst.c | 1 - + sound/soc/intel/skylake/cnl-sst.c | 20 ++++++++++++++++++-- + sound/soc/intel/skylake/skl-sst-dsp.h | 1 + + 3 files changed, 19 insertions(+), 3 deletions(-) + +--- a/sound/soc/intel/skylake/bxt-sst.c ++++ b/sound/soc/intel/skylake/bxt-sst.c +@@ -17,7 +17,6 @@ + #include "skl.h" + + #define BXT_BASEFW_TIMEOUT 3000 +-#define BXT_INIT_TIMEOUT 300 + #define BXT_ROM_INIT_TIMEOUT 70 + #define BXT_IPC_PURGE_FW 0x01004000 + +--- a/sound/soc/intel/skylake/cnl-sst.c ++++ b/sound/soc/intel/skylake/cnl-sst.c +@@ -57,18 +57,34 @@ static int cnl_prepare_fw(struct sst_dsp + ctx->dsp_ops.stream_tag = stream_tag; + memcpy(ctx->dmab.area, fwdata, fwsize); + ++ ret = skl_dsp_core_power_up(ctx, SKL_DSP_CORE0_MASK); ++ if (ret < 0) { ++ dev_err(ctx->dev, "dsp core0 power up failed\n"); ++ ret = -EIO; ++ goto base_fw_load_failed; ++ } ++ + /* purge FW request */ + sst_dsp_shim_write(ctx, CNL_ADSP_REG_HIPCIDR, + CNL_ADSP_REG_HIPCIDR_BUSY | (CNL_IPC_PURGE | + ((stream_tag - 1) << CNL_ROM_CTRL_DMA_ID))); + +- ret = cnl_dsp_enable_core(ctx, SKL_DSP_CORE0_MASK); ++ ret = skl_dsp_start_core(ctx, SKL_DSP_CORE0_MASK); + if (ret < 0) { +- dev_err(ctx->dev, "dsp boot core failed ret: %d\n", ret); ++ dev_err(ctx->dev, "Start dsp core failed ret: %d\n", ret); + ret = -EIO; + goto base_fw_load_failed; + } + ++ ret = sst_dsp_register_poll(ctx, CNL_ADSP_REG_HIPCIDA, ++ CNL_ADSP_REG_HIPCIDA_DONE, ++ CNL_ADSP_REG_HIPCIDA_DONE, ++ BXT_INIT_TIMEOUT, "HIPCIDA Done"); ++ if (ret < 0) { ++ dev_err(ctx->dev, "timeout for purge request: %d\n", ret); ++ goto base_fw_load_failed; ++ } ++ + /* enable interrupt */ + cnl_ipc_int_enable(ctx); + cnl_ipc_op_int_enable(ctx); +--- a/sound/soc/intel/skylake/skl-sst-dsp.h ++++ b/sound/soc/intel/skylake/skl-sst-dsp.h +@@ -68,6 +68,7 @@ struct skl_dev; + #define SKL_FW_INIT 0x1 + #define SKL_FW_RFW_START 0xf + #define BXT_FW_ROM_INIT_RETRY 3 ++#define BXT_INIT_TIMEOUT 300 + + #define SKL_ADSPIC_IPC 1 + #define SKL_ADSPIS_IPC 1 diff --git a/queue-5.4/asoc-intel-skylake-enable-codec-wakeup-during-chip-init.patch b/queue-5.4/asoc-intel-skylake-enable-codec-wakeup-during-chip-init.patch new file mode 100644 index 00000000000..91d7db4868e --- /dev/null +++ b/queue-5.4/asoc-intel-skylake-enable-codec-wakeup-during-chip-init.patch @@ -0,0 +1,44 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:43 +0100 +Subject: ASoC: Intel: Skylake: Enable codec wakeup during chip init +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Cezary Rojewski +Message-ID: <20201129114148.13772-4-cezary.rojewski@intel.com> + +From: Cezary Rojewski + +commit e603f11d5df8997d104ab405ff27640b90baffaa upstream. + +Follow the recommendation set by hda_intel.c and enable HDMI/DP codec +wakeup during bus initialization procedure. Disable wakeup once init +completes. + +Signed-off-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200305145314.32579-4-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/skl.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -129,6 +129,7 @@ static int skl_init_chip(struct hdac_bus + struct hdac_ext_link *hlink; + int ret; + ++ snd_hdac_set_codec_wakeup(bus, true); + skl_enable_miscbdcge(bus->dev, false); + ret = snd_hdac_bus_init_chip(bus, full_reset); + +@@ -137,6 +138,7 @@ static int skl_init_chip(struct hdac_bus + writel(0, hlink->ml_addr + AZX_REG_ML_LOSIDV); + + skl_enable_miscbdcge(bus->dev, true); ++ snd_hdac_set_codec_wakeup(bus, false); + + return ret; + } diff --git a/queue-5.4/asoc-intel-skylake-remove-superfluous-chip-initialization.patch b/queue-5.4/asoc-intel-skylake-remove-superfluous-chip-initialization.patch new file mode 100644 index 00000000000..014f93233f3 --- /dev/null +++ b/queue-5.4/asoc-intel-skylake-remove-superfluous-chip-initialization.patch @@ -0,0 +1,76 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:41 +0100 +Subject: ASoC: Intel: Skylake: Remove superfluous chip initialization +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Cezary Rojewski +Message-ID: <20201129114148.13772-2-cezary.rojewski@intel.com> + +From: Cezary Rojewski + +commit 2ef81057d80456870b97890dd79c8f56a85b1242 upstream. + +Skylake driver does the controller init operation twice: +- first during probe (only to stop it just before scheduling probe_work) +- and during said probe_work where the actual correct sequence is +executed + +To properly complete boot sequence when iDisp codec is present, bus +initialization has to be called only after _i915_init() finishes. +With additional _reset_list preceding _i915_init(), iDisp codec never +gets the chance to enumerate on the link. Remove the superfluous +initialization to address the issue. + +Signed-off-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200305145314.32579-2-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/skl.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -807,6 +807,9 @@ static void skl_probe_work(struct work_s + return; + } + ++ skl_init_pci(skl); ++ skl_dum_set(bus); ++ + err = skl_init_chip(bus, true); + if (err < 0) { + dev_err(bus->dev, "Init chip failed with err: %d\n", err); +@@ -922,8 +925,6 @@ static int skl_first_init(struct hdac_bu + return -ENXIO; + } + +- snd_hdac_bus_reset_link(bus, true); +- + snd_hdac_bus_parse_capabilities(bus); + + /* check if PPCAP exists */ +@@ -971,11 +972,7 @@ static int skl_first_init(struct hdac_bu + if (err < 0) + return err; + +- /* initialize chip */ +- skl_init_pci(skl); +- skl_dum_set(bus); +- +- return skl_init_chip(bus, true); ++ return 0; + } + + static int skl_probe(struct pci_dev *pci, +@@ -1080,8 +1077,6 @@ static int skl_probe(struct pci_dev *pci + if (bus->mlcap) + snd_hdac_ext_bus_get_ml_capabilities(bus); + +- snd_hdac_bus_stop_chip(bus); +- + /* create device for soc dmic */ + err = skl_dmic_device_register(skl); + if (err < 0) { diff --git a/queue-5.4/asoc-intel-skylake-select-hda-configuration-permissively.patch b/queue-5.4/asoc-intel-skylake-select-hda-configuration-permissively.patch new file mode 100644 index 00000000000..7c4e55ac85f --- /dev/null +++ b/queue-5.4/asoc-intel-skylake-select-hda-configuration-permissively.patch @@ -0,0 +1,44 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:42 +0100 +Subject: ASoC: Intel: Skylake: Select hda configuration permissively +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Cezary Rojewski +Message-ID: <20201129114148.13772-3-cezary.rojewski@intel.com> + +From: Cezary Rojewski + +commit a66f88394a78fec9a05fa6e517e9603e8eca8363 upstream. + +With _reset_link removed from the probe sequence, codec_mask at the time +skl_find_hda_machine() is invoked will always be 0, so hda machine will +never be chosen. Rather than reorganizing boot flow, be permissive about +invalid mask. codec_mask will be set to proper value during probe_work - +before skl_codec_create() ever gets called. + +Signed-off-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200305145314.32579-3-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/skl.c | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -480,13 +480,8 @@ static struct skl_ssp_clk skl_ssp_clks[] + static struct snd_soc_acpi_mach *skl_find_hda_machine(struct skl_dev *skl, + struct snd_soc_acpi_mach *machines) + { +- struct hdac_bus *bus = skl_to_bus(skl); + struct snd_soc_acpi_mach *mach; + +- /* check if we have any codecs detected on bus */ +- if (bus->codec_mask == 0) +- return NULL; +- + /* point to common table */ + mach = snd_soc_acpi_intel_hda_machines; + diff --git a/queue-5.4/asoc-intel-skylake-shield-against-no-nhlt-configurations.patch b/queue-5.4/asoc-intel-skylake-shield-against-no-nhlt-configurations.patch new file mode 100644 index 00000000000..401493467ad --- /dev/null +++ b/queue-5.4/asoc-intel-skylake-shield-against-no-nhlt-configurations.patch @@ -0,0 +1,72 @@ +From foo@baz Tue Dec 1 09:41:56 AM CET 2020 +From: Cezary Rojewski +Date: Sun, 29 Nov 2020 12:41:44 +0100 +Subject: ASoC: Intel: Skylake: Shield against no-NHLT configurations +To: stable@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, mateusz.gorski@linux.intel.com, Cezary Rojewski +Message-ID: <20201129114148.13772-5-cezary.rojewski@intel.com> + +From: Cezary Rojewski + +commit 9e6c382f5a6161eb55115fb56614b9827f2e7da3 upstream. + +Some configurations expose no NHLT table at all within their +/sys/firmware/acpi/tables. To prevent NULL-dereference errors from +occurring, adjust probe flow and append additional safety checks in +functions involved in NHLT lifecycle. + +Signed-off-by: Cezary Rojewski +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200305145314.32579-5-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Cc: # 5.4.x +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/skl-nhlt.c | 3 ++- + sound/soc/intel/skylake/skl.c | 9 +++++++-- + 2 files changed, 9 insertions(+), 3 deletions(-) + +--- a/sound/soc/intel/skylake/skl-nhlt.c ++++ b/sound/soc/intel/skylake/skl-nhlt.c +@@ -182,7 +182,8 @@ void skl_nhlt_remove_sysfs(struct skl_de + { + struct device *dev = &skl->pci->dev; + +- sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr); ++ if (skl->nhlt) ++ sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr); + } + + /* +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -632,6 +632,9 @@ static int skl_clock_device_register(str + struct platform_device_info pdevinfo = {NULL}; + struct skl_clk_pdata *clk_pdata; + ++ if (!skl->nhlt) ++ return 0; ++ + clk_pdata = devm_kzalloc(&skl->pci->dev, sizeof(*clk_pdata), + GFP_KERNEL); + if (!clk_pdata) +@@ -1090,7 +1093,8 @@ out_dsp_free: + out_clk_free: + skl_clock_device_unregister(skl); + out_nhlt_free: +- intel_nhlt_free(skl->nhlt); ++ if (skl->nhlt) ++ intel_nhlt_free(skl->nhlt); + out_free: + skl_free(bus); + +@@ -1139,7 +1143,8 @@ static void skl_remove(struct pci_dev *p + skl_dmic_device_unregister(skl); + skl_clock_device_unregister(skl); + skl_nhlt_remove_sysfs(skl); +- intel_nhlt_free(skl->nhlt); ++ if (skl->nhlt) ++ intel_nhlt_free(skl->nhlt); + skl_free(bus); + dev_set_drvdata(&pci->dev, NULL); + } diff --git a/queue-5.4/series b/queue-5.4/series index 78a87d2d23c..bdf3971b6ad 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -89,3 +89,11 @@ x86-speculation-fix-prctl-when-spectre_v2_user-seccomp-prctl-ibpb.patch x86-resctrl-remove-superfluous-kernfs_get-calls-to-prevent-refcount-leak.patch x86-resctrl-add-necessary-kernfs_put-calls-to-prevent-refcount-leak.patch usb-core-fix-regression-in-hercules-audio-card.patch +asoc-intel-skylake-remove-superfluous-chip-initialization.patch +asoc-intel-skylake-select-hda-configuration-permissively.patch +asoc-intel-skylake-enable-codec-wakeup-during-chip-init.patch +asoc-intel-skylake-shield-against-no-nhlt-configurations.patch +asoc-intel-allow-for-rom-init-retry-on-cnl-platforms.patch +asoc-intel-skylake-await-purge-request-ack-on-cnl.patch +asoc-intel-multiple-i-o-pcm-format-support-for-pipe.patch +asoc-intel-skylake-automatic-dmic-format-configuration-according-to-information-from-nhlt.patch