mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikko Perttunen <mperttunen@nvidia.com>
To: Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
	Sasha Levin <sashal@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Aaron Kling <webgeek1234@gmail.com>,
	Diogo Ivo <diogo.ivo@bootlin.com>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/6] drm/nouveau/tegra: Keep the fuse clock enabled while the GPU is powered
Date: Thu, 26 Nov 2026 16:09:42 +0900	[thread overview]
Message-ID: <vaif4BJtRCizzGlGyucUTw@nvidia.com> (raw)
In-Reply-To: <20261016160700.3831336-7-sashal@kernel.org>

On Saturday, October 17, 2026 1:06 AM Sasha Levin wrote:
> Since the GPU on the Jetson TX1 was enabled in commit d1b725476104
> ("arm64: tegra: p2180: Explicitly enable GPU"), nouveau often fails to
> bring up the GM20B. Either BOOT_0 reads back garbage ("unknown chipset
> (5ffefa47)"), or PRI reads of the GPC PLL time out ("MMIO read of
> 00000000 FAULT at 137000 [ TIMEOUT ]"), or the first register reads in
> nvkm_device_ctor() stall until an asynchronous SError. How often depends
> on the board; one board fails on every boot.
> 
> nouveau powers the GPU up with the fuse clock gated: since commit
> 24a15252ff04 ("soc/tegra: fuse: Add runtime PM support"), the Tegra fuse
> driver only enables that clock around its own fuse reads. NVIDIA's
> downstream nvgpu driver enables the fuse clock along with the other GPU
> clocks whenever the GPU is powered. Do the same: take an optional "fuse"
> clock and keep it enabled from before the GPU rail is turned on until
> after it is turned off. The clock is optional so that device trees that
> lack it keep working as before.
> 
> Tested on eight Jetson TX1 devkits, on mainline and on v6.18. Without
> this patch, the GPU failed to come up in 27 of 109 boots; with it, in 11
> of 291, none of them with a garbage BOOT_0. On the board that failed on
> every boot, 38 of 40 boots now succeed. The remaining failures are
> mostly a register read that stalls until an SError; wherever the console
> shows when, nouveau had already finished probing. Such stalls also occur
> without this patch and are a separate problem. The Jetson Nano, which
> shares the Tegra210 GPU node, still works (24 of 24 boots).
> 
> Fixes: d1b725476104 ("arm64: tegra: p2180: Explicitly enable GPU")
> Assisted-by: LLM
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  .../gpu/drm/nouveau/include/nvkm/core/tegra.h |  1 +
>  .../drm/nouveau/nvkm/engine/device/tegra.c    | 22 ++++++++++++++-----
>  2 files changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h b/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h
> index 6aaa30ef167f6..0189043382d02 100644
> --- a/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h
> +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h
> @@ -15,6 +15,7 @@ struct nvkm_device_tegra {
>  	struct clk *clk;
>  	struct clk *clk_ref;
>  	struct clk *clk_pwr;
> +	struct clk *clk_fuse;
>  
>  	struct regulator *vdd;
>  
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> index 3c8d0878891ad..74b292659ee9a 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> @@ -32,6 +32,10 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
>  {
>  	int ret;
>  
> +	ret = clk_prepare_enable(tdev->clk_fuse);
> +	if (ret)
> +		return ret;
> +
>  	if (tdev->vdd) {
>  		ret = regulator_enable(tdev->vdd);
>  		if (ret)
> @@ -76,26 +80,26 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
>  	if (tdev->vdd)
>  		regulator_disable(tdev->vdd);
>  err_power:
> +	clk_disable_unprepare(tdev->clk_fuse);
>  	return ret;
>  }
>  
>  static int
>  nvkm_device_tegra_power_down(struct nvkm_device_tegra *tdev)
>  {
> -	int ret;
> +	int ret = 0;
>  
>  	clk_disable_unprepare(tdev->clk_pwr);
>  	clk_disable_unprepare(tdev->clk_ref);
>  	clk_disable_unprepare(tdev->clk);
>  	udelay(10);
>  
> -	if (tdev->vdd) {
> +	if (tdev->vdd)
>  		ret = regulator_disable(tdev->vdd);
> -		if (ret)
> -			return ret;
> -	}
>  
> -	return 0;
> +	clk_disable_unprepare(tdev->clk_fuse);
> +
> +	return ret;
>  }
>  
>  static void
> @@ -308,6 +312,12 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func,
>  		goto free;
>  	}
>  
> +	tdev->clk_fuse = devm_clk_get_optional(&pdev->dev, "fuse");
> +	if (IS_ERR(tdev->clk_fuse)) {
> +		ret = PTR_ERR(tdev->clk_fuse);
> +		goto free;
> +	}
> +
>  	tdev->pmc = devm_tegra_pmc_get(&pdev->dev);
>  	if (IS_ERR(tdev->pmc)) {
>  		ret = PTR_ERR(tdev->pmc);
> -- 
> 2.53.0
> 
> 

This enables the fuse clock first thing during power up, even before the 
regulator. Have you observed this to be necessary? I'm inclined to think 
that it doesn't need to be on before the regulator, and the code would 
look cleaner that way.

During power down, we certainly should be able to disable it before 
regulator disable with the other clocks. I've found some data saying the 
fuse clock only needs to be enabled briefly during power up.

FWIW, I've tested this on Tegra194 and it helps even there.

Thanks
Mikko




      reply	other threads:[~2026-11-26  7:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 16:06 [PATCH v2 0/6] Keep the fuse clock enabled while the Tegra " Sasha Levin
2026-10-16 16:06 ` [PATCH v2 1/6] dt-bindings: gpu: nvidia,gk20a: Require the fuse clock Sasha Levin
2026-10-22 13:59   ` Rob Herring
2026-10-16 16:06 ` [PATCH v2 2/6] ARM: tegra: Add the fuse clock to the Tegra124 GPU Sasha Levin
2026-10-16 16:06 ` [PATCH v2 3/6] arm64: tegra: Add the fuse clock to the Tegra132 GPU Sasha Levin
2026-10-16 16:06 ` [PATCH v2 4/6] arm64: tegra: Add the fuse clock to the Tegra186 GPU Sasha Levin
2026-10-16 16:06 ` [PATCH v2 5/6] arm64: tegra: Add the fuse clock to the Tegra210 GPU Sasha Levin
2026-10-16 16:06 ` [PATCH v2 6/6] drm/nouveau/tegra: Keep the fuse clock enabled while the GPU is powered Sasha Levin
2026-11-26  7:09   ` Mikko Perttunen [this message]

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=vaif4BJtRCizzGlGyucUTw@nvidia.com \
    --to=mperttunen@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=dakr@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=diogo.ivo@bootlin.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=robh@kernel.org \
    --cc=sashal@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=thierry.reding@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=webgeek1234@gmail.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

all inboxes | Powered by JetHome®