From patchwork Tue Aug 13 12:12:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 818899 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9995D199252; Tue, 13 Aug 2024 12:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723551179; cv=none; b=JI0bhygez137SaQV96/p00RyRmQIxJkqpzUUW86zp42lcNXmLIqeKSOlUrTWpOXeAL6g3nsqd/PSaNqc9CvJOae10cJ4YlsLBvrmpkixojPXo12Ly/8JnNw/vNPHl6Hij7CADZ3bKcC5EEwu0QEycWUQkXLPgF1EWZvZtqj8YQo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723551179; c=relaxed/simple; bh=2lZuZVFeOiclAWcSJwOscUKhucFNwAH+bKElI+hlcyc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=W1ZX5CuYODYHuRsslZBA2yn+t1GCyGMzfjjEiRKQ+9JRr/9QVJxPLic8uNLX3yYeVN3J0pfXgOsjI1/7DMuHvOzR8Q7HbXnOwUMafXuUNWxeStKc3w7gSS9Rio3J5XWTpqdj7wWJSNB3rVwOS47KIOkl91imXVcV5tEpLm3DdBI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PZaeDJ4B; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PZaeDJ4B" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723551178; x=1755087178; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2lZuZVFeOiclAWcSJwOscUKhucFNwAH+bKElI+hlcyc=; b=PZaeDJ4Bp6ovs1TGgzRxCbEjxYO3MET2FY1kP+r/EzJ+Jt14GjJzq6TH Lt7y+WkqkcmafO9ZKl6cwzR38ya/fzz+V97chzOxCd/Wh8vH9qzp8xVPm BxyACvA7Z1bZnnNnINTfOvt0HtA1ModPCpq9MkXrwbN1NTdDWnacskYm5 KTXupd45f5y2dvHvgTCC5/o16i8L1pcESnCXNUhhAxg6B8pB/oTW8T5By DPfUtHjtGva5iWfltSwUt0gkf+V5jRWLiuXy4/xgdVrZtLaqmS2+66itu o8iRrE9zP5WC5v9xs8QvoWXXK0p9ExNJ3s3C6mKdNTR6PoyoZYpIIowwO w==; X-CSE-ConnectionGUID: UwSHldUgTyel1WJHo+ilQA== X-CSE-MsgGUID: 3bi54RYoTsOu8ALS3Zxl9A== X-IronPort-AV: E=McAfee;i="6700,10204,11162"; a="21682583" X-IronPort-AV: E=Sophos;i="6.09,285,1716274800"; d="scan'208";a="21682583" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2024 05:12:57 -0700 X-CSE-ConnectionGUID: bY9oRFrmQqqvfHNNywmgKw== X-CSE-MsgGUID: /ax/e25sT9C32TZD7ytYqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,285,1716274800"; d="scan'208";a="89450926" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.246.234]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2024 05:12:51 -0700 From: Jani Nikula To: linux-kernel@vger.kernel.org Cc: intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, akinobu.mita@gmail.com, akpm@linux-foundation.org, lucas.demarchi@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, robdclark@gmail.com, quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org, jani.nikula@intel.com Subject: [PATCH 1/3] fault-inject: improve build for CONFIG_FAULT_INJECTION=n Date: Tue, 13 Aug 2024 15:12:35 +0300 Message-Id: <20240813121237.2382534-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo The fault-inject.h users across the kernel need to add a lot of #ifdef CONFIG_FAULT_INJECTION to cater for shortcomings in the header. Make fault-inject.h self-contained for CONFIG_FAULT_INJECTION=n, and add stubs for DECLARE_FAULT_ATTR(), setup_fault_attr(), should_fail_ex(), and should_fail() to allow removal of conditional compilation. Cc: Akinobu Mita Cc: Andrew Morton Signed-off-by: Jani Nikula Reviewed-by: Abhinav Kumar --- include/linux/fault-inject.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h index 354413950d34..8c829d28dcf3 100644 --- a/include/linux/fault-inject.h +++ b/include/linux/fault-inject.h @@ -2,13 +2,17 @@ #ifndef _LINUX_FAULT_INJECT_H #define _LINUX_FAULT_INJECT_H +#include +#include + +struct dentry; +struct kmem_cache; + #ifdef CONFIG_FAULT_INJECTION -#include -#include +#include #include #include -#include /* * For explanation of the elements of this struct, see @@ -51,6 +55,28 @@ int setup_fault_attr(struct fault_attr *attr, char *str); bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags); bool should_fail(struct fault_attr *attr, ssize_t size); +#else /* CONFIG_FAULT_INJECTION */ + +struct fault_attr { +}; + +#define DECLARE_FAULT_ATTR(name) struct fault_attr name = {} + +static inline int setup_fault_attr(struct fault_attr *attr, char *str) +{ + return 0; /* Note: 0 means error for __setup() handlers! */ +} +static inline bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags) +{ + return false; +} +static inline bool should_fail(struct fault_attr *attr, ssize_t size) +{ + return false; +} + +#endif /* CONFIG_FAULT_INJECTION */ + #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS struct dentry *fault_create_debugfs_attr(const char *name, @@ -87,10 +113,6 @@ static inline void fault_config_init(struct fault_config *config, #endif /* CONFIG_FAULT_INJECTION_CONFIGFS */ -#endif /* CONFIG_FAULT_INJECTION */ - -struct kmem_cache; - #ifdef CONFIG_FAIL_PAGE_ALLOC bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order); #else From patchwork Tue Aug 13 12:12:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 819540 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0D4A199230; Tue, 13 Aug 2024 12:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723551187; cv=none; b=M5RI0TObwUdoWtUGDWeAXuM4te6IB76e15j8EA+K/zgJhOQ5kiutxFRrSWyf13+7jTgcL6yb3i896FGGbwHcozsZ+9SS0+WBUxlji0jSPEkt5ecvvECIYflUlkagLuR3LaznW5bdR0QJ/99OJ8y92Vw/+7BVYELiOEaFtY//nYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723551187; c=relaxed/simple; bh=e7aAkUAOvQI0AJNRk7wUAPuWDxjmt0yF+bVjRvPT56Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F0tNB5xyhhkXNzPvLJiVd+zehaazGiRO76XNW61XgiWEJiqrHthmG2qFT55G13ziKCbCQ55+cYkJp1dvRd5mex8rDHfqY4KCvfg/VgtYvcyfZxIDX76lr6iENQ6QZ+F1gvCRoS9bBZ4hE+x/2CBKFgafL09m5YyY4LYPK+kIsrg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LYaRD188; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LYaRD188" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723551186; x=1755087186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e7aAkUAOvQI0AJNRk7wUAPuWDxjmt0yF+bVjRvPT56Y=; b=LYaRD188klC/n+CnpHyXLl20hv0kP1xJzlN9FKsDBnVNgVnlU8uSYDmI P0vhRSxDVWMkJUYuNJv1lfBF8ro7MPforniY/Qr/2FTf7Vqo8NosUQThF EH/hwQfSjGg7VnK2BecSUCIVpigKzslYQNxaSkgvFlxvenFlsevh/3zqM PB59kSK48gi+wBQMjryGlhyB6RfL/1bDjd6Wfw4UK6c2+peX/txrSV16+ O+GtUkGpKNdZGJuVQuB+MoykDBFP1v6Xrievf3rVHt50X+iZt+eY+brpm OzNm/1+TlaKMRnQdG0oCp/KMKpJlWCtGaPTZLI7yCNjmHvkHDOSoQQzVL g==; X-CSE-ConnectionGUID: 6s22v9DMRwqI6qUuHm8V/g== X-CSE-MsgGUID: tbgyPD5nQ3edK5m6eCs53Q== X-IronPort-AV: E=McAfee;i="6700,10204,11162"; a="21682655" X-IronPort-AV: E=Sophos;i="6.09,285,1716274800"; d="scan'208";a="21682655" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2024 05:13:05 -0700 X-CSE-ConnectionGUID: +U7NRZz+RJCuoKL1wc8Auw== X-CSE-MsgGUID: DeUeRhHlR4m/2bjsj/r5vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,285,1716274800"; d="scan'208";a="89450958" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.246.234]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2024 05:12:59 -0700 From: Jani Nikula To: linux-kernel@vger.kernel.org Cc: intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, akinobu.mita@gmail.com, akpm@linux-foundation.org, lucas.demarchi@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, robdclark@gmail.com, quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org, jani.nikula@intel.com Subject: [PATCH 2/3] drm/msm: clean up fault injection usage Date: Tue, 13 Aug 2024 15:12:36 +0300 Message-Id: <20240813121237.2382534-2-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813121237.2382534-1-jani.nikula@intel.com> References: <20240813121237.2382534-1-jani.nikula@intel.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo With the proper stubs in place in linux/fault-inject.h, we can remove a bunch of conditional compilation for CONFIG_FAULT_INJECTION=n. Cc: Andrew Morton Cc: Akinobu Mita Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Signed-off-by: Jani Nikula --- drivers/gpu/drm/msm/msm_debugfs.c | 2 -- drivers/gpu/drm/msm/msm_drv.c | 2 -- drivers/gpu/drm/msm/msm_drv.h | 4 ---- 3 files changed, 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index 4494f6d1c7cb..7ab607252d18 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -357,12 +357,10 @@ void msm_debugfs_init(struct drm_minor *minor) if (priv->kms && priv->kms->funcs->debugfs_init) priv->kms->funcs->debugfs_init(priv->kms, minor); -#ifdef CONFIG_FAULT_INJECTION fault_create_debugfs_attr("fail_gem_alloc", minor->debugfs_root, &fail_gem_alloc); fault_create_debugfs_attr("fail_gem_iova", minor->debugfs_root, &fail_gem_iova); -#endif } #endif diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 9c33f4e3f822..6938410f4fc7 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -58,10 +58,8 @@ static bool modeset = true; MODULE_PARM_DESC(modeset, "Use kernel modesetting [KMS] (1=on (default), 0=disable)"); module_param(modeset, bool, 0600); -#ifdef CONFIG_FAULT_INJECTION DECLARE_FAULT_ATTR(fail_gem_alloc); DECLARE_FAULT_ATTR(fail_gem_iova); -#endif static int msm_drm_uninit(struct device *dev) { diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index be016d7b4ef1..9b953860131b 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -33,12 +33,8 @@ #include #include -#ifdef CONFIG_FAULT_INJECTION extern struct fault_attr fail_gem_alloc; extern struct fault_attr fail_gem_iova; -#else -# define should_fail(attr, size) 0 -#endif struct msm_kms; struct msm_gpu; From patchwork Tue Aug 13 12:12:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 818898 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C87BE187348; Tue, 13 Aug 2024 12:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723551206; cv=none; b=Qj/69f98U9RjbYQK82FlnQNJcMNI00RvV7RJaV24fImGgedbgsrZPmmd0ZGHO9IEhMIH8aB/OK7UcdSVgx1p0oH1K5uTrQPNlR4dNbNGT+5xmGdjxliR3rlXbfcX50xXH8oIOuRyagM3SUoYwPCS0V9+t4tDZy+YPx/9uL8+MOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723551206; c=relaxed/simple; bh=kIIgzNfbPPOeGVzqpET5xjIMVCHKwtwP40zzL2GwutI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=dF+tCBvyuff26GQS6bMn26AKu0pzZ2ZjUiv3qYRU61CNl22SFiTbzMlL3ZYB4+fwFNlz3TF0Z5q9TFQJvpUzFfAoOGe7bGt9oH8QWnljsd1B//gY4Bb89H+KVbnfoN0lereQVJ340UiW8TkHYfL5aHdM/fEehEQhLli/QNjDc9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HTWuLgt2; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HTWuLgt2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723551205; x=1755087205; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kIIgzNfbPPOeGVzqpET5xjIMVCHKwtwP40zzL2GwutI=; b=HTWuLgt21CuvWjQwidL5CnOOcinycqDcZyetg2rujCp91JIGH0XL80oh DzGAWtMuDpho9yNVkB6JeU5DR54pxlKqRl2gwfovdRoImfXdOE/YxpFNB z/EghsvcFzpbML5ZYjeZ61ws/CgZFUlPLBMcIBnYVYPMQImq61PD8fuA7 aCmEzxlAi9fyINOL1S3sWqXpm3qvlzoJyjJdCnp+dayk2nYp3/dVkZTN3 U+uG8mi3c84ig46X2UYvummQP6I3u/fV7dxuHZcKnQ5MDzlCSqrfPRWXN 5OaqUsTJfWYxEwk388nd3d3JwAxs0lgDHEoiBydte+LnPjVcpJcH0tZC9 A==; X-CSE-ConnectionGUID: 44w/EPhDQQSnLNF3gBH7cg== X-CSE-MsgGUID: EgZrJX2+TwieVJrV5ES0xA== X-IronPort-AV: E=McAfee;i="6700,10204,11162"; a="21682779" X-IronPort-AV: E=Sophos;i="6.09,285,1716274800"; d="scan'208";a="21682779" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2024 05:13:12 -0700 X-CSE-ConnectionGUID: lGY95YNjTQ+6J6x1sGUetw== X-CSE-MsgGUID: rQdXfg7pS2OG+6k4DkMosw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,285,1716274800"; d="scan'208";a="89451014" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.246.234]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2024 05:13:07 -0700 From: Jani Nikula To: linux-kernel@vger.kernel.org Cc: intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, akinobu.mita@gmail.com, akpm@linux-foundation.org, lucas.demarchi@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, robdclark@gmail.com, quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org, jani.nikula@intel.com Subject: [PATCH 3/3] drm/xe: clean up fault injection usage Date: Tue, 13 Aug 2024 15:12:37 +0300 Message-Id: <20240813121237.2382534-3-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813121237.2382534-1-jani.nikula@intel.com> References: <20240813121237.2382534-1-jani.nikula@intel.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo With the proper stubs in place in linux/fault-inject.h, we can remove a bunch of conditional compilation for CONFIG_FAULT_INJECTION=n. Cc: Andrew Morton Cc: Akinobu Mita Cc: Lucas De Marchi Cc: Thomas Hellström Cc: Rodrigo Vivi Signed-off-by: Jani Nikula Reviewed-by: Himal Prasad Ghimiray --- drivers/gpu/drm/xe/xe_debugfs.c | 7 +------ drivers/gpu/drm/xe/xe_gt.h | 10 ++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c index 1011e5d281fa..b381bfb634f7 100644 --- a/drivers/gpu/drm/xe/xe_debugfs.c +++ b/drivers/gpu/drm/xe/xe_debugfs.c @@ -6,6 +6,7 @@ #include "xe_debugfs.h" #include +#include #include #include @@ -26,10 +27,7 @@ #include "xe_vm.h" #endif -#ifdef CONFIG_FAULT_INJECTION -#include /* XXX: fault-inject.h is broken */ DECLARE_FAULT_ATTR(gt_reset_failure); -#endif static struct xe_device *node_to_xe(struct drm_info_node *node) { @@ -214,8 +212,5 @@ void xe_debugfs_register(struct xe_device *xe) for_each_gt(gt, xe, id) xe_gt_debugfs_register(gt); -#ifdef CONFIG_FAULT_INJECTION fault_create_debugfs_attr("fail_gt_reset", root, >_reset_failure); -#endif - } diff --git a/drivers/gpu/drm/xe/xe_gt.h b/drivers/gpu/drm/xe/xe_gt.h index 8b1a5027dcf2..ee138e9768a2 100644 --- a/drivers/gpu/drm/xe/xe_gt.h +++ b/drivers/gpu/drm/xe/xe_gt.h @@ -6,6 +6,8 @@ #ifndef _XE_GT_H_ #define _XE_GT_H_ +#include + #include #include "xe_device.h" @@ -19,19 +21,11 @@ #define CCS_MASK(gt) (((gt)->info.engine_mask & XE_HW_ENGINE_CCS_MASK) >> XE_HW_ENGINE_CCS0) -#ifdef CONFIG_FAULT_INJECTION -#include /* XXX: fault-inject.h is broken */ extern struct fault_attr gt_reset_failure; static inline bool xe_fault_inject_gt_reset(void) { return should_fail(>_reset_failure, 1); } -#else -static inline bool xe_fault_inject_gt_reset(void) -{ - return false; -} -#endif struct xe_gt *xe_gt_alloc(struct xe_tile *tile); int xe_gt_init_hwconfig(struct xe_gt *gt);