From: Marek Vasut <marex@denx.de>
To: linux-clk@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>,
Michael Turquette <mturquette@baylibre.com>,
Michal Simek <michal.simek@amd.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: zynqmp: Work around broken DT GPU node
Date: Thu, 31 Oct 2024 17:59:33 +0100 [thread overview]
Message-ID: <20241031170015.55243-1-marex@denx.de> (raw)
The ZynqMP DT GPU node clock description is wrong and does not represent
the hardware correctly, it only describes BUS and PP0 clock, while it is
missing PP1 clock. That means PP1 clock can never be enabled when the GPU
should be used, which leads to expected GPU hang even with simple basic
tests like kmscube.
Since Xilinx does use generated DTs on ZynqMP, the current broken DT
implementation has to be supported. Add a workaround for this breakage
into the clock driver, in case of PP0 enablement attempt, enable PP1
as well and vice versa. This way, the GPU does work and does not hang
because one of its pixel pipeline clock are not enabled.
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-clk@vger.kernel.org
---
drivers/clk/zynqmp/clk-gate-zynqmp.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c
index b89e557371984..b013aa33e7abb 100644
--- a/drivers/clk/zynqmp/clk-gate-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c
@@ -7,6 +7,7 @@
* Gated clock implementation
*/
+#include <dt-bindings/clock/xlnx-zynqmp-clk.h>
#include <linux/clk-provider.h>
#include <linux/slab.h>
#include "clk-zynqmp.h"
@@ -38,7 +39,13 @@ static int zynqmp_clk_gate_enable(struct clk_hw *hw)
u32 clk_id = gate->clk_id;
int ret;
- ret = zynqmp_pm_clock_enable(clk_id);
+ if (clk_id == GPU_PP0_REF || clk_id == GPU_PP1_REF) {
+ ret = zynqmp_pm_clock_enable(GPU_PP0_REF);
+ if (!ret)
+ ret = zynqmp_pm_clock_enable(GPU_PP1_REF);
+ } else {
+ ret = zynqmp_pm_clock_enable(clk_id);
+ }
if (ret)
pr_debug("%s() clock enable failed for %s (id %d), ret = %d\n",
@@ -58,7 +65,13 @@ static void zynqmp_clk_gate_disable(struct clk_hw *hw)
u32 clk_id = gate->clk_id;
int ret;
- ret = zynqmp_pm_clock_disable(clk_id);
+ if (clk_id == GPU_PP0_REF || clk_id == GPU_PP1_REF) {
+ ret = zynqmp_pm_clock_disable(GPU_PP1_REF);
+ if (!ret)
+ ret = zynqmp_pm_clock_disable(GPU_PP0_REF);
+ } else {
+ ret = zynqmp_pm_clock_disable(clk_id);
+ }
if (ret)
pr_debug("%s() clock disable failed for %s (id %d), ret = %d\n",
--
2.45.2
next reply other threads:[~2024-10-31 17:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 16:59 Marek Vasut [this message]
2024-11-11 14:33 ` [PATCH] clk: zynqmp: Work around broken DT GPU node Sagar, Vishal
2024-11-11 16:25 ` Marek Vasut
2024-11-12 13:17 ` Gajjar, Parth
2024-11-12 20:00 ` Marek Vasut
2024-11-13 13:32 ` Gajjar, Parth
2024-11-13 19:55 ` Marek Vasut
2024-11-26 5:25 ` Gajjar, Parth
2024-11-26 16:18 ` Marek Vasut
2024-11-28 14:35 ` Gajjar, Parth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031170015.55243-1-marex@denx.de \
--to=marex@denx.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox