From 2e9a520742644ffddf7bc9888b89d1fc77edd2be Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Thu, 16 Apr 2020 22:36:59 +0200 Subject: [PATCH] Allwinner: Remove panfrost patch which causes instability --- .../17-Add-GPU-operating-points-for-H6.patch | 317 ------------------ 1 file changed, 317 deletions(-) delete mode 100644 projects/Allwinner/devices/H6/patches/linux/17-Add-GPU-operating-points-for-H6.patch diff --git a/projects/Allwinner/devices/H6/patches/linux/17-Add-GPU-operating-points-for-H6.patch b/projects/Allwinner/devices/H6/patches/linux/17-Add-GPU-operating-points-for-H6.patch deleted file mode 100644 index 7e7c8a3549..0000000000 --- a/projects/Allwinner/devices/H6/patches/linux/17-Add-GPU-operating-points-for-H6.patch +++ /dev/null @@ -1,317 +0,0 @@ -From patchwork Wed May 29 15:32:55 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -Subject: arm64: dts: allwinner: Add GPU operating points for H6 -X-Patchwork-Submitter: Tomeu Vizoso -X-Patchwork-Id: 165375 -Message-Id: <20190529153255.40038-1-tomeu.vizoso@collabora.com> -To: linux-kernel@vger.kernel.org -Cc: Tomeu Vizoso , =?utf-8?b?Q2zDqW1lbnQgUMOp?= - =?utf-8?q?ron?= , - Maxime Ripard , Chen-Yu Tsai , - Rob Herring , Mark Rutland , - linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner - sunXi SoC support), devicetree@vger.kernel.org (open list:OPEN - FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) -Date: Wed, 29 May 2019 17:32:55 +0200 -From: Tomeu Vizoso -List-Id: - -The GPU driver needs them to change the clock frequency and regulator -voltage depending on the load. - -Signed-off-by: Tomeu Vizoso -Cc: Clément Péron - ---- - -Feel free to pick up this patch if you are going to keep pushing this -series forward. - -Thanks, - -Tomeu ---- - arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 66 ++++++++++++++++++++ - 1 file changed, 66 insertions(+) - --- -2.20.1 - -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -index 6aad06095c40..decf7b56e2df 100644 ---- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -@@ -157,6 +157,71 @@ - allwinner,sram = <&ve_sram 1>; - }; - -+ gpu_opp_table: opp-table2 { -+ compatible = "operating-points-v2"; -+ -+ opp00 { -+ opp-hz = /bits/ 64 <756000000>; -+ opp-microvolt = <1040000>; -+ }; -+ opp01 { -+ opp-hz = /bits/ 64 <624000000>; -+ opp-microvolt = <950000>; -+ }; -+ opp02 { -+ opp-hz = /bits/ 64 <576000000>; -+ opp-microvolt = <930000>; -+ }; -+ opp03 { -+ opp-hz = /bits/ 64 <540000000>; -+ opp-microvolt = <910000>; -+ }; -+ opp04 { -+ opp-hz = /bits/ 64 <504000000>; -+ opp-microvolt = <890000>; -+ }; -+ opp05 { -+ opp-hz = /bits/ 64 <456000000>; -+ opp-microvolt = <870000>; -+ }; -+ opp06 { -+ opp-hz = /bits/ 64 <432000000>; -+ opp-microvolt = <860000>; -+ }; -+ opp07 { -+ opp-hz = /bits/ 64 <420000000>; -+ opp-microvolt = <850000>; -+ }; -+ opp08 { -+ opp-hz = /bits/ 64 <408000000>; -+ opp-microvolt = <840000>; -+ }; -+ opp09 { -+ opp-hz = /bits/ 64 <384000000>; -+ opp-microvolt = <830000>; -+ }; -+ opp10 { -+ opp-hz = /bits/ 64 <360000000>; -+ opp-microvolt = <820000>; -+ }; -+ opp11 { -+ opp-hz = /bits/ 64 <336000000>; -+ opp-microvolt = <810000>; -+ }; -+ opp12 { -+ opp-hz = /bits/ 64 <312000000>; -+ opp-microvolt = <810000>; -+ }; -+ opp13 { -+ opp-hz = /bits/ 64 <264000000>; -+ opp-microvolt = <810000>; -+ }; -+ opp14 { -+ opp-hz = /bits/ 64 <216000000>; -+ opp-microvolt = <810000>; -+ }; -+ }; -+ - gpu: gpu@1800000 { - compatible = "allwinner,sun50i-h6-mali", - "arm,mali-t720"; -@@ -168,6 +233,7 @@ - clocks = <&ccu CLK_GPU>, <&ccu CLK_BUS_GPU>; - clock-names = "core", "bus"; - resets = <&ccu RST_BUS_GPU>; -+ operating-points-v2 = <&gpu_opp_table>; - status = "disabled"; - }; - -From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= -To: Rob Herring , - Tomeu Vizoso , - Steven Price , - Alyssa Rosenzweig , - Viresh Kumar , Nishanth Menon , - Stephen Boyd -Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, - =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= -Subject: [PATCH 1/2] drm/panfrost: missing remove opp table in case of failure -Date: Sat, 11 Apr 2020 22:06:31 +0200 -Message-Id: <20200411200632.4045-1-peron.clem@gmail.com> -X-Mailer: git-send-email 2.20.1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -Sender: linux-kernel-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-kernel@vger.kernel.org -Archived-At: -List-Archive: -List-Post: - -In case of failure we need to remove OPP table. - -Use Linux classic error handling with goto usage. - -Signed-off-by: Clément Péron ---- - drivers/gpu/drm/panfrost/panfrost_devfreq.c | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -index 413987038fbf..62541f4edd81 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c -+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -@@ -90,8 +90,11 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) - cur_freq = clk_get_rate(pfdev->clock); - - opp = devfreq_recommended_opp(dev, &cur_freq, 0); -- if (IS_ERR(opp)) -- return PTR_ERR(opp); -+ if (IS_ERR(opp)) { -+ DRM_DEV_ERROR(dev, "Failed to set recommended OPP\n"); -+ ret = PTR_ERR(opp); -+ goto err_opp; -+ } - - panfrost_devfreq_profile.initial_freq = cur_freq; - dev_pm_opp_put(opp); -@@ -100,8 +103,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) - DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); - if (IS_ERR(devfreq)) { - DRM_DEV_ERROR(dev, "Couldn't initialize GPU devfreq\n"); -- dev_pm_opp_of_remove_table(dev); -- return PTR_ERR(devfreq); -+ ret = PTR_ERR(devfreq); -+ goto err_opp; - } - pfdev->devfreq.devfreq = devfreq; - -@@ -112,6 +115,11 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) - pfdev->devfreq.cooling = cooling; - - return 0; -+ -+err_opp: -+ dev_pm_opp_of_remove_table(dev); -+ -+ return ret; - } - - void panfrost_devfreq_fini(struct panfrost_device *pfdev) --- -2.20.1 - - -From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= -To: Rob Herring , - Tomeu Vizoso , - Steven Price , - Alyssa Rosenzweig , - Viresh Kumar , Nishanth Menon , - Stephen Boyd -Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, - =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= -Subject: [PATCH 2/2] drm/panfrost: add devfreq regulator support -Date: Sat, 11 Apr 2020 22:06:32 +0200 -Message-Id: <20200411200632.4045-2-peron.clem@gmail.com> -X-Mailer: git-send-email 2.20.1 -In-Reply-To: <20200411200632.4045-1-peron.clem@gmail.com> -References: <20200411200632.4045-1-peron.clem@gmail.com> -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -Sender: linux-kernel-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-kernel@vger.kernel.org -Archived-At: -List-Archive: -List-Post: - -OPP table can defined both frequency and voltage. - -Register the mali regulator if it exist. - -Signed-off-by: Clément Péron ---- - drivers/gpu/drm/panfrost/panfrost_devfreq.c | 34 ++++++++++++++++++--- - drivers/gpu/drm/panfrost/panfrost_device.h | 1 + - 2 files changed, 31 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -index 62541f4edd81..2dc8e2355358 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c -+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -@@ -78,12 +78,26 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) - struct device *dev = &pfdev->pdev->dev; - struct devfreq *devfreq; - struct thermal_cooling_device *cooling; -+ const char *mali = "mali"; -+ struct opp_table *opp_table = NULL; -+ -+ /* Regulator is optional */ -+ opp_table = dev_pm_opp_set_regulators(dev, &mali, 1); -+ if (IS_ERR(opp_table)) { -+ ret = PTR_ERR(opp_table); -+ if (ret != -ENODEV) { -+ DRM_DEV_ERROR(dev, "Failed to set regulator: %d\n", ret); -+ return ret; -+ } -+ } -+ pfdev->devfreq.opp_table = opp_table; - - ret = dev_pm_opp_of_add_table(dev); -- if (ret == -ENODEV) /* Optional, continue without devfreq */ -- return 0; -- else if (ret) -- return ret; -+ if (ret) { -+ if (ret == -ENODEV) /* Optional, continue without devfreq */ -+ ret = 0; -+ goto err_opp_reg; -+ } - - panfrost_devfreq_reset(pfdev); - -@@ -119,6 +133,12 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) - err_opp: - dev_pm_opp_of_remove_table(dev); - -+err_opp_reg: -+ if (pfdev->devfreq.opp_table) { -+ dev_pm_opp_put_regulators(pfdev->devfreq.opp_table); -+ pfdev->devfreq.opp_table = NULL; -+ } -+ - return ret; - } - -@@ -126,7 +146,13 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev) - { - if (pfdev->devfreq.cooling) - devfreq_cooling_unregister(pfdev->devfreq.cooling); -+ - dev_pm_opp_of_remove_table(&pfdev->pdev->dev); -+ -+ if (pfdev->devfreq.opp_table) { -+ dev_pm_opp_put_regulators(pfdev->devfreq.opp_table); -+ pfdev->devfreq.opp_table = NULL; -+ } - } - - void panfrost_devfreq_resume(struct panfrost_device *pfdev) -diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h -index 06713811b92c..f6b0c779dfe5 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_device.h -+++ b/drivers/gpu/drm/panfrost/panfrost_device.h -@@ -86,6 +86,7 @@ struct panfrost_device { - struct { - struct devfreq *devfreq; - struct thermal_cooling_device *cooling; -+ struct opp_table *opp_table; - ktime_t busy_time; - ktime_t idle_time; - ktime_t time_last_update; --- -2.20.1 - -