From patchwork Thu Apr 25 10:39:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 13643069 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 A58B6C4345F for ; Thu, 25 Apr 2024 10:39:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B60251125F4; Thu, 25 Apr 2024 10:39:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="mIuXjy1M"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7ACA41125F4 for ; Thu, 25 Apr 2024 10:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1714041563; bh=dR9XPovbFN7nxxoojqqE1cq6BYM1IOh0M0c35V4kWiI=; h=From:To:Cc:Subject:Date:From; b=mIuXjy1MXP+BOSqwoBALdEmMFQ12Z2AK6xvmSUbKi+5k7L5DVOZ2qbEDFX2xEeRyO JBZ51xkAzH156tt/RiRhlLDFwrmluCFqThNVZGZcfqr6tJAj49Y3M3IscK6SNlFJ2G w2nPbf2PF499drR9bv2RK2mcG19SzMJlHZbhG3RbMuovOhA0ktvQlDM4/wGLnFUfti KCGlBVKo6HbC3XqP/g1jk4fZ8y27jB8HpeU09sCZxrrBsbVg9B9oZWjxXZMc72ppQ+ khwwAmXkd5DoiNSf66VoF1hy6HirP9ob1BGxp+HTFTs9JgIlv/bKy8/lrbarG5KoMG iDBFZ+QXzSaRg== 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 AA9B9378214C; Thu, 25 Apr 2024 10:39:22 +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] drm/panthor: Kill the faulty_slots variable in panthor_sched_suspend() Date: Thu, 25 Apr 2024 12:39:20 +0200 Message-ID: <20240425103920.826458-1-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.44.0 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" 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: Steven Price Reviewed-by: Liviu Dudau --- 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++) {