]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Tue, 27 Dec 2022 02:31:11 +0000 (21:31 -0500)
committerSasha Levin <sashal@kernel.org>
Tue, 27 Dec 2022 02:31:11 +0000 (21:31 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch [new file with mode: 0644]
queue-4.9/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch [new file with mode: 0644]
queue-4.9/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch [new file with mode: 0644]
queue-4.9/asoc-wm8994-fix-potential-deadlock.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch b/queue-4.9/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch
new file mode 100644 (file)
index 0000000..48c80d6
--- /dev/null
@@ -0,0 +1,57 @@
+From 85a0d41dd1a46e48a0bcbaf1b272784e160fe2c7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 5 Dec 2022 18:04:24 +0800
+Subject: ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in
+ mt8173_rt5650_rt5514_dev_probe()
+
+From: Wang Yufen <wangyufen@huawei.com>
+
+[ Upstream commit 3327d721114c109ba0575f86f8fda3b525404054 ]
+
+The node returned by of_parse_phandle() with refcount incremented,
+of_node_put() needs be called when finish using it. So add it in the
+error path in mt8173_rt5650_rt5514_dev_probe().
+
+Fixes: 0d1d7a664288 ("ASoC: mediatek: Refine mt8173 driver and change config option")
+Signed-off-by: Wang Yufen <wangyufen@huawei.com>
+Link: https://lore.kernel.org/r/1670234664-24246-1-git-send-email-wangyufen@huawei.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
+index 52fdd766ee82..8fbc59199d58 100644
+--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
++++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
+@@ -209,14 +209,16 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev)
+       if (!mt8173_rt5650_rt5514_codecs[0].of_node) {
+               dev_err(&pdev->dev,
+                       "Property 'audio-codec' missing or invalid\n");
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto out;
+       }
+       mt8173_rt5650_rt5514_codecs[1].of_node =
+               of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 1);
+       if (!mt8173_rt5650_rt5514_codecs[1].of_node) {
+               dev_err(&pdev->dev,
+                       "Property 'audio-codec' missing or invalid\n");
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto out;
+       }
+       mt8173_rt5650_rt5514_codec_conf[0].of_node =
+               mt8173_rt5650_rt5514_codecs[1].of_node;
+@@ -229,6 +231,7 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev)
+               dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
+                       __func__, ret);
++out:
+       of_node_put(platform_node);
+       return ret;
+ }
+-- 
+2.35.1
+
diff --git a/queue-4.9/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch b/queue-4.9/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch
new file mode 100644 (file)
index 0000000..8a5b036
--- /dev/null
@@ -0,0 +1,37 @@
+From 988d3166ae2ae802355cb8677d70490a959b365f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 8 Dec 2022 14:39:00 +0800
+Subject: ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in
+ rk_spdif_runtime_resume()
+
+From: Wang Jingjin <wangjingjin1@huawei.com>
+
+[ Upstream commit 6d94d0090527b1763872275a7ccd44df7219b31e ]
+
+rk_spdif_runtime_resume() may have called clk_prepare_enable() before return
+from failed branches, add missing clk_disable_unprepare() in this case.
+
+Fixes: f874b80e1571 ("ASoC: rockchip: Add rockchip SPDIF transceiver driver")
+Signed-off-by: Wang Jingjin <wangjingjin1@huawei.com>
+Link: https://lore.kernel.org/r/20221208063900.4180790-1-wangjingjin1@huawei.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/rockchip/rockchip_spdif.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
+index f387d7bae3d4..e4073c48faf6 100644
+--- a/sound/soc/rockchip/rockchip_spdif.c
++++ b/sound/soc/rockchip/rockchip_spdif.c
+@@ -85,6 +85,7 @@ static int __maybe_unused rk_spdif_runtime_resume(struct device *dev)
+       ret = clk_prepare_enable(spdif->hclk);
+       if (ret) {
++              clk_disable_unprepare(spdif->mclk);
+               dev_err(spdif->dev, "hclk clock enable failed %d\n", ret);
+               return ret;
+       }
+-- 
+2.35.1
+
diff --git a/queue-4.9/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch b/queue-4.9/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch
new file mode 100644 (file)
index 0000000..61ccc34
--- /dev/null
@@ -0,0 +1,42 @@
+From 67c9fb4bc089fdc14fa652fc20301273766b9b83 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 13 Dec 2022 13:33:19 +0100
+Subject: ASoC: rt5670: Remove unbalanced pm_runtime_put()
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit 6c900dcc3f7331a67ed29739d74524e428d137fb ]
+
+For some reason rt5670_i2c_probe() does a pm_runtime_put() at the end
+of a successful probe. But it has never done a pm_runtime_get() leading
+to the following error being logged into dmesg:
+
+ rt5670 i2c-10EC5640:00: Runtime PM usage count underflow!
+
+Fix this by removing the unnecessary pm_runtime_put().
+
+Fixes: 64e89e5f5548 ("ASoC: rt5670: Add runtime PM support")
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20221213123319.11285-1-hdegoede@redhat.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/rt5670.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
+index fdc14e50d3b9..13b944bcde71 100644
+--- a/sound/soc/codecs/rt5670.c
++++ b/sound/soc/codecs/rt5670.c
+@@ -3028,8 +3028,6 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
+       if (ret < 0)
+               goto err;
+-      pm_runtime_put(&i2c->dev);
+-
+       return 0;
+ err:
+       pm_runtime_disable(&i2c->dev);
+-- 
+2.35.1
+
diff --git a/queue-4.9/asoc-wm8994-fix-potential-deadlock.patch b/queue-4.9/asoc-wm8994-fix-potential-deadlock.patch
new file mode 100644 (file)
index 0000000..64c73ea
--- /dev/null
@@ -0,0 +1,42 @@
+From ba3b0e7a1692c6844f205581edd1dbccf6d419a5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Dec 2022 10:16:57 +0100
+Subject: ASoC: wm8994: Fix potential deadlock
+
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+
+[ Upstream commit 9529dc167ffcdfd201b9f0eda71015f174095f7e ]
+
+Fix this by dropping wm8994->accdet_lock while calling
+cancel_delayed_work_sync(&wm8994->mic_work) in wm1811_jackdet_irq().
+
+Fixes: c0cc3f166525 ("ASoC: wm8994: Allow a delay between jack insertion and microphone detect")
+Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
+Link: https://lore.kernel.org/r/20221209091657.1183-1-m.szyprowski@samsung.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/wm8994.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
+index f289762cd676..1feeeed4bfb2 100644
+--- a/sound/soc/codecs/wm8994.c
++++ b/sound/soc/codecs/wm8994.c
+@@ -3704,7 +3704,12 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
+       } else {
+               dev_dbg(codec->dev, "Jack not detected\n");
++              /* Release wm8994->accdet_lock to avoid deadlock:
++               * cancel_delayed_work_sync() takes wm8994->mic_work internal
++               * lock and wm1811_mic_work takes wm8994->accdet_lock */
++              mutex_unlock(&wm8994->accdet_lock);
+               cancel_delayed_work_sync(&wm8994->mic_work);
++              mutex_lock(&wm8994->accdet_lock);
+               snd_soc_update_bits(codec, WM8958_MICBIAS2,
+                                   WM8958_MICB2_DISCH, WM8958_MICB2_DISCH);
+-- 
+2.35.1
+
index 72a373618a4bc1de83377f1587dc3a82eb8afdc7..10846de53a93476747ffafbce6c3c8cf01c5d406 100644 (file)
@@ -209,3 +209,7 @@ clk-st-fix-memory-leak-in-st_of_quadfs_setup.patch
 drm-fsl-dcu-fix-return-type-of-fsl_dcu_drm_connector.patch
 drm-sti-fix-return-type-of-sti_-dvo-hda-hdmi-_connec.patch
 orangefs-fix-kmemleak-in-orangefs_prepare_debugfs_he.patch
+asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch
+asoc-wm8994-fix-potential-deadlock.patch
+asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch
+asoc-rt5670-remove-unbalanced-pm_runtime_put.patch