From mboxrd@z Thu Jan 1 00:00:00 1970 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 279B8F428EC for ; Wed, 15 Apr 2026 21:04:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABD7410E751; Wed, 15 Apr 2026 21:04:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QNelsroR"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id C07D010E758; Wed, 15 Apr 2026 21:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776287060; x=1807823060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SfOJmDFmBqf6eFlgOr/J4Qg1nnKIVNhHmeBnEziUops=; b=QNelsroREQF2dzeZSElfp4TfuAcui4pDUs1cXxxUmVmT6yYpWxO/qfMm RFX3NJZAHbuexM/OZFkXicPvPOz3AqpaNsHEkcHixmZ/Ut2fSZc2NDnMc IUSo5e9F1kgb1g1GRWU6C0TD+ksFjS6Bn8NXOPoiyInoHqr8xfQYZpScP V+EEedBX77RyjTBjizmmjzeh1Rs1bkp51UNYXPNHTRZN4oyi+cWTf3Ke0 XGXXY2apjerbYscBN4VO10DZDS5y57LAlx3g+v7AE41SSCtvcxc2raP6d 9nXEZggIv24zWiaV3Bry6nYlF4Qp0FlU6hqNxwc2vSHbY2fJOT1v9kMoW A==; X-CSE-ConnectionGUID: OB6FX7bfSA+ZAFKC9u93iw== X-CSE-MsgGUID: bZ9fCiDxTSa8V+6R6z1z3Q== X-IronPort-AV: E=McAfee;i="6800,10657,11760"; a="81158070" X-IronPort-AV: E=Sophos;i="6.23,181,1770624000"; d="scan'208";a="81158070" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2026 14:04:20 -0700 X-CSE-ConnectionGUID: 8cAZ1lm4ScOZG95t1jIbqw== X-CSE-MsgGUID: cMjTJwrGRlOEp9LN7q/tAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,181,1770624000"; d="scan'208";a="225830438" Received: from abityuts-desk.ger.corp.intel.com (HELO localhost) ([10.245.244.108]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2026 14:04:19 -0700 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Cc: intel-xe@lists.freedesktop.org, Jani Nikula , =?UTF-8?q?Jouni=20H=C3=B6gander?= , Maarten Lankhorst Subject: [PATCH v3 1/7] drm/i915: Clear i915->display when no longer valid Date: Thu, 16 Apr 2026 00:04:05 +0300 Message-ID: <20260415210411.24750-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260415210411.24750-1-ville.syrjala@linux.intel.com> References: <20260415210411.24750-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" From: Ville Syrjälä Don't leave a stale i915->display pointer hanging around after the display driver has been torn down. Apparently the gt code calls into the reset codepaths after this, and if the display pointer is still around we may try to access freed memory. The whole teardown sequence here seems rather suspect. Why is display done first and then everything else via the managed release? Who the heck knows. Someone really needs to dig into this stuff and figure out the proper init/cleanup sequence for both i915 (real and mock) and xe... Cc: Jani Nikula Cc: Jouni Högander Cc: Maarten Lankhorst Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_driver.c | 1 + drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 195e34acef30..d31819758f3d 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -310,6 +310,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv) i915_params_free(&dev_priv->params); intel_display_device_remove(display); + dev_priv->display = NULL; } /** diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index 27dc0e40a8d7..796c9b070e41 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -277,6 +277,7 @@ void mock_destroy_device(struct drm_i915_private *i915) struct device *dev = i915->drm.dev; intel_display_device_remove(i915->display); + i915->display = NULL; devres_release_group(dev, NULL); put_device(dev); -- 2.52.0