Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx6: initialize GPU clocks

Initialize the GPU clock muxes to sane inputs. Until now they have
not been changed from their default values, which means that both
GPU3D shader and GPU2D core were fed by clock inputs whose rates
exceed the maximium allowed frequency of the cores by as much as
200MHz.

This fixes a severe GPU stability issue on i.MX6DL.

Cc: stable@vger.kernel.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Lucas Stach and committed by
Stephen Boyd
d8846023 b1d51b44

+18
+18
drivers/clk/imx/clk-imx6q.c
··· 633 633 if (IS_ENABLED(CONFIG_PCI_IMX6)) 634 634 clk_set_parent(clk[IMX6QDL_CLK_LVDS1_SEL], clk[IMX6QDL_CLK_SATA_REF_100M]); 635 635 636 + /* 637 + * Initialize the GPU clock muxes, so that the maximum specified clock 638 + * rates for the respective SoC are not exceeded. 639 + */ 640 + if (clk_on_imx6dl()) { 641 + clk_set_parent(clk[IMX6QDL_CLK_GPU3D_CORE_SEL], 642 + clk[IMX6QDL_CLK_PLL2_PFD1_594M]); 643 + clk_set_parent(clk[IMX6QDL_CLK_GPU2D_CORE_SEL], 644 + clk[IMX6QDL_CLK_PLL2_PFD1_594M]); 645 + } else if (clk_on_imx6q()) { 646 + clk_set_parent(clk[IMX6QDL_CLK_GPU3D_CORE_SEL], 647 + clk[IMX6QDL_CLK_MMDC_CH0_AXI]); 648 + clk_set_parent(clk[IMX6QDL_CLK_GPU3D_SHADER_SEL], 649 + clk[IMX6QDL_CLK_PLL2_PFD1_594M]); 650 + clk_set_parent(clk[IMX6QDL_CLK_GPU2D_CORE_SEL], 651 + clk[IMX6QDL_CLK_PLL3_USB_OTG]); 652 + } 653 + 636 654 imx_register_uart_clocks(uart_clks); 637 655 } 638 656 CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init);