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 76645E7717D for ; Wed, 11 Dec 2024 09:50:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1A3510EADD; Wed, 11 Dec 2024 09:50:06 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id EFE4210EAE8 for ; Wed, 11 Dec 2024 09:50:05 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9B07F1063 for ; Wed, 11 Dec 2024 01:50:33 -0800 (PST) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 572AB3F720 for ; Wed, 11 Dec 2024 01:50:05 -0800 (PST) Date: Wed, 11 Dec 2024 09:50:01 +0000 From: Liviu Dudau To: Boris Brezillon Cc: Steven Price , =?utf-8?Q?Adri=C3=A1n?= Larumbe , dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: Re: [PATCH v3 1/5] drm/panthor: Preserve the result returned by panthor_fw_resume() Message-ID: References: <20241211075419.2333731-1-boris.brezillon@collabora.com> <20241211075419.2333731-2-boris.brezillon@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241211075419.2333731-2-boris.brezillon@collabora.com> 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 Wed, Dec 11, 2024 at 08:54:15AM +0100, Boris Brezillon wrote: > WARN() will return true if the condition is true, false otherwise. > If we store the return of drm_WARN_ON() in ret, we lose the actual > error code. > > v3: > - Add R-b > v2: > - Add R-b > > Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block") > Signed-off-by: Boris Brezillon > Reviewed-by: Steven Price > Reviewed-by: Adrian Larumbe Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c > index 984615f4ed27..e701e605d013 100644 > --- a/drivers/gpu/drm/panthor/panthor_device.c > +++ b/drivers/gpu/drm/panthor/panthor_device.c > @@ -461,8 +461,8 @@ int panthor_device_resume(struct device *dev) > drm_dev_enter(&ptdev->base, &cookie)) { > panthor_gpu_resume(ptdev); > panthor_mmu_resume(ptdev); > - ret = drm_WARN_ON(&ptdev->base, panthor_fw_resume(ptdev)); > - if (!ret) { > + ret = panthor_fw_resume(ptdev); > + if (!drm_WARN_ON(&ptdev->base, ret)) { > panthor_sched_resume(ptdev); > } else { > panthor_mmu_suspend(ptdev); > -- > 2.47.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯