]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.16-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Feb 2022 12:16:34 +0000 (13:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Feb 2022 12:16:34 +0000 (13:16 +0100)
added patches:
revert-asoc-mediatek-check-for-error-clk-pointer.patch

queue-5.16/revert-asoc-mediatek-check-for-error-clk-pointer.patch [new file with mode: 0644]
queue-5.16/series

diff --git a/queue-5.16/revert-asoc-mediatek-check-for-error-clk-pointer.patch b/queue-5.16/revert-asoc-mediatek-check-for-error-clk-pointer.patch
new file mode 100644 (file)
index 0000000..40fd88c
--- /dev/null
@@ -0,0 +1,95 @@
+From bb592580baa372ee5ab7cb40ad3879b3051880d2 Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Fri, 4 Feb 2022 17:47:55 -0800
+Subject: [PATCH] Revert "ASoC: mediatek: Check for error clk pointer"
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+This reverts commit e0bf3c9e05ca6837ac756ec7d9de70b44603da12 which is
+commit 9de2b9286a6dd16966959b3cb34fc2ddfd39213e upstream
+
+With this patch in the tree, Chromebooks running the affected hardware
+no longer boot. Bisect points to this patch, and reverting it fixes
+the problem.
+
+An analysis of the code with this patch applied shows:
+
+        ret = init_clks(pdev, clk);
+        if (ret)
+                return ERR_PTR(ret);
+...
+                for (j = 0; j < MAX_CLKS && data->clk_id[j]; j++) {
+                        struct clk *c = clk[data->clk_id[j]];
+
+                        if (IS_ERR(c)) {
+                                dev_err(&pdev->dev, "%s: clk unavailable\n",
+                                        data->name);
+                                return ERR_CAST(c);
+                        }
+
+                        scpd->clk[j] = c;
+                }
+
+Not all clocks in the clk_names array have to be present. Only the clocks
+in the data->clk_id array are actually needed. The code already checks if
+the required clocks are available and bails out if not. The assumption that
+all clocks have to be present is wrong, and commit 9de2b9286a6d needs to be
+reverted.
+
+Fixes: 9de2b9286a6d ("ASoC: mediatek: Check for error clk pointer")
+Cc: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+Cc: Mark Brown <broonie@kernel.org>
+Cc: James Liao <jamesjj.liao@mediatek.com>
+Cc: Kevin Hilman <khilman@baylibre.com>
+Cc: Matthias Brugger <matthias.bgg@gmail.com
+Cc: Frank Wunderlich <frank-w@public-files.de>
+Cc: Daniel Golle <daniel@makrotopia.org>
+Link: https://lore.kernel.org/lkml/20220205014755.699603-1-linux@roeck-us.net/
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/soc/mediatek/mtk-scpsys.c |   15 ++++-----------
+ 1 file changed, 4 insertions(+), 11 deletions(-)
+
+--- a/drivers/soc/mediatek/mtk-scpsys.c
++++ b/drivers/soc/mediatek/mtk-scpsys.c
+@@ -411,17 +411,12 @@ out:
+       return ret;
+ }
+-static int init_clks(struct platform_device *pdev, struct clk **clk)
++static void init_clks(struct platform_device *pdev, struct clk **clk)
+ {
+       int i;
+-      for (i = CLK_NONE + 1; i < CLK_MAX; i++) {
++      for (i = CLK_NONE + 1; i < CLK_MAX; i++)
+               clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
+-              if (IS_ERR(clk[i]))
+-                      return PTR_ERR(clk[i]);
+-      }
+-
+-      return 0;
+ }
+ static struct scp *init_scp(struct platform_device *pdev,
+@@ -431,7 +426,7 @@ static struct scp *init_scp(struct platf
+ {
+       struct genpd_onecell_data *pd_data;
+       struct resource *res;
+-      int i, j, ret;
++      int i, j;
+       struct scp *scp;
+       struct clk *clk[CLK_MAX];
+@@ -486,9 +481,7 @@ static struct scp *init_scp(struct platf
+       pd_data->num_domains = num;
+-      ret = init_clks(pdev, clk);
+-      if (ret)
+-              return ERR_PTR(ret);
++      init_clks(pdev, clk);
+       for (i = 0; i < num; i++) {
+               struct scp_domain *scpd = &scp->domains[i];
index 54620359d414cf9267573a51f7f12fc3bbe9d449..1088c3fa909cd310a8ae3ccaa1e2cc7bd4d1db93 100644 (file)
@@ -40,3 +40,4 @@ revert-fbdev-garbage-collect-fbdev-scrolling-acceleration-part-1-from-todo-list.
 revert-fbcon-disable-accelerated-scrolling.patch
 fbcon-add-option-to-enable-legacy-hardware-acceleration.patch
 mptcp-fix-msk-traversal-in-mptcp_nl_cmd_set_flags.patch
+revert-asoc-mediatek-check-for-error-clk-pointer.patch