From 4eaa50ff2735d2e8168157c955fafd84f8d1f314 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 1 Dec 2022 13:52:40 +0100 Subject: [PATCH] fix up some asoc deps for 6.0 Allowing us to drop a bunch of patches --- ...da-fix-hda-pcm-buffer-overflow-issue.patch | 9 +- ...hdac_ext-usage-for-codec-device-crea.patch | 321 ------------------ ...used-variable-warning-in-probe_codec.patch | 43 --- ...memory-leak-in-skl_codec_device_init.patch | 52 --- ...ke-introduce-hda-codec-init-and-exit.patch | 68 ---- ...n-hda_audio_codec-config-is-disabled.patch | 33 -- ...memory-leak-in-hda_codec_device_init.patch | 53 --- ...ntroduce-hda-codec-init-and-exit-rou.patch | 69 ---- queue-6.0/series | 7 - 9 files changed, 2 insertions(+), 653 deletions(-) delete mode 100644 queue-6.0/asoc-intel-drop-hdac_ext-usage-for-codec-device-crea.patch delete mode 100644 queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch delete mode 100644 queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch delete mode 100644 queue-6.0/asoc-intel-skylake-introduce-hda-codec-init-and-exit.patch delete mode 100644 queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch delete mode 100644 queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch delete mode 100644 queue-6.0/asoc-sof-intel-introduce-hda-codec-init-and-exit-rou.patch diff --git a/queue-6.0/asoc-hdac_hda-fix-hda-pcm-buffer-overflow-issue.patch b/queue-6.0/asoc-hdac_hda-fix-hda-pcm-buffer-overflow-issue.patch index e9f86bdc2d6..3a064e716fc 100644 --- a/queue-6.0/asoc-hdac_hda-fix-hda-pcm-buffer-overflow-issue.patch +++ b/queue-6.0/asoc-hdac_hda-fix-hda-pcm-buffer-overflow-issue.patch @@ -36,11 +36,9 @@ Link: https://lore.kernel.org/r/20221109234023.3111035-1-junxiao.chang@intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- - sound/soc/codecs/hdac_hda.h | 4 ++-- + sound/soc/codecs/hdac_hda.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/sound/soc/codecs/hdac_hda.h b/sound/soc/codecs/hdac_hda.h -index fc19c34ca00e..b65560981abb 100644 --- a/sound/soc/codecs/hdac_hda.h +++ b/sound/soc/codecs/hdac_hda.h @@ -14,7 +14,7 @@ enum { @@ -55,12 +53,9 @@ index fc19c34ca00e..b65560981abb 100644 @@ -24,7 +24,7 @@ struct hdac_hda_pcm { struct hdac_hda_priv { - struct hda_codec *codec; + struct hda_codec codec; - struct hdac_hda_pcm pcm[HDAC_LAST_DAI_ID]; + struct hdac_hda_pcm pcm[HDAC_DAI_ID_NUM]; bool need_display_power; }; --- -2.35.1 - diff --git a/queue-6.0/asoc-intel-drop-hdac_ext-usage-for-codec-device-crea.patch b/queue-6.0/asoc-intel-drop-hdac_ext-usage-for-codec-device-crea.patch deleted file mode 100644 index 66fcbf57787..00000000000 --- a/queue-6.0/asoc-intel-drop-hdac_ext-usage-for-codec-device-crea.patch +++ /dev/null @@ -1,321 +0,0 @@ -From b7c2a85dca6b25a5954948051360460ee574dc57 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 16 Aug 2022 13:17:24 +0200 -Subject: ASoC: Intel: Drop hdac_ext usage for codec device creation - -From: Cezary Rojewski - -[ Upstream commit 3fd63658caed9494cca1d4789a66d3d2def2a0ab ] - -To make snd_hda_codec_device_init() the only constructor for struct -hda_codec instances remaining tasks are: - -1) no struct may wrap struct hda_codec as its base type -2) bus drivers (skylake and sof) which are the current hdac_ext users - need to be adjusted to make use of newly added codec init and exit - routines instead -3) as bus drivers (skylake and sof) are to be responsible for creating - codec device and assigning it to hdac_hda_priv->codec, - hdac_hda_dev_probe() has to be freed of that job - -To keep git bisect happy, all of these in made in one-go. - -Reviewed-by: Kai Vehmanen -Reviewed-by: Pierre-Louis Bossart -Signed-off-by: Cezary Rojewski -Acked-by: Mark Brown -Link: https://lore.kernel.org/r/20220816111727.3218543-4-cezary.rojewski@intel.com -Signed-off-by: Takashi Iwai -Stable-dep-of: 37882100cd06 ("ASoC: hdac_hda: fix hda pcm buffer overflow issue") -Signed-off-by: Sasha Levin ---- - sound/soc/codecs/hdac_hda.c | 26 +++++++----------- - sound/soc/codecs/hdac_hda.h | 2 +- - sound/soc/intel/boards/hda_dsp_common.c | 2 +- - sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- - sound/soc/intel/skylake/skl.c | 26 ++++++++---------- - sound/soc/sof/intel/hda-codec.c | 29 ++++++++------------ - 6 files changed, 36 insertions(+), 51 deletions(-) - -diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c -index 8debcee59224..77df4c5b274a 100644 ---- a/sound/soc/codecs/hdac_hda.c -+++ b/sound/soc/codecs/hdac_hda.c -@@ -246,7 +246,7 @@ static int hdac_hda_dai_hw_free(struct snd_pcm_substream *substream, - return -EINVAL; - - hda_stream = &pcm->stream[substream->stream]; -- snd_hda_codec_cleanup(&hda_pvt->codec, hda_stream, substream); -+ snd_hda_codec_cleanup(hda_pvt->codec, hda_stream, substream); - - return 0; - } -@@ -264,7 +264,7 @@ static int hdac_hda_dai_prepare(struct snd_pcm_substream *substream, - int ret = 0; - - hda_pvt = snd_soc_component_get_drvdata(component); -- hdev = &hda_pvt->codec.core; -+ hdev = &hda_pvt->codec->core; - pcm = snd_soc_find_pcm_from_dai(hda_pvt, dai); - if (!pcm) - return -EINVAL; -@@ -274,7 +274,7 @@ static int hdac_hda_dai_prepare(struct snd_pcm_substream *substream, - stream = hda_pvt->pcm[dai->id].stream_tag[substream->stream]; - format_val = hda_pvt->pcm[dai->id].format_val[substream->stream]; - -- ret = snd_hda_codec_prepare(&hda_pvt->codec, hda_stream, -+ ret = snd_hda_codec_prepare(hda_pvt->codec, hda_stream, - stream, format_val, substream); - if (ret < 0) - dev_err(&hdev->dev, "codec prepare failed %d\n", ret); -@@ -299,7 +299,7 @@ static int hdac_hda_dai_open(struct snd_pcm_substream *substream, - - hda_stream = &pcm->stream[substream->stream]; - -- return hda_stream->ops.open(hda_stream, &hda_pvt->codec, substream); -+ return hda_stream->ops.open(hda_stream, hda_pvt->codec, substream); - } - - static void hdac_hda_dai_close(struct snd_pcm_substream *substream, -@@ -317,7 +317,7 @@ static void hdac_hda_dai_close(struct snd_pcm_substream *substream, - - hda_stream = &pcm->stream[substream->stream]; - -- hda_stream->ops.close(hda_stream, &hda_pvt->codec, substream); -+ hda_stream->ops.close(hda_stream, hda_pvt->codec, substream); - - snd_hda_codec_pcm_put(pcm); - } -@@ -325,7 +325,7 @@ static void hdac_hda_dai_close(struct snd_pcm_substream *substream, - static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt, - struct snd_soc_dai *dai) - { -- struct hda_codec *hcodec = &hda_pvt->codec; -+ struct hda_codec *hcodec = hda_pvt->codec; - struct hda_pcm *cpcm; - const char *pcm_name; - -@@ -394,8 +394,8 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component) - snd_soc_component_get_drvdata(component); - struct snd_soc_dapm_context *dapm = - snd_soc_component_get_dapm(component); -- struct hdac_device *hdev = &hda_pvt->codec.core; -- struct hda_codec *hcodec = &hda_pvt->codec; -+ struct hdac_device *hdev = &hda_pvt->codec->core; -+ struct hda_codec *hcodec = hda_pvt->codec; - struct hdac_ext_link *hlink; - hda_codec_patch_t patch; - int ret; -@@ -515,8 +515,8 @@ static void hdac_hda_codec_remove(struct snd_soc_component *component) - { - struct hdac_hda_priv *hda_pvt = - snd_soc_component_get_drvdata(component); -- struct hdac_device *hdev = &hda_pvt->codec.core; -- struct hda_codec *codec = &hda_pvt->codec; -+ struct hdac_device *hdev = &hda_pvt->codec->core; -+ struct hda_codec *codec = hda_pvt->codec; - struct hdac_ext_link *hlink = NULL; - - hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev)); -@@ -584,7 +584,6 @@ static const struct snd_soc_component_driver hdac_hda_codec = { - static int hdac_hda_dev_probe(struct hdac_device *hdev) - { - struct hdac_ext_link *hlink; -- struct hdac_hda_priv *hda_pvt; - int ret; - - /* hold the ref while we probe */ -@@ -595,10 +594,6 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev) - } - snd_hdac_ext_bus_link_get(hdev->bus, hlink); - -- hda_pvt = hdac_to_hda_priv(hdev); -- if (!hda_pvt) -- return -ENOMEM; -- - /* ASoC specific initialization */ - ret = devm_snd_soc_register_component(&hdev->dev, - &hdac_hda_codec, hdac_hda_dais, -@@ -608,7 +603,6 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev) - return ret; - } - -- dev_set_drvdata(&hdev->dev, hda_pvt); - snd_hdac_ext_bus_link_put(hdev->bus, hlink); - - return ret; -diff --git a/sound/soc/codecs/hdac_hda.h b/sound/soc/codecs/hdac_hda.h -index d0efc5e254ae..fc19c34ca00e 100644 ---- a/sound/soc/codecs/hdac_hda.h -+++ b/sound/soc/codecs/hdac_hda.h -@@ -23,7 +23,7 @@ struct hdac_hda_pcm { - }; - - struct hdac_hda_priv { -- struct hda_codec codec; -+ struct hda_codec *codec; - struct hdac_hda_pcm pcm[HDAC_LAST_DAI_ID]; - bool need_display_power; - }; -diff --git a/sound/soc/intel/boards/hda_dsp_common.c b/sound/soc/intel/boards/hda_dsp_common.c -index 83c7dfbccd9d..04b7d4f7f9e2 100644 ---- a/sound/soc/intel/boards/hda_dsp_common.c -+++ b/sound/soc/intel/boards/hda_dsp_common.c -@@ -54,7 +54,7 @@ int hda_dsp_hdmi_build_controls(struct snd_soc_card *card, - return -EINVAL; - - hda_pvt = snd_soc_component_get_drvdata(comp); -- hcodec = &hda_pvt->codec; -+ hcodec = hda_pvt->codec; - - list_for_each_entry(hpcm, &hcodec->pcm_list_head, list) { - spcm = hda_dsp_hdmi_pcm_handle(card, i); -diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c -index 81144efb4b44..879ebba52832 100644 ---- a/sound/soc/intel/boards/skl_hda_dsp_generic.c -+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c -@@ -190,7 +190,7 @@ static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card) - * all codecs are on the same bus, so it's sufficient - * to look up only the first one - */ -- snd_hda_set_power_save(hda_pvt->codec.bus, -+ snd_hda_set_power_save(hda_pvt->codec->bus, - HDA_CODEC_AUTOSUSPEND_DELAY_MS); - break; - } -diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c -index 33b0ed6b0534..c7c1cad2a753 100644 ---- a/sound/soc/intel/skylake/skl.c -+++ b/sound/soc/intel/skylake/skl.c -@@ -694,7 +694,7 @@ static void skl_codec_device_exit(struct device *dev) - snd_hdac_device_exit(dev_to_hdac_dev(dev)); - } - --static __maybe_unused struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr) -+static struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr) - { - struct hda_codec *codec; - int ret; -@@ -729,9 +729,8 @@ static int probe_codec(struct hdac_bus *bus, int addr) - struct skl_dev *skl = bus_to_skl(bus); - #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) - struct hdac_hda_priv *hda_codec; -- int err; - #endif -- struct hdac_device *hdev; -+ struct hda_codec *codec; - - mutex_lock(&bus->cmd_mutex); - snd_hdac_bus_send_cmd(bus, cmd); -@@ -747,25 +746,22 @@ static int probe_codec(struct hdac_bus *bus, int addr) - if (!hda_codec) - return -ENOMEM; - -- hda_codec->codec.bus = skl_to_hbus(skl); -- hdev = &hda_codec->codec.core; -+ codec = skl_codec_device_init(bus, addr); -+ if (IS_ERR(codec)) -+ return PTR_ERR(codec); - -- err = snd_hdac_ext_bus_device_init(bus, addr, hdev, HDA_DEV_ASOC); -- if (err < 0) -- return err; -+ hda_codec->codec = codec; -+ dev_set_drvdata(&codec->core.dev, hda_codec); - - /* use legacy bus only for HDA codecs, idisp uses ext bus */ - if ((res & 0xFFFF0000) != IDISP_INTEL_VENDOR_ID) { -- hdev->type = HDA_DEV_LEGACY; -- load_codec_module(&hda_codec->codec); -+ codec->core.type = HDA_DEV_LEGACY; -+ load_codec_module(hda_codec->codec); - } - return 0; - #else -- hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL); -- if (!hdev) -- return -ENOMEM; -- -- return snd_hdac_ext_bus_device_init(bus, addr, hdev, HDA_DEV_ASOC); -+ codec = skl_codec_device_init(bus, addr); -+ return PTR_ERR_OR_ZERO(codec); - #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ - } - -diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c -index 4c128ba02340..73336648cd25 100644 ---- a/sound/soc/sof/intel/hda-codec.c -+++ b/sound/soc/sof/intel/hda-codec.c -@@ -114,8 +114,7 @@ static void hda_codec_device_exit(struct device *dev) - snd_hdac_device_exit(dev_to_hdac_dev(dev)); - } - --static __maybe_unused struct hda_codec * --hda_codec_device_init(struct hdac_bus *bus, int addr, int type) -+static struct hda_codec *hda_codec_device_init(struct hdac_bus *bus, int addr, int type) - { - struct hda_codec *codec; - int ret; -@@ -145,11 +144,10 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, - { - #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) - struct hdac_hda_priv *hda_priv; -- struct hda_codec *codec; - int type = HDA_DEV_LEGACY; - #endif - struct hda_bus *hbus = sof_to_hbus(sdev); -- struct hdac_device *hdev; -+ struct hda_codec *codec; - u32 hda_cmd = (address << 28) | (AC_NODE_ROOT << 20) | - (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; - u32 resp = -1; -@@ -172,20 +170,20 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, - if (!hda_priv) - return -ENOMEM; - -- hda_priv->codec.bus = hbus; -- hdev = &hda_priv->codec.core; -- codec = &hda_priv->codec; -- - /* only probe ASoC codec drivers for HDAC-HDMI */ - if (!hda_codec_use_common_hdmi && (resp & 0xFFFF0000) == IDISP_VID_INTEL) - type = HDA_DEV_ASOC; - -- ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev, type); -+ codec = hda_codec_device_init(&hbus->core, address, type); -+ ret = PTR_ERR_OR_ZERO(codec); - if (ret < 0) - return ret; - -+ hda_priv->codec = codec; -+ dev_set_drvdata(&codec->core.dev, hda_priv); -+ - if ((resp & 0xFFFF0000) == IDISP_VID_INTEL) { -- if (!hdev->bus->audio_component) { -+ if (!hbus->core.audio_component) { - dev_dbg(sdev->dev, - "iDisp hw present but no driver\n"); - ret = -ENOENT; -@@ -211,15 +209,12 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, - - out: - if (ret < 0) { -- snd_hdac_device_unregister(hdev); -- put_device(&hdev->dev); -+ snd_hdac_device_unregister(&codec->core); -+ put_device(&codec->core.dev); - } - #else -- hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); -- if (!hdev) -- return -ENOMEM; -- -- ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev, HDA_DEV_ASOC); -+ codec = hda_codec_device_init(&hbus->core, address); -+ ret = PTR_ERR_OR_ZERO(codec); - #endif - - return ret; --- -2.35.1 - diff --git a/queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch b/queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch deleted file mode 100644 index 1a50b5968d6..00000000000 --- a/queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 515626a33a194c4caaf2879dbf9e00e882582af0 Mon Sep 17 00:00:00 2001 -From: Gaosheng Cui -Date: Mon, 22 Aug 2022 11:51:33 +0800 -Subject: ASoC: Intel: fix unused-variable warning in probe_codec -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Gaosheng Cui - -commit 515626a33a194c4caaf2879dbf9e00e882582af0 upstream. - -In configurations with CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=n, -gcc warns about an unused variable: - -sound/soc/intel/skylake/skl.c: In function ‘probe_codec’: -sound/soc/intel/skylake/skl.c:729:18: error: unused variable ‘skl’ [-Werror=unused-variable] - struct skl_dev *skl = bus_to_skl(bus); - ^~~ -cc1: all warnings being treated as errors - -Fixes: 3fd63658caed9 ("ASoC: Intel: Drop hdac_ext usage for codec device creation") -Signed-off-by: Gaosheng Cui -Acked-by: Cezary Rojewski -Link: https://lore.kernel.org/r/20220822035133.2147381-1-cuigaosheng1@huawei.com -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman ---- - sound/soc/intel/skylake/skl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/sound/soc/intel/skylake/skl.c -+++ b/sound/soc/intel/skylake/skl.c -@@ -726,8 +726,8 @@ static int probe_codec(struct hdac_bus * - unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) | - (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; - unsigned int res = -1; -- struct skl_dev *skl = bus_to_skl(bus); - #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) -+ struct skl_dev *skl = bus_to_skl(bus); - struct hdac_hda_priv *hda_codec; - #endif - struct hda_codec *codec; diff --git a/queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch b/queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch deleted file mode 100644 index a1e8a5ec6d7..00000000000 --- a/queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0e213813df02da048ffd22a2c4fac041768ca327 Mon Sep 17 00:00:00 2001 -From: Yang Yingliang -Date: Thu, 20 Oct 2022 18:59:37 +0800 -Subject: ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init() - -From: Yang Yingliang - -commit 0e213813df02da048ffd22a2c4fac041768ca327 upstream. - -If snd_hdac_device_register() fails, 'codec' and name allocated in -dev_set_name() called in snd_hdac_device_init() are leaked. Fix this -by calling put_device(), so they can be freed in snd_hda_codec_dev_release() -and kobject_cleanup(). - -Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines") -Signed-off-by: Yang Yingliang -Suggested-by: Cezary Rojewski -Link: https://lore.kernel.org/r/20221020105937.1448951-1-yangyingliang@huawei.com -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman ---- - sound/soc/intel/skylake/skl.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - ---- a/sound/soc/intel/skylake/skl.c -+++ b/sound/soc/intel/skylake/skl.c -@@ -689,11 +689,6 @@ static void load_codec_module(struct hda - - #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ - --static void skl_codec_device_exit(struct device *dev) --{ -- snd_hdac_device_exit(dev_to_hdac_dev(dev)); --} -- - static struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr) - { - struct hda_codec *codec; -@@ -706,12 +701,11 @@ static struct hda_codec *skl_codec_devic - } - - codec->core.type = HDA_DEV_ASOC; -- codec->core.dev.release = skl_codec_device_exit; - - ret = snd_hdac_device_register(&codec->core); - if (ret) { - dev_err(bus->dev, "failed to register hdac device\n"); -- snd_hdac_device_exit(&codec->core); -+ put_device(&codec->core.dev); - return ERR_PTR(ret); - } - diff --git a/queue-6.0/asoc-intel-skylake-introduce-hda-codec-init-and-exit.patch b/queue-6.0/asoc-intel-skylake-introduce-hda-codec-init-and-exit.patch deleted file mode 100644 index 2637d0d12fc..00000000000 --- a/queue-6.0/asoc-intel-skylake-introduce-hda-codec-init-and-exit.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 3a30bcd213a5b161da01e6d88754a588dad63559 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 16 Aug 2022 13:17:22 +0200 -Subject: ASoC: Intel: Skylake: Introduce HDA codec init and exit routines - -From: Cezary Rojewski - -[ Upstream commit e4746d94d00c52918461bc169e009b6784a38e21 ] - -Preliminary step in making snd_hda_codec_device_init() the only -constructor for struct hda_codec instances. To do that, existing usage -of hdac_ext equivalents has to be dropped. - -Reviewed-by: Kai Vehmanen -Reviewed-by: Pierre-Louis Bossart -Signed-off-by: Cezary Rojewski -Acked-by: Mark Brown -Link: https://lore.kernel.org/r/20220816111727.3218543-2-cezary.rojewski@intel.com -Signed-off-by: Takashi Iwai -Stable-dep-of: 37882100cd06 ("ASoC: hdac_hda: fix hda pcm buffer overflow issue") -Signed-off-by: Sasha Levin ---- - sound/soc/intel/skylake/skl.c | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c -index aeca58246fc7..33b0ed6b0534 100644 ---- a/sound/soc/intel/skylake/skl.c -+++ b/sound/soc/intel/skylake/skl.c -@@ -689,6 +689,35 @@ static void load_codec_module(struct hda_codec *codec) - - #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ - -+static void skl_codec_device_exit(struct device *dev) -+{ -+ snd_hdac_device_exit(dev_to_hdac_dev(dev)); -+} -+ -+static __maybe_unused struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr) -+{ -+ struct hda_codec *codec; -+ int ret; -+ -+ codec = snd_hda_codec_device_init(to_hda_bus(bus), addr, "ehdaudio%dD%d", bus->idx, addr); -+ if (IS_ERR(codec)) { -+ dev_err(bus->dev, "device init failed for hdac device\n"); -+ return codec; -+ } -+ -+ codec->core.type = HDA_DEV_ASOC; -+ codec->core.dev.release = skl_codec_device_exit; -+ -+ ret = snd_hdac_device_register(&codec->core); -+ if (ret) { -+ dev_err(bus->dev, "failed to register hdac device\n"); -+ snd_hdac_device_exit(&codec->core); -+ return ERR_PTR(ret); -+ } -+ -+ return codec; -+} -+ - /* - * Probe the given codec address - */ --- -2.35.1 - diff --git a/queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch b/queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch deleted file mode 100644 index 5e654892761..00000000000 --- a/queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1cda83e42bf66beb06bf61c7a78951ec0c028898 Mon Sep 17 00:00:00 2001 -From: Cezary Rojewski -Date: Fri, 19 Aug 2022 14:47:40 +0200 -Subject: ASoC: SOF: Fix compilation when HDA_AUDIO_CODEC config is disabled - -From: Cezary Rojewski - -commit 1cda83e42bf66beb06bf61c7a78951ec0c028898 upstream. - -hda_codec_device_init() expects three parameters, not two. - -Fixes: 3fd63658caed ("ASoC: Intel: Drop hdac_ext usage for codec device creation") -Reported-by: kernel test robot -Signed-off-by: Cezary Rojewski -Acked-by: Mark Brown -Link: https://lore.kernel.org/r/20220819124740.3564862-1-cezary.rojewski@intel.com -Signed-off-by: Takashi Iwai -Signed-off-by: Greg Kroah-Hartman ---- - sound/soc/sof/intel/hda-codec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/sound/soc/sof/intel/hda-codec.c -+++ b/sound/soc/sof/intel/hda-codec.c -@@ -213,7 +213,7 @@ out: - put_device(&codec->core.dev); - } - #else -- codec = hda_codec_device_init(&hbus->core, address); -+ codec = hda_codec_device_init(&hbus->core, address, HDA_DEV_ASOC); - ret = PTR_ERR_OR_ZERO(codec); - #endif - diff --git a/queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch b/queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch deleted file mode 100644 index 8acf4b5c910..00000000000 --- a/queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch +++ /dev/null @@ -1,53 +0,0 @@ -From e9441675edc1bb8dbfadacf68aafacca60d65a25 Mon Sep 17 00:00:00 2001 -From: Yang Yingliang -Date: Thu, 20 Oct 2022 19:01:57 +0800 -Subject: ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init() - -From: Yang Yingliang - -commit e9441675edc1bb8dbfadacf68aafacca60d65a25 upstream. - -If snd_hdac_device_register() fails, 'codec' and name allocated in -dev_set_name() called in snd_hdac_device_init() are leaked. Fix this -by calling put_device(), so they can be freed in snd_hda_codec_dev_release() -and kobject_cleanup(). - -Fixes: 829c67319806 ("ASoC: SOF: Intel: Introduce HDA codec init and exit routines") -Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus") -Signed-off-by: Yang Yingliang -Reviewed-by: Kai Vehmanen -Link: https://lore.kernel.org/r/20221020110157.1450191-1-yangyingliang@huawei.com -Signed-off-by: Mark Brown -Signed-off-by: Greg Kroah-Hartman ---- - sound/soc/sof/intel/hda-codec.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - ---- a/sound/soc/sof/intel/hda-codec.c -+++ b/sound/soc/sof/intel/hda-codec.c -@@ -109,11 +109,6 @@ EXPORT_SYMBOL_NS(hda_codec_jack_check, S - #define is_generic_config(x) 0 - #endif - --static void hda_codec_device_exit(struct device *dev) --{ -- snd_hdac_device_exit(dev_to_hdac_dev(dev)); --} -- - static struct hda_codec *hda_codec_device_init(struct hdac_bus *bus, int addr, int type) - { - struct hda_codec *codec; -@@ -126,12 +121,11 @@ static struct hda_codec *hda_codec_devic - } - - codec->core.type = type; -- codec->core.dev.release = hda_codec_device_exit; - - ret = snd_hdac_device_register(&codec->core); - if (ret) { - dev_err(bus->dev, "failed to register hdac device\n"); -- snd_hdac_device_exit(&codec->core); -+ put_device(&codec->core.dev); - return ERR_PTR(ret); - } - diff --git a/queue-6.0/asoc-sof-intel-introduce-hda-codec-init-and-exit-rou.patch b/queue-6.0/asoc-sof-intel-introduce-hda-codec-init-and-exit-rou.patch deleted file mode 100644 index bd0345b1c32..00000000000 --- a/queue-6.0/asoc-sof-intel-introduce-hda-codec-init-and-exit-rou.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 5f08ca2c986acd9e22d559f75b1ece19449470f1 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 16 Aug 2022 13:17:23 +0200 -Subject: ASoC: SOF: Intel: Introduce HDA codec init and exit routines - -From: Cezary Rojewski - -[ Upstream commit 829c67319806009abfe3b0b82b3b8b153a2c5e32 ] - -Preliminary step in making snd_hda_codec_device_init() the only -constructor for struct hda_codec instances. To do that, existing usage -of hdac_ext equivalents has to be dropped. - -Reviewed-by: Kai Vehmanen -Reviewed-by: Pierre-Louis Bossart -Signed-off-by: Cezary Rojewski -Acked-by: Mark Brown -Link: https://lore.kernel.org/r/20220816111727.3218543-3-cezary.rojewski@intel.com -Signed-off-by: Takashi Iwai -Stable-dep-of: 37882100cd06 ("ASoC: hdac_hda: fix hda pcm buffer overflow issue") -Signed-off-by: Sasha Levin ---- - sound/soc/sof/intel/hda-codec.c | 30 ++++++++++++++++++++++++++++++ - 1 file changed, 30 insertions(+) - -diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c -index 2f3f4a733d9e..4c128ba02340 100644 ---- a/sound/soc/sof/intel/hda-codec.c -+++ b/sound/soc/sof/intel/hda-codec.c -@@ -109,6 +109,36 @@ EXPORT_SYMBOL_NS(hda_codec_jack_check, SND_SOC_SOF_HDA_AUDIO_CODEC); - #define is_generic_config(x) 0 - #endif - -+static void hda_codec_device_exit(struct device *dev) -+{ -+ snd_hdac_device_exit(dev_to_hdac_dev(dev)); -+} -+ -+static __maybe_unused struct hda_codec * -+hda_codec_device_init(struct hdac_bus *bus, int addr, int type) -+{ -+ struct hda_codec *codec; -+ int ret; -+ -+ codec = snd_hda_codec_device_init(to_hda_bus(bus), addr, "ehdaudio%dD%d", bus->idx, addr); -+ if (IS_ERR(codec)) { -+ dev_err(bus->dev, "device init failed for hdac device\n"); -+ return codec; -+ } -+ -+ codec->core.type = type; -+ codec->core.dev.release = hda_codec_device_exit; -+ -+ ret = snd_hdac_device_register(&codec->core); -+ if (ret) { -+ dev_err(bus->dev, "failed to register hdac device\n"); -+ snd_hdac_device_exit(&codec->core); -+ return ERR_PTR(ret); -+ } -+ -+ return codec; -+} -+ - /* probe individual codec */ - static int hda_codec_probe(struct snd_sof_dev *sdev, int address, - bool hda_codec_use_common_hdmi) --- -2.35.1 - diff --git a/queue-6.0/series b/queue-6.0/series index fbac39db1b2..455f1802948 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -48,9 +48,6 @@ af_key-fix-send_acquire-race-with-pfkey_register.patch power-supply-ip5xxx-fix-integer-overflow-in-current_.patch power-supply-ab8500-defer-thermal-zone-probe.patch arm-dts-am335x-pcm-953-define-fixed-regulators-in-ro.patch -asoc-intel-skylake-introduce-hda-codec-init-and-exit.patch -asoc-sof-intel-introduce-hda-codec-init-and-exit-rou.patch -asoc-intel-drop-hdac_ext-usage-for-codec-device-crea.patch asoc-hdac_hda-fix-hda-pcm-buffer-overflow-issue.patch asoc-sgtl5000-reset-the-chip_clk_ctrl-reg-on-remove.patch asoc-soc-pcm-don-t-zero-tdm-masks-in-__soc_pcm_open.patch @@ -216,10 +213,6 @@ mm-fix-unexpected-changes-to-failslab-fail_page_alloc-.attr.patch mm-correctly-charge-compressed-memory-to-its-memcg.patch loongarch-clear-fpu-simd-thread-info-flags-for-kernel-thread.patch loongarch-set-_page_dirty-only-if-_page_write-is-set-in-pmd-pte-_mkdirty.patch -asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch -asoc-intel-fix-unused-variable-warning-in-probe_codec.patch -asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch -asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch input-synaptics-switch-touchpad-on-hp-laptop-15-da30.patch asoc-amd-yc-add-alienware-m17-r5-amd-into-dmi-table.patch asoc-intel-bytcht_es8316-add-quirk-for-the-nanote-um.patch -- 2.47.3