From: Jiyu Yang Date: Wed, 1 Nov 2017 08:20:26 +0000 (+0800) Subject: gpu: check def_clk when probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77e364837427ec991544f9b55a8f3a6275ddb706;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_mali-driver.git gpu: check def_clk when probe PD#152825: Change-Id: I9fb943fb13a0c3644d9247ce63eb394a0bcd1dbf Signed-off-by: Jiyu Yang --- diff --git a/utgard/platform/meson_bu/mali_clock.c b/utgard/platform/meson_bu/mali_clock.c index 81cce49..18076ac 100644 --- a/utgard/platform/meson_bu/mali_clock.c +++ b/utgard/platform/meson_bu/mali_clock.c @@ -358,6 +358,8 @@ int mali_dt_info(struct platform_device *pdev, struct mali_plat_info_t *mpdata) dev_notice(&pdev->dev, "default clk set to %d\n", mpdata->dvfs_table_size/2-1); mpdata->def_clock = mpdata->dvfs_table_size/2 - 1; } + if (mpdata->def_clock > mpdata->scale_info.maxclk) + mpdata->def_clock = mpdata->scale_info.maxclk; _dev_info(&pdev->dev, "default clk is %d\n", mpdata->def_clock); dvfs_tbl = mpdata->dvfs_table; @@ -642,6 +644,8 @@ int mali_dt_info(struct platform_device *pdev, struct mali_plat_info_t *mpdata) dev_notice(&pdev->dev, "default clk set to %d\n", mpdata->dvfs_table_size/2-1); mpdata->def_clock = mpdata->dvfs_table_size/2 - 1; } + if (mpdata->def_clock > mpdata->scale_info.maxclk) + mpdata->def_clock = mpdata->scale_info.maxclk; _dev_info(&pdev->dev, "default clk is %d\n", mpdata->def_clock); dvfs_tbl = mpdata->dvfs_table;