From patchwork Wed Dec 11 07:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 13903069 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 072FEE7717D for ; Wed, 11 Dec 2024 07:54:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E85E710E5FD; Wed, 11 Dec 2024 07:54:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="A+4jrFMe"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2E2010E576 for ; Wed, 11 Dec 2024 07:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1733903663; bh=oCfEc8Rp4c1euA6PuGNOBj1L9F+BDOGTGCqU1dbo6oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A+4jrFMeLzulvM0jp6druj/jYamEUBL1RuEp3NlXfotrI4wHLDYqI1QhQOJZ0k015 3nyrNPUdBPFXuYPsLzYqlfIgY05P/9NpNRn0AHdwaBiypSjVuBpryfTqSWyJUk/PzS Iu7HFdiJsJiXzdbSghklYF2YEv06xj67YpvXNjwfyavkYEY1A50EWZmKTLEpLsCOBs BkDMldBEWq+4HkgpD2XBN8STRUKBWf2xZbm1i3p0gs+906aFZoRaXVzuMopoSXUcmn pw+tcLwzpq+3WYQyqWn8xYNY20/WYOvlIa4qpTlnphLXBPm336IKyF3xwDLTkMbhuT Cq9FlT/D+3Bcw== Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:d3ea:1c7:41fd:3038]) (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 07BB417E1437; Wed, 11 Dec 2024 08:54:23 +0100 (CET) From: Boris Brezillon To: Boris Brezillon , Steven Price , Liviu Dudau , =?utf-8?q?Adri=C3=A1n_Larumbe?= Cc: dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v3 1/5] drm/panthor: Preserve the result returned by panthor_fw_resume() Date: Wed, 11 Dec 2024 08:54:15 +0100 Message-ID: <20241211075419.2333731-2-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241211075419.2333731-1-boris.brezillon@collabora.com> References: <20241211075419.2333731-1-boris.brezillon@collabora.com> MIME-Version: 1.0 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" 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 --- 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);