linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org
Cc: Marek Vasut <marex@denx.de>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Conor Dooley <conor+dt@kernel.org>,
	David Airlie <airlied@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Sebastian Reichel <sre@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>, Simona Vetter <simona@ffwll.ch>,
	Steven Price <steven.price@arm.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	imx@lists.linux.dev, Marek Vasut <marex@denx.de>
Subject: Re: [PATCH 4/9] drm/panthor: Implement optional reset
Date: Fri, 28 Feb 2025 11:06:43 +0100	[thread overview]
Message-ID: <2180166.OBFZWjSADL@steina-w> (raw)
In-Reply-To: <20250227170012.124768-5-marex@denx.de>

Hi Marek,

Am Donnerstag, 27. Februar 2025, 17:58:04 CET schrieb Marek Vasut:
> The instance of the GPU populated in Freescale i.MX95 does require
> release from reset by writing into a single GPUMIX block controller
> GPURESET register bit 0. Implement support for one optional reset.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: devicetree@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/gpu/drm/panthor/Kconfig          |  1 +
>  drivers/gpu/drm/panthor/panthor_device.c | 23 +++++++++++++++++++++++
>  drivers/gpu/drm/panthor/panthor_device.h |  3 +++
>  3 files changed, 27 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panthor/Kconfig b/drivers/gpu/drm/panthor/Kconfig
> index 55b40ad07f3b0..ab62bd6a0750f 100644
> --- a/drivers/gpu/drm/panthor/Kconfig
> +++ b/drivers/gpu/drm/panthor/Kconfig
> @@ -14,6 +14,7 @@ config DRM_PANTHOR
>  	select IOMMU_IO_PGTABLE_LPAE
>  	select IOMMU_SUPPORT
>  	select PM_DEVFREQ
> +	select RESET_SIMPLE if SOC_IMX9
>  	help
>  	  DRM driver for ARM Mali CSF-based GPUs.
>  
> diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> index a9da1d1eeb707..51ee9cae94504 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.c
> +++ b/drivers/gpu/drm/panthor/panthor_device.c
> @@ -64,6 +64,17 @@ static int panthor_clk_init(struct panthor_device *ptdev)
>  	return 0;
>  }
>  
> +static int panthor_reset_init(struct panthor_device *ptdev)
> +{
> +	ptdev->resets = devm_reset_control_get_optional_exclusive_deasserted(ptdev->base.dev, NULL);

If the description as a write-once register is true, wouldn't this
already write to it?

> +	if (IS_ERR(ptdev->resets))
> +		return dev_err_probe(ptdev->base.dev,
> +				     PTR_ERR(ptdev->resets),
> +				     "get reset failed");
> +
> +	return 0;
> +}
> +
>  void panthor_device_unplug(struct panthor_device *ptdev)
>  {
>  	/* This function can be called from two different path: the reset work
> @@ -217,6 +228,10 @@ int panthor_device_init(struct panthor_device *ptdev)
>  	if (ret)
>  		return ret;
>  
> +	ret = panthor_reset_init(ptdev);
> +	if (ret)
> +		return ret;
> +
>  	ret = panthor_devfreq_init(ptdev);
>  	if (ret)
>  		return ret;
> @@ -470,6 +485,10 @@ int panthor_device_resume(struct device *dev)
>  	if (ret)
>  		goto err_disable_stacks_clk;
>  
> +	ret = reset_control_deassert(ptdev->resets);
> +	if (ret)
> +		goto err_disable_coregroup_clk;
> +

This wouldn't work at all on a write-once register, no? Same for resume.

Best regards
Alexander

>  	panthor_devfreq_resume(ptdev);
>  
>  	if (panthor_device_is_initialized(ptdev) &&
> @@ -512,6 +531,9 @@ int panthor_device_resume(struct device *dev)
>  
>  err_suspend_devfreq:
>  	panthor_devfreq_suspend(ptdev);
> +	reset_control_assert(ptdev->resets);
> +
> +err_disable_coregroup_clk:
>  	clk_disable_unprepare(ptdev->clks.coregroup);
>  
>  err_disable_stacks_clk:
> @@ -563,6 +585,7 @@ int panthor_device_suspend(struct device *dev)
>  
>  	panthor_devfreq_suspend(ptdev);
>  
> +	reset_control_assert(ptdev->resets);
>  	clk_disable_unprepare(ptdev->clks.coregroup);
>  	clk_disable_unprepare(ptdev->clks.stacks);
>  	clk_disable_unprepare(ptdev->clks.core);
> diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
> index da6574021664b..fea3a05778e2e 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.h
> +++ b/drivers/gpu/drm/panthor/panthor_device.h
> @@ -111,6 +111,9 @@ struct panthor_device {
>  		struct clk *coregroup;
>  	} clks;
>  
> +	/** @resets: GPU reset. */
> +	struct reset_control *resets;

Your commit message says "one optional reset", so I would name this just
reset.

> +
>  	/** @coherent: True if the CPU/GPU are memory coherent. */
>  	bool coherent;
>  
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/




  reply	other threads:[~2025-02-28 10:10 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27 16:58 [PATCH 0/9] arm64: dts: imx95: Add support for Mali G310 GPU Marek Vasut
2025-02-27 16:58 ` [PATCH 1/9] dt-bindings: reset: imx95-gpu-blk-ctrl: Document Freescale i.MX95 GPU reset Marek Vasut
2025-02-27 17:30   ` Frank Li
2025-02-27 20:22     ` Marek Vasut
2025-02-27 18:38   ` Rob Herring (Arm)
2025-02-27 16:58 ` [PATCH 2/9] reset: simple: Add support for " Marek Vasut
2025-02-27 17:32   ` Frank Li
2025-02-28  9:58   ` Alexander Stein
2025-02-28 16:43     ` Marek Vasut
2025-02-27 16:58 ` [PATCH 3/9] dt-bindings: gpu: mali-valhall-csf: Document optional reset Marek Vasut
2025-02-27 17:33   ` Frank Li
2025-02-27 18:38   ` Rob Herring (Arm)
2025-02-28 12:25   ` Rob Herring (Arm)
2025-02-27 16:58 ` [PATCH 4/9] drm/panthor: Implement " Marek Vasut
2025-02-28 10:06   ` Alexander Stein [this message]
2025-02-28 16:48     ` Marek Vasut
2025-03-01 21:45   ` kernel test robot
2025-02-27 16:58 ` [PATCH 5/9] drm/panthor: Implement support for multiple power domains Marek Vasut
2025-02-28 10:10   ` Alexander Stein
2025-02-28 17:00     ` Marek Vasut
2025-02-27 16:58 ` [PATCH 6/9] drm/panthor: Reset GPU after L2 cache power off Marek Vasut
2025-02-27 17:17   ` Boris Brezillon
2025-02-27 17:26     ` Marek Vasut
2025-02-28 11:06   ` Liviu Dudau
2025-02-28 17:05     ` Marek Vasut
2025-03-03 12:08       ` Liviu Dudau
2025-03-03 12:35         ` Boris Brezillon
2025-03-03 12:42           ` Boris Brezillon
2025-03-21 20:00             ` Marek Vasut
2025-03-21 19:54           ` Marek Vasut
2025-02-27 16:58 ` [PATCH 7/9] dt-bindings: gpu: mali-valhall-csf: Document i.MX95 support Marek Vasut
2025-02-27 17:34   ` Frank Li
2025-02-27 18:38   ` Rob Herring (Arm)
2025-02-27 20:31     ` Marek Vasut
2025-02-28 12:28       ` Rob Herring
2025-02-28 10:12   ` Alexander Stein
2025-02-28 12:30   ` Rob Herring
2025-02-28 17:17     ` Marek Vasut
2025-02-27 16:58 ` [PATCH 8/9] drm/panthor: Add " Marek Vasut
2025-02-27 17:35   ` Frank Li
2025-02-27 20:17   ` Marco Felsch
2025-02-27 20:39     ` Marek Vasut
2025-02-28 10:33       ` Marco Felsch
2025-02-28 17:20         ` Marek Vasut
2025-02-28 10:21   ` Alexander Stein
2025-02-28 11:23     ` Florent Tomasin
2025-02-28 17:26       ` Marek Vasut
2025-03-03 13:55         ` Florent Tomasin
2025-02-28 17:21     ` Marek Vasut
2025-02-27 16:58 ` [PATCH 9/9] arm64: dts: imx95: Describe Mali G310 GPU Marek Vasut
2025-02-27 17:43   ` Frank Li
2025-02-27 20:36     ` Marek Vasut
2025-02-27 21:27       ` Frank Li
2025-02-27 21:34         ` Marek Vasut
2025-02-27 22:21           ` Frank Li
2025-02-28 10:39             ` Alexander Stein
2025-02-28 17:33               ` Marek Vasut
2025-02-28 10:36   ` Alexander Stein
2025-02-28 17:43     ` Marek Vasut
2025-03-03 15:04       ` Liviu Dudau
2025-03-21 19:37         ` Marek Vasut
2025-02-28 14:23 ` [PATCH 0/9] arm64: dts: imx95: Add support for " Rob Herring (Arm)

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=2180166.OBFZWjSADL@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marex@denx.de \
    --cc=mripard@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=sre@kernel.org \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).