From patchwork Thu May 2 18:38:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 13651996 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 C45ACC4345F for ; Thu, 2 May 2024 18:38:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B3A3C10E568; Thu, 2 May 2024 18:38:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="1C5nXEsv"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 90A0910E4AA for ; Thu, 2 May 2024 18:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1714675095; bh=+yKrjAoFR0ey+PUMGTIB/BwwYgMq3orWeBl7Y1bmT7g=; h=From:To:Cc:Subject:Date:From; b=1C5nXEsv2I9MD4xxiGaqyge57WxtL9GlmBTpX9iGIHDlMpuF7sz+WTbMEO24g1BQJ IKzhpz5jN5yxGByHZDGNbqfzvQGMM2rjTPUa6jK8iloczC2L/N4Dl5J538ftiZzBdg 3yDjdEr98lQhzJL8jTtEGjiMd+dlmPjYT1EbYpO7ccZd4O5E5MY6l2oAmvAaWvjNXT 813IuTeDOQvTtuoN6Mgp6kTcKSH/NLff1Am1zd6kjslHakl6aHCFuHmOC7OwcXFYUL sPj31rCSmh27EcpT43vWLI7WyLFis4IEMHrh4NsWU7dGq5HxpZhunmjsT9aOJ+b6vy bPRwMv2jP16cQ== 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 AB15637809D1; Thu, 2 May 2024 18:38:14 +0000 (UTC) From: Boris Brezillon To: Boris Brezillon , Steven Price , Liviu Dudau , =?utf-8?q?Adri=C3=A1n_Larumbe?= Cc: Christopher Healy , dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH 0/4] drm/panthor: More reset fixes Date: Thu, 2 May 2024 20:38:08 +0200 Message-ID: <20240502183813.1612017-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" Hello, This is a collection of fixes for bugs found while chasing an unrecoverable fault leading to a device unplug (because of some other bugs that was introduced in my local dev branch). The first patch makes sure we immediately reset the GPU on an unrecoverable fault, and following patches are fixing various NULL/invalid pointer derefs caused by use-after-free situations following a device unplug. Regards, Boris Boris Brezillon (4): drm/panthor: Force an immediate reset on unrecoverable faults drm/panthor: Keep a ref to the VM at the panthor_kernel_bo level drm/panthor: Reset the FW VM to NULL on unplug drm/panthor: Call panthor_sched_post_reset() even if the reset failed drivers/gpu/drm/panthor/panthor_device.c | 8 ++--- drivers/gpu/drm/panthor/panthor_device.h | 1 + drivers/gpu/drm/panthor/panthor_fw.c | 5 +-- drivers/gpu/drm/panthor/panthor_gem.c | 8 +++-- drivers/gpu/drm/panthor/panthor_gem.h | 8 +++-- drivers/gpu/drm/panthor/panthor_heap.c | 8 ++--- drivers/gpu/drm/panthor/panthor_sched.c | 40 +++++++++++++++++------- drivers/gpu/drm/panthor/panthor_sched.h | 2 +- 8 files changed, 51 insertions(+), 29 deletions(-)