From: "Sagar, Vishal" <vishal.sagar@amd.com>
To: Marek Vasut <marex@denx.de>, linux-clk@vger.kernel.org
Cc: Michael Turquette <mturquette@baylibre.com>,
Michal Simek <michal.simek@amd.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-arm-kernel@lists.infradead.org, parth.gajjar@amd.com,
"Allagadapa, Varunkumar" <varunkumar.allagadapa@amd.com>
Subject: Re: [PATCH] clk: zynqmp: Work around broken DT GPU node
Date: Mon, 11 Nov 2024 15:33:41 +0100 [thread overview]
Message-ID: <dd4cb501-5fc7-4430-9ffc-9c8c910df425@amd.com> (raw)
In-Reply-To: <20241031170015.55243-1-marex@denx.de>
Hi Marek,
Thanks for sharing this patch.
On 10/31/2024 5:59 PM, Marek Vasut wrote:
> 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.
Could you please share how you tested this?
Please share the dt node too.
We will also check at our end and revert for this.
>
> 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",
Regards
Vishal Sagar
next prev parent reply other threads:[~2024-11-11 14:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 16:59 [PATCH] clk: zynqmp: Work around broken DT GPU node Marek Vasut
2024-11-11 14:33 ` Sagar, Vishal [this message]
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=dd4cb501-5fc7-4430-9ffc-9c8c910df425@amd.com \
--to=vishal.sagar@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=marex@denx.de \
--cc=michal.simek@amd.com \
--cc=mturquette@baylibre.com \
--cc=parth.gajjar@amd.com \
--cc=sboyd@kernel.org \
--cc=varunkumar.allagadapa@amd.com \
/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