diff options
author | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2018-02-01 12:32:48 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-02 09:19:05 -0500 |
commit | fae919f07610c52ad93915b54c5baeb111c6ea0d (patch) | |
tree | 10d5659fa9558bbd95fd3ebed2d058166fd4376c | |
parent | 99b91bda84060bac061d1649fad0e3bddcf67ce6 (diff) |
drm/i915: Enable inject_load_failure only in DEBUG config
We're using i915_inject_load_failure() to inject dummy
faults during driver load, but since this is debug utility
we shouldn't expose it in default config as it consumes
both code and data.
add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-302 (-302)
Function old new delta
__i915_inject_load_failure 61 - -61
i915_gem_init 1331 1268 -63
i915_driver_load 5923 5745 -178
Total: Before=1177454, After=1177152, chg -0.03%
add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-4 (-4)
Data old new delta
i915_load_fail_count 4 - -4
Total: Before=56762, After=56758, chg -0.01%
add/remove: 4/8 grow/shrink: 0/1 up/down: 245/-591 (-346)
RO Data old new delta
__param_str_inject_load_failure 20 - -20
__UNIQUE_ID_inject_load_failuretype200 34 - -34
__param_inject_load_failure 40 - -40
__func__ 4998 4896 -102
__UNIQUE_ID_inject_load_failure201 150 - -150
Total: Before=119095, After=118749, chg -0.29%
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180201173248.3912-1-michal.wajdeczko@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_params.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 1ec12add34b2..6e7e933fea32 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -55,6 +55,7 @@ | |||
55 | 55 | ||
56 | static struct drm_driver driver; | 56 | static struct drm_driver driver; |
57 | 57 | ||
58 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) | ||
58 | static unsigned int i915_load_fail_count; | 59 | static unsigned int i915_load_fail_count; |
59 | 60 | ||
60 | bool __i915_inject_load_failure(const char *func, int line) | 61 | bool __i915_inject_load_failure(const char *func, int line) |
@@ -70,6 +71,7 @@ bool __i915_inject_load_failure(const char *func, int line) | |||
70 | 71 | ||
71 | return false; | 72 | return false; |
72 | } | 73 | } |
74 | #endif | ||
73 | 75 | ||
74 | #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI" | 76 | #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI" |
75 | #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \ | 77 | #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \ |
@@ -107,8 +109,12 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level, | |||
107 | 109 | ||
108 | static bool i915_error_injected(struct drm_i915_private *dev_priv) | 110 | static bool i915_error_injected(struct drm_i915_private *dev_priv) |
109 | { | 111 | { |
112 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) | ||
110 | return i915_modparams.inject_load_failure && | 113 | return i915_modparams.inject_load_failure && |
111 | i915_load_fail_count == i915_modparams.inject_load_failure; | 114 | i915_load_fail_count == i915_modparams.inject_load_failure; |
115 | #else | ||
116 | return false; | ||
117 | #endif | ||
112 | } | 118 | } |
113 | 119 | ||
114 | #define i915_load_error(dev_priv, fmt, ...) \ | 120 | #define i915_load_error(dev_priv, fmt, ...) \ |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d1d8b1b8de46..5ed220e28402 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -104,9 +104,13 @@ | |||
104 | #define I915_STATE_WARN_ON(x) \ | 104 | #define I915_STATE_WARN_ON(x) \ |
105 | I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")") | 105 | I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")") |
106 | 106 | ||
107 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) | ||
107 | bool __i915_inject_load_failure(const char *func, int line); | 108 | bool __i915_inject_load_failure(const char *func, int line); |
108 | #define i915_inject_load_failure() \ | 109 | #define i915_inject_load_failure() \ |
109 | __i915_inject_load_failure(__func__, __LINE__) | 110 | __i915_inject_load_failure(__func__, __LINE__) |
111 | #else | ||
112 | #define i915_inject_load_failure() false | ||
113 | #endif | ||
110 | 114 | ||
111 | typedef struct { | 115 | typedef struct { |
112 | uint32_t val; | 116 | uint32_t val; |
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index 0b553a8e48fb..08108ce5be21 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c | |||
@@ -167,8 +167,10 @@ i915_param_named_unsafe(huc_firmware_path, charp, 0400, | |||
167 | i915_param_named_unsafe(enable_dp_mst, bool, 0600, | 167 | i915_param_named_unsafe(enable_dp_mst, bool, 0600, |
168 | "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)"); | 168 | "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)"); |
169 | 169 | ||
170 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) | ||
170 | i915_param_named_unsafe(inject_load_failure, uint, 0400, | 171 | i915_param_named_unsafe(inject_load_failure, uint, 0400, |
171 | "Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)"); | 172 | "Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)"); |
173 | #endif | ||
172 | 174 | ||
173 | i915_param_named(enable_dpcd_backlight, bool, 0600, | 175 | i915_param_named(enable_dpcd_backlight, bool, 0600, |
174 | "Enable support for DPCD backlight control (default:false)"); | 176 | "Enable support for DPCD backlight control (default:false)"); |