linux-stable/drivers/soc
Guenter Roeck 946eb87114
ASoC: Revert "ASoC: mediatek: Check for error clk pointer"
This reverts commit 9de2b9286a ("ASoC: mediatek: Check for error clk
pointer").

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 9de2b9286a ("ASoC:
mediatek: Check for error clk pointer") needs to be reverted.

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>
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Reported-by: Daniel Golle <daniel@makrotopia.org>
Fixes: 9de2b9286a ("ASoC: mediatek: Check for error clk pointer")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220207160923.3911501-1-linux@roeck-us.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-08 13:37:39 +00:00
..
actions
amlogic soc: amlogic: meson-clk-measure: Make use of the helper function devm_platform_ioremap_resource() 2021-09-13 09:43:00 +02:00
aspeed soc: aspeed: Add UART routing support 2021-10-22 17:32:09 +02:00
atmel
bcm soc: bcm: brcmstb: biuctrl: Tune MCP settings for 72116 2021-09-16 15:31:14 -07:00
canaan drivers: bus: Delete CONFIG_SIMPLE_PM_BUS 2021-10-05 17:47:22 +02:00
dove
fsl ARM: SoC fixes for v5.16 2021-11-10 11:25:37 -08:00
gemini
imx soc: imx: imx8m-blk-ctrl: off by one in imx8m_blk_ctrl_xlate() 2021-10-15 11:10:05 +08:00
ixp4xx soc: ixp4xx/qmgr: fix invalid __iomem access 2021-08-03 10:16:34 +02:00
lantiq
litex
mediatek ASoC: Revert "ASoC: mediatek: Check for error clk pointer" 2022-02-08 13:37:39 +00:00
qcom ARM: SoC drivers for 5.16 2021-11-03 17:00:52 -07:00
renesas soc: renesas: Identify more R-Car Gen3e SoCs 2021-09-13 10:56:29 +02:00
rockchip soc: rockchip: io-domain: Remove unneeded semicolon 2021-08-19 23:56:38 +02:00
samsung soc: samsung: exynos-chipid: add exynosautov9 SoC support 2021-10-26 09:16:53 +02:00
sifive
sunxi soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource() 2021-09-13 09:04:05 +02:00
tegra soc/tegra: pmc: Use devm_platform_ioremap_resource() 2021-10-08 21:42:41 +02:00
ti Merge branch 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2021-11-10 16:15:54 -08:00
ux500
versatile
xilinx
Kconfig
Makefile ARM: ixp4xx: fix compile-testing soc drivers 2021-08-02 14:31:15 +02:00