From: Greg Kroah-Hartman Date: Sun, 6 Feb 2022 12:15:26 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.9.300~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13a1555e4713e4e6296c8c6448d66d6b5ec3cc86;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: revert-asoc-mediatek-check-for-error-clk-pointer.patch --- diff --git a/queue-4.19/revert-asoc-mediatek-check-for-error-clk-pointer.patch b/queue-4.19/revert-asoc-mediatek-check-for-error-clk-pointer.patch new file mode 100644 index 00000000000..08ba7347a97 --- /dev/null +++ b/queue-4.19/revert-asoc-mediatek-check-for-error-clk-pointer.patch @@ -0,0 +1,95 @@ +From bb592580baa372ee5ab7cb40ad3879b3051880d2 Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Fri, 4 Feb 2022 17:47:55 -0800 +Subject: Revert "ASoC: mediatek: Check for error clk pointer" + +From: Guenter Roeck + +This reverts commit e4f5f2767cd2c14fcb7b2c16dac5fe21888de9c2 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 +Cc: Mark Brown +Cc: James Liao +Cc: Kevin Hilman +Cc: Matthias Brugger +Cc: Daniel Golle +Link: https://lore.kernel.org/lkml/20220205014755.699603-1-linux@roeck-us.net/ +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -341,17 +341,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, +@@ -361,7 +356,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]; + +@@ -416,9 +411,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]; diff --git a/queue-4.19/series b/queue-4.19/series index f8446e4f87d..582de119622 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -60,3 +60,4 @@ alsa-hda-realtek-fix-silent-output-on-gigabyte-x570s-aorus-master-newer-chipset. alsa-hda-realtek-fix-silent-output-on-gigabyte-x570-aorus-xtreme-after-reboot-from-windows.patch drm-nouveau-fix-off-by-one-in-bios-boundary-checking.patch block-bio-integrity-advance-seed-correctly-for-larger-interval-sizes.patch +revert-asoc-mediatek-check-for-error-clk-pointer.patch