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 A6C71C4345F for ; Fri, 26 Apr 2024 11:56:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8F6D1122F1; Fri, 26 Apr 2024 11:56:25 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 847EE1122F1 for ; Fri, 26 Apr 2024 11:56:24 +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 9C9D21007 for ; Fri, 26 Apr 2024 04:56:51 -0700 (PDT) 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 4110A3F793 for ; Fri, 26 Apr 2024 04:56:23 -0700 (PDT) Date: Fri, 26 Apr 2024 12:56:19 +0100 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] drm/panthor: Kill the faulty_slots variable in panthor_sched_suspend() Message-ID: References: <20240425103920.826458-1-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: <20240425103920.826458-1-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 Thu, Apr 25, 2024 at 12:39:20PM +0200, Boris Brezillon wrote: > We can use upd_ctx.timedout_mask directly, and the faulty_slots update > in the flush_caches_failed situation is never used. > > Suggested-by: Suggested-by: Steven Price > Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_sched.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index fad4678ca4c8..fed28c16d5d1 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -2584,8 +2584,8 @@ void panthor_sched_suspend(struct panthor_device *ptdev) > { > struct panthor_scheduler *sched = ptdev->scheduler; > struct panthor_csg_slots_upd_ctx upd_ctx; > - u32 suspended_slots, faulty_slots; > struct panthor_group *group; > + u32 suspended_slots; > u32 i; > > mutex_lock(&sched->lock); > @@ -2605,10 +2605,9 @@ void panthor_sched_suspend(struct panthor_device *ptdev) > > csgs_upd_ctx_apply_locked(ptdev, &upd_ctx); > suspended_slots &= ~upd_ctx.timedout_mask; > - faulty_slots = upd_ctx.timedout_mask; > > - if (faulty_slots) { > - u32 slot_mask = faulty_slots; > + if (upd_ctx.timedout_mask) { > + u32 slot_mask = upd_ctx.timedout_mask; > > drm_err(&ptdev->base, "CSG suspend failed, escalating to termination"); > csgs_upd_ctx_init(&upd_ctx); > @@ -2659,9 +2658,6 @@ void panthor_sched_suspend(struct panthor_device *ptdev) > > slot_mask &= ~BIT(csg_id); > } > - > - if (flush_caches_failed) > - faulty_slots |= suspended_slots; > } > > for (i = 0; i < sched->csg_slot_count; i++) { > -- > 2.44.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯