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 5FEB9D6EC15 for ; Fri, 29 Nov 2024 14:46:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96CE410E4DD; Fri, 29 Nov 2024 14:46:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="hcTb9MRO"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FB7A10E4D8 for ; Fri, 29 Nov 2024 14:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1732891563; bh=tBPHKIYfvuSMHGiWFX+FO9yppMVY9x5IyMq3G5r1u5Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hcTb9MRO0bZYMVXLVbjTxp1NqrNUyAQh4IpYtrmNL1b0fHN9UxUTq/GXKqN0xfNbU 0xoJmlDFN9S8caEU9ntlviFNMn7PzAQHMZmdKv1l7wCxndd5v7Fq/Q7TnkOkEK3V9Y 2p3YLlN55ooeRw6jbxMy78P7T0fE+6lYbLe4X+b+GKEA07OvMTUNwFHU0dndfMQ7tW ROmakQnvgjOiYcV0JycbLbUet+U5FBDyIqvVl5n9nO9YKnuG/tzt+T86OyjtA264DA OWeuOyUtQd+A18ofxqla6uX3Ff1V8sF6aJcxqv5kixQRz+tP5lcBfEzGvLzN7/Yh7s x6o9EAie7w2Yg== Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (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 bali.collaboradmins.com (Postfix) with ESMTPSA id D4F6617E374C; Fri, 29 Nov 2024 15:46:02 +0100 (CET) Date: Fri, 29 Nov 2024 15:45:54 +0100 From: Boris Brezillon To: =?UTF-8?B?QWRyacOhbg==?= Larumbe Cc: Steven Price , dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: Re: [PATCH v2 2/5] drm/panthor: Be robust against runtime PM resume failures in the suspend path Message-ID: <20241129154554.3d7a18fd@collabora.com> In-Reply-To: References: <20241128110255.3182366-1-boris.brezillon@collabora.com> <20241128110255.3182366-3-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Fri, 29 Nov 2024 13:14:58 +0000 Adri=C3=A1n Larumbe wrote: > Reviewed-by: Adrian Larumbe >=20 > On 28.11.2024 12:02, Boris Brezillon wrote: > > The runtime PM resume operation is not guaranteed to succeed, but if it > > fails, the device should be in a suspended state. Make sure we're robust > > to resume failures in the unplug path. > >=20 > > v2: > > - Move the bit that belonged in the next commit > > - Drop the panthor_device_unplug() changes > >=20 > > Signed-off-by: Boris Brezillon > > --- > > drivers/gpu/drm/panthor/panthor_fw.c | 14 +++++++++----- > > drivers/gpu/drm/panthor/panthor_gpu.c | 3 ++- > > drivers/gpu/drm/panthor/panthor_mmu.c | 3 ++- > > 3 files changed, 13 insertions(+), 7 deletions(-) > >=20 > > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/pan= thor/panthor_fw.c > > index ebf8980ca9a3..f3d3d8fbe13d 100644 > > --- a/drivers/gpu/drm/panthor/panthor_fw.c > > +++ b/drivers/gpu/drm/panthor/panthor_fw.c > > @@ -12,6 +12,7 @@ > > #include > > #include > > #include > > +#include > > =20 > > #include > > #include > > @@ -1190,11 +1191,13 @@ void panthor_fw_unplug(struct panthor_device *p= tdev) > > =20 > > cancel_delayed_work_sync(&ptdev->fw->watchdog.ping_work); > > =20 > > - /* Make sure the IRQ handler can be called after that point. */ > > - if (ptdev->fw->irq.irq) > > - panthor_job_irq_suspend(&ptdev->fw->irq); > > + if (!IS_ENABLED(CONFIG_PM) || pm_runtime_active(ptdev->base.dev)) { > > + /* Make sure the IRQ handler can be called after that point. */ =20 >=20 > Did you mean 'cannot be called' ? Oops, indeed I meant 'cannot'.