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 AA32EC54E64 for ; Mon, 25 Mar 2024 15:23:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9615710E965; Mon, 25 Mar 2024 15:23:28 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id A999F10E965 for ; Mon, 25 Mar 2024 15:23:27 +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 B21D32F4; Mon, 25 Mar 2024 08:23:59 -0700 (PDT) Received: from [10.57.15.178] (unknown [10.57.15.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB1863F64C; Mon, 25 Mar 2024 08:23:24 -0700 (PDT) Message-ID: <2656ed39-6d0b-4736-8ab4-584292cff595@arm.com> Date: Mon, 25 Mar 2024 15:23:27 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] drm/panthor: Fix ordering in _irq_suspend() Content-Language: en-GB To: Boris Brezillon , Liviu Dudau , =?UTF-8?Q?Adri=C3=A1n_Larumbe?= Cc: dri-devel@lists.freedesktop.org, kernel@collabora.com References: <20240325135705.3717293-1-boris.brezillon@collabora.com> <20240325135705.3717293-2-boris.brezillon@collabora.com> From: Steven Price In-Reply-To: <20240325135705.3717293-2-boris.brezillon@collabora.com> Content-Type: text/plain; charset=UTF-8 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 25/03/2024 13:57, Boris Brezillon wrote: > 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 Thanks! Steve > --- > 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) \