From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8AAB3C04FFE for ; Thu, 2 May 2024 18:42:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B841310ED2F; Thu, 2 May 2024 18:42:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="oCiyhsVR"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id A124810ED2F for ; Thu, 2 May 2024 18:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1714675343; bh=GY/ufleMnabJJ/oIap8PgkM9OJK/6wYoHE1lmee3E+c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oCiyhsVR/UXBF3YWIJbIyYlA46vAb/8rT9ReU6KEPBJDAuWOaeEUF+GJPHBKImULy V+aligaTPACkVUPUjr8LjJGQB++3hqvrLBc7t3eBPovhURXz89I4C+gs/AD37bU6SB r9zL57SLnUZj+c2qDgiXDwPs7cbFKMPC087vLqGz2z8Z9YQXFsO1NG5AOkzfM1GcNh U8NBLl+aXhJKTh+igt7meI4+PpylF8pNmTfXIWLiropPo6b+/vBGlt36w7lN4copdj GlYGAv7nphuTG78aXm4zNpBeanjm1joOGC9+Y3e0O5dAdEkFwBDvbG7N54Yria1D14 QHfPy0QzyXgug== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madrid.collaboradmins.com (Postfix) with ESMTPSA id DBC7237809D1; Thu, 2 May 2024 18:42:22 +0000 (UTC) Date: Thu, 2 May 2024 20:42:21 +0200 From: Boris Brezillon To: Boris Brezillon , Steven Price , Liviu Dudau , =?UTF-8?B?QWRy?= =?UTF-8?B?acOhbg==?= Larumbe Cc: dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: Re: [PATCH] drm/panthor: Fix the FW reset logic Message-ID: <20240502204221.6d7d780d@collabora.com> In-Reply-To: <20240430113727.493155-1-boris.brezillon@collabora.com> References: <20240430113727.493155-1-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 30 Apr 2024 13:37:27 +0200 Boris Brezillon wrote: > In the post_reset function, if the fast reset didn't succeed, we > are not clearing the fast_reset flag, which prevents firmware > sections from being reloaded. While at it, use panthor_fw_stop() > instead of manually writing DISABLE to the MCU_CONTROL register. > > Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block") > Signed-off-by: Boris Brezillon Queued to drm-misc-next-fixes. > --- > drivers/gpu/drm/panthor/panthor_fw.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c > index 181395e2859a..fedf9627453f 100644 > --- a/drivers/gpu/drm/panthor/panthor_fw.c > +++ b/drivers/gpu/drm/panthor/panthor_fw.c > @@ -1083,10 +1083,11 @@ int panthor_fw_post_reset(struct panthor_device *ptdev) > if (!ret) > goto out; > > - /* Force a disable, so we get a fresh boot on the next > - * panthor_fw_start() call. > + /* Forcibly reset the MCU and force a slow reset, so we get a > + * fresh boot on the next panthor_fw_start() call. > */ > - gpu_write(ptdev, MCU_CONTROL, MCU_CONTROL_DISABLE); > + panthor_fw_stop(ptdev); > + ptdev->fw->fast_reset = false; > drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset"); > } >