From patchwork Mon Mar 25 13:57:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 13602263 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 6F040C54E64 for ; Mon, 25 Mar 2024 13:57:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91DD010E8E5; Mon, 25 Mar 2024 13:57:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="b8t30tkm"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C3F610E8E6 for ; Mon, 25 Mar 2024 13:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1711375028; bh=BodyKJPHcWaeZPPO56bFdnevyhdLCtg8RsbyXp7HY+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b8t30tkmX1pDN33mNn7m0LGBY0CtTNfI62TwedAq2v/z8xnrQX8MkBWC96F1Qt0PJ 1+sq/hB1LCLebznDOZO5HhjWF3K72sE55TYs6Qb95rsZ3x7G8sZtpLAWI6wJdAD3gS SJcifKNJX3CKJSN6j2BJkMTzriYM3SgwJHniqavTXjayOCvVE35BrktahcRHxF956H 0EkjN3ZwSsLywv+jkURg4M8J2gddYZDMpo6M8iDyX/hgXkVKgeNXFeMnkLZ51jF91J FPRys5EcaZOYlSa+rjJFgQG4iXsQnHj+p3wGZFTVUldPBFo6Te66gR8XS8Xr49HATZ ZID3y6dH5HoSQ== Received: from localhost.localdomain (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 88058378209A; Mon, 25 Mar 2024 13:57:07 +0000 (UTC) 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 v2 2/3] drm/panthor: Fix ordering in _irq_suspend() Date: Mon, 25 Mar 2024 14:57:04 +0100 Message-ID: <20240325135705.3717293-2-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240325135705.3717293-1-boris.brezillon@collabora.com> References: <20240325135705.3717293-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" Make sure we set suspended=true last to avoid generating an irq storm in the unlikely case where an IRQ happens between the suspended=true assignment and the _INT_MASK update. v2: - New patch Reported-by: Steven Price Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panthor/panthor_device.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h index 7ee4987a3796..3a930a368ae1 100644 --- a/drivers/gpu/drm/panthor/panthor_device.h +++ b/drivers/gpu/drm/panthor/panthor_device.h @@ -325,7 +325,7 @@ static inline void panthor_ ## __name ## _irq_suspend(struct panthor_irq *pirq) { \ int cookie; \ \ - atomic_set(&pirq->suspended, true); \ + pirq->mask = 0; \ \ if (drm_dev_enter(&pirq->ptdev->base, &cookie)) { \ gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0); \ @@ -333,7 +333,7 @@ static inline void panthor_ ## __name ## _irq_suspend(struct panthor_irq *pirq) drm_dev_exit(cookie); \ } \ \ - pirq->mask = 0; \ + atomic_set(&pirq->suspended, true); \ } \ \ static inline void panthor_ ## __name ## _irq_resume(struct panthor_irq *pirq, u32 mask) \