Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@mailbox.org>
To: Alexander Stein <alexander.stein@ew.tq-group.com>,
	dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org,
	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, imx@lists.linux.dev,
	Boris Brezillon <boris.brezillon@collabora.com>
Subject: Re: [PATCH v2 4/9] drm/panthor: Implement optional reset
Date: Thu, 4 Sep 2025 16:46:11 +0200	[thread overview]
Message-ID: <8cc352ee-8279-46c5-901b-e6624156263a@mailbox.org> (raw)
In-Reply-To: <7020337.lOV4Wx5bFT@steina-w>

On 9/4/25 4:39 PM, Alexander Stein wrote:
> Hi,
> 
> Am Donnerstag, 4. September 2025, 15:52:38 CEST schrieb Marek Vasut:
>> On 9/4/25 8:36 AM, Alexander Stein wrote:
>>
>> Hello Alexander,
>>
>>>>> Maybe the GPU remains halted because
>>>>> setting the GLB_HALT stops command stream processing, and the GPU never
>>>>> samples the clearing of GLB_HALT and therefore remains halted forever ?
>>>>
>>>> Exactly that, and that's expected.
>>>
>>> FYI: in a new release of system manager software (starting from lf-6.12.3-1.0.0),
>>> the GPU reset is reasserted in SM software already [1] and access to GPU
>>> block control has been removed from Cortex-A [2]. Starting from B0 step this
>>> version is required AFAIK.
>>
>> I don't think the SM is involved in this, because if I do the following
>> test, the MCU also fails to boot unless I do a reset:
> 
> Is this some other reset than BLK_CTRL_GPUMIX? If so, it might be required.
> Don't know much about internal details though.
Yes

    296	/**
    297	 * panthor_gpu_soft_reset() - Issue a soft-reset
    298	 * @ptdev: Device.
    299	 *
    300	 * Return: 0 on success, a negative error code otherwise.
    301	 */
    302	int panthor_gpu_soft_reset(struct panthor_device *ptdev)
    303	{
    304		bool timedout = false;
    305		unsigned long flags;
    306	
    307		spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags);
    308		if (!drm_WARN_ON(&ptdev->base,
    309				 ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) {
    310			ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED;
    311			gpu_write(ptdev, GPU_INT_CLEAR, GPU_IRQ_RESET_COMPLETED);
    312			gpu_write(ptdev, GPU_CMD, GPU_SOFT_RESET);
    313		}
    314		spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags);
    315	
    316		if (!wait_event_timeout(ptdev->gpu->reqs_acked,
    317					!(ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED),
    318					msecs_to_jiffies(100))) {
    319			spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags);
    320			if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 &&
    321			    !(gpu_read(ptdev, GPU_INT_RAWSTAT) & GPU_IRQ_RESET_COMPLETED))
    322				timedout = true;
    323			else
    324				ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED;
    325			spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags);
    326		}
    327	
    328		if (timedout) {
    329			drm_err(&ptdev->base, "Soft reset timeout");
    330			return -ETIMEDOUT;
    331		}
    332	
    333		return 0;
    334	}

  reply	other threads:[~2025-09-04 14:46 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 20:05 [PATCH v2 0/9] arm64: dts: imx95: Add support for Mali G310 GPU Marek Vasut
2025-03-21 20:05 ` [PATCH v2 1/9] dt-bindings: reset: imx95-gpu-blk-ctrl: Document Freescale i.MX95 GPU reset Marek Vasut
2025-03-21 21:40   ` Rob Herring (Arm)
2025-03-21 20:05 ` [PATCH v2 2/9] reset: simple: Add support for " Marek Vasut
2025-03-21 20:05 ` [PATCH v2 3/9] dt-bindings: gpu: mali-valhall-csf: Document optional reset Marek Vasut
2025-04-03 12:53   ` Liviu Dudau
2025-03-21 20:05 ` [PATCH v2 4/9] drm/panthor: Implement " Marek Vasut
2025-03-24  8:43   ` Boris Brezillon
2025-03-24 19:05     ` Marek Vasut
2025-03-25 14:12       ` Philipp Zabel
2025-03-25 14:27         ` Marek Vasut
2025-03-25 15:00           ` Philipp Zabel
2025-03-24 23:37     ` Marek Vasut
2025-03-25  7:43       ` Boris Brezillon
2025-03-25 13:50         ` Marek Vasut
2025-03-25 14:35           ` Boris Brezillon
2025-03-25 14:37             ` Marek Vasut
2025-03-25 14:52               ` Boris Brezillon
2025-09-03 21:44                 ` Marek Vasut
2025-09-04  6:22                   ` Boris Brezillon
2025-09-04  6:36                     ` Alexander Stein
2025-09-04 13:52                       ` Marek Vasut
2025-09-04 14:39                         ` Alexander Stein
2025-09-04 14:46                           ` Marek Vasut [this message]
2025-09-04 13:49                     ` Marek Vasut
2025-09-04 14:04                       ` Boris Brezillon
2025-09-04 14:54                         ` Marek Vasut
2025-09-04 15:20                           ` Boris Brezillon
2025-09-04 15:29                             ` Marek Vasut
2025-09-16 10:06                               ` Rain Yang
2025-09-16 17:34                                 ` Marek Vasut
2025-09-17  1:49                                   ` Rain Yang
2025-09-17  2:17                                     ` Marek Vasut
2025-09-17 14:18                                       ` Rain Yang
2025-09-25 20:41                                         ` Marek Vasut
2025-09-26  9:18                                           ` Rain Yang
2025-09-26 13:32                                             ` Marek Vasut
2025-09-28  8:24                                               ` Rain Yang
2025-09-28 16:56                                                 ` Marek Vasut
2025-03-21 20:05 ` [PATCH v2 5/9] drm/panthor: Implement support for multiple power domains Marek Vasut
2025-03-26 15:07   ` Steven Price
2025-03-21 20:05 ` [PATCH v2 6/9] drm/panthor: Reset GPU after L2 cache power off Marek Vasut
2025-03-21 20:05 ` [PATCH v2 7/9] dt-bindings: gpu: mali-valhall-csf: Document i.MX95 support Marek Vasut
2025-03-24 16:31   ` Rob Herring (Arm)
2025-03-21 20:05 ` [PATCH v2 8/9] drm/panthor: Add " Marek Vasut
2025-03-21 20:05 ` [PATCH v2 9/9] arm64: dts: imx95: Describe Mali G310 GPU Marek Vasut
2025-03-24  7:02   ` Alexander Stein
2025-03-24 23:35     ` Marek Vasut
2025-03-25  7:00       ` Alexander Stein
2025-09-04  9:54     ` Peng Fan
2025-09-04 13:22       ` Marek Vasut
2025-09-09  0:52         ` Peng Fan

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=8cc352ee-8279-46c5-901b-e6624156263a@mailbox.org \
    --to=marek.vasut@mailbox.org \
    --cc=airlied@gmail.com \
    --cc=alexander.stein@ew.tq-group.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=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