Skip to contentSkip to conversation

drm/i915: Add option to list load failure checkpoints

PATCH In review Michal Wajdeczko 3 participants 8 messages Jan 31, 2018 – Feb 1, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Add option to list load failure checkpoints

Our inject_load_failure functionality allows to insert one failure during driver load, but it is hard to guess which number should passed as modparam to select specific checkpoint.

Use negative number as option to list all available failure checkpoints without triggering any failure.

---
 drivers/gpu/drm/i915/i915_drv.c    | 18 +++++++++++-------
 drivers/gpu/drm/i915/i915_params.c |  6 ++++--
 drivers/gpu/drm/i915/i915_params.h |  2 +-
 3 files changed, 16 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +11 -7
index 1ec12ad..0992301 100644
@@ -55,16 +55,21 @@
 
 static struct drm_driver driver;
 
-static unsigned int i915_load_fail_count;
+static int i915_load_fail_count = 0;
 
 bool __i915_inject_load_failure(const char *func, int line)
 {
-	if (i915_load_fail_count >= i915_modparams.inject_load_failure)
+	++i915_load_fail_count;
+
+	if (unlikely(i915_modparams.inject_load_failure < 0)) {
+		DRM_NOTE("[i915] load checkpoint %d [%s:%d]\n",
+			 i915_load_fail_count, func, line);
 		return false;
+	}
 
-	if (++i915_load_fail_count == i915_modparams.inject_load_failure) {
-		DRM_INFO("Injecting failure at checkpoint %u [%s:%d]\n",
-			 i915_modparams.inject_load_failure, func, line);
+	if (i915_modparams.inject_load_failure == i915_load_fail_count) {
+		DRM_INFO("Injecting failure at checkpoint %d [%s:%d]\n",
+			 i915_load_fail_count, func, line);
 		return true;
 	}
 
@@ -107,8 +112,7 @@ bool __i915_inject_load_failure(const char *func, int line)
 
 static bool i915_error_injected(struct drm_i915_private *dev_priv)
 {
-	return i915_modparams.inject_load_failure &&
-	       i915_load_fail_count == i915_modparams.inject_load_failure;
+	return i915_modparams.inject_load_failure >= i915_load_fail_count;
 }
 
 #define i915_load_error(dev_priv, fmt, ...)				     \
drivers/gpu/drm/i915/i915_params.c +4 -2
index 0b553a8..e5ab69c 100644
@@ -167,8 +167,10 @@ struct i915_params i915_modparams __read_mostly = {
 i915_param_named_unsafe(enable_dp_mst, bool, 0600,
 	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
 
-i915_param_named_unsafe(inject_load_failure, uint, 0400,
-	"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
+i915_param_named_unsafe(inject_load_failure, int, 0400,
+	"Force an error after a number of failure check points. "
+	"(-1=list check points, 0=disabled [default], "
+	"N=force failure at the Nth failure check point)");
 
 i915_param_named(enable_dpcd_backlight, bool, 0600,
 	"Enable support for DPCD backlight control (default:false)");
drivers/gpu/drm/i915/i915_params.h +1 -1
index 430f5f9..6ed799f 100644
@@ -54,7 +54,7 @@
 	param(int, mmio_debug, 0) \
 	param(int, edp_vswing, 0) \
 	param(int, reset, 2) \
-	param(unsigned int, inject_load_failure, 0) \
+	param(int, inject_load_failure, 0) \
 	/* leave bools at the end to not create holes */ \
 	param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
 	param(bool, enable_cmd_parser, true) \
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: Add option to list load failure checkpoints

== Series Details ==

== Series Details ==

Series: drm/i915: Add option to list load failure checkpoints
URL : https://patchwork.freedesktop.org/series/37427/
State : success

== Summary ==

Series 37427v1 drm/i915: Add option to list load failure checkpoints
https://patchwork.freedesktop.org/api/1.0/series/37427/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test kms_chamelium:
        Subgroup common-hpd-after-suspend:
                dmesg-warn -> PASS       (fi-skl-6700k2) fdo#104108
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:421s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:430s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:369s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:483s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:461s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:457s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:570s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:180  dwarn:0   dfail:0   fail:0   skip:108 time:277s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:511s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:389s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:398s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:454s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:411s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:455s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:492s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:450s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:499s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:571s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:509s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:525s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:491s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:475s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:410s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:430s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:520s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:395s

Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:465s

ae93f9b9acf3e9cdbb2be1b68a97c3cc6db66fad drm-tip: 2018y-01m-31d-16h-31m-38s UTC integration manifest 879ec7a733e0 drm/i915: Add option to list load failure checkpoints

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7842/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.IGT: failure for drm/i915: Add option to list load failure checkpoints

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: drm/i915: Add option to list load failure checkpoints
URL : https://patchwork.freedesktop.org/series/37427/
State : failure

== Summary ==

Test kms_flip:

        Subgroup wf_vblank-ts-check-interruptible:
                fail       -> PASS       (shard-apl) fdo#100368 +3
        Subgroup basic-plain-flip:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-panning-vs-hang:
                pass       -> DMESG-WARN (shard-snb) fdo#103821
Test kms_plane_multiple:
        Subgroup legacy-pipe-c-tiling-none:
                pass       -> FAIL       (shard-apl)
        Subgroup legacy-pipe-a-tiling-x:
                skip       -> PASS       (shard-apl)
        Subgroup atomic-pipe-b-tiling-yf:
                fail       -> PASS       (shard-apl)
Test kms_vblank:
        Subgroup pipe-c-ts-continuation-suspend:
                dmesg-warn -> PASS       (shard-apl)
        Subgroup pipe-a-query-busy:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-b-accuracy-idle:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-wait-forked-busy:
                skip       -> PASS       (shard-apl)
        Subgroup crtc-id:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-b-ts-continuation-dpms-suspend:
                pass       -> DMESG-WARN (shard-snb)
Test kms_draw_crc:
        Subgroup draw-method-xrgb8888-render-untiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb2101010-render-xtiled:
                skip       -> PASS       (shard-apl)
Test kms_color:
        Subgroup pipe-a-ctm-0-75:
                skip       -> PASS       (shard-apl)
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-spr-indfb-draw-render:
                skip       -> PASS       (shard-apl) fdo#103167 +1
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-blt:
                skip       -> PASS       (shard-apl) fdo#101623 +2
        Subgroup fbc-rgb101010-draw-mmap-gtt:
                skip       -> PASS       (shard-apl)
Test kms_cursor_crc:
        Subgroup cursor-256x256-rapid-movement:
                skip       -> PASS       (shard-apl) fdo#103326
        Subgroup cursor-256x256-dpms:
                skip       -> PASS       (shard-apl)
        Subgroup cursor-128x42-random:
                skip       -> PASS       (shard-apl)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                skip       -> PASS       (shard-apl) fdo#103481
        Subgroup read-crc-pipe-c:
                skip       -> PASS       (shard-apl) fdo#103191
        Subgroup read-crc-pipe-a:
                skip       -> PASS       (shard-apl)
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-c:
                skip       -> PASS       (shard-apl)
        Subgroup extended-modeset-hang-oldfb-with-reset-render-c:
                skip       -> PASS       (shard-apl) fdo#103336
Test kms_plane_scaling:
        Subgroup pipe-c-plane-scaling:
                skip       -> PASS       (shard-apl)
Test kms_rotation_crc:
        Subgroup primary-rotation-90-y-tiled:
                skip       -> PASS       (shard-apl)
Test kms_cursor_legacy:
        Subgroup basic-flip-after-cursor-varying-size:
                skip       -> PASS       (shard-apl) fdo#102670
        Subgroup cursora-vs-flipa-atomic:
                skip       -> PASS       (shard-apl)
Test kms_chv_cursor_fail:
        Subgroup pipe-a-128x128-bottom-edge:
                skip       -> PASS       (shard-apl)
Test kms_rmfb:
        Subgroup rmfb-ioctl:
                skip       -> PASS       (shard-apl)
Test kms_ccs:
        Subgroup pipe-b-bad-pixel-format:
                skip       -> PASS       (shard-apl)
Test perf:
        Subgroup oa-exponents:
                fail       -> PASS       (shard-apl) fdo#102254
Test gem_eio:
        Subgroup in-flight-suspend:
                pass       -> FAIL       (shard-hsw) fdo#104676
Test kms_sysfs_edid_timing:
                warn       -> PASS       (shard-apl) fdo#100047

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103326 https://bugs.freedesktop.org/show_bug.cgi?id=103326
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103336 https://bugs.freedesktop.org/show_bug.cgi?id=103336
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-apl        total:2838 pass:1750 dwarn:1   dfail:0   fail:23  skip:1064 time:12621s
shard-hsw        total:2838 pass:1730 dwarn:1   dfail:0   fail:16  skip:1090 time:11872s
shard-snb        total:2838 pass:1328 dwarn:3   dfail:0   fail:10  skip:1497 time:6575s

Blacklisted hosts:
shard-kbl total:2838 pass:1872 dwarn:1 dfail:0 fail:22 skip:943 time:9605s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7842/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Michal Wajdeczko

Quoting Michal Wajdeczko (2018-01-31 18:23:47)

Quoted 6 lines

Our inject_load_failure functionality allows to insert one failure during driver load, but it is hard to guess which number should passed as modparam to select specific checkpoint.

Use negative number as option to list all available failure checkpoints without triggering any failure.

Hmm, it was only intended for use with the coupled igt test. Mind expanding upon the use case you have? Could you not use that iterative search for finding the injection value you want for repeated runs? For the bisect case, do you not want to keep it iterating over all in case the value changes? How stable do you want the modparam? -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 5 lines · Chris Wilson

Quoting Michal Wajdeczko (2018-01-31 18:23:47)

Quoted 4 lines

Our inject_load_failure functionality allows to insert one failure during driver load, but it is hard to guess which number should passed as modparam to select specific checkpoint.

Quoted 8 lines
Quoted 2 lines

Use negative number as option to list all available failure checkpoints without triggering any failure.

Hmm, it was only intended for use with the coupled igt test. Mind expanding upon the use case you have? Could you not use that iterative search for finding the injection value you want for repeated runs? For the bisect case, do you not want to keep it iterating over all in case the value changes? How stable do you want the modparam?

Iterative approach is good for validation team to verify that all existing failure points are correctly handled (ie. we don't cause crash/panic), but it is less useful when you are interested in adding new checkpoints just for your code, as it requires both time and luck as you may be hit by earlier checkpoint that no longer works ;)

Btw, IMHO this modparam should only be exposed in DEBUG config (as it introduces some code and text), and maybe we should also consider extending it to support more than one failure (as then it will be easy to check several code paths (like failure in fallback)

This patch was trying to keep definition of modparam unchanged (extra -1 value should not be noticed by any existing use case) but since it is purely debug feature I'm not against making bigger changes here.

Michal
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Quoting Michal Wajdeczko (2018-02-01 14:47:05)

Quoted 23 lines
Quoted 5 lines · Chris Wilson

Quoting Michal Wajdeczko (2018-01-31 18:23:47)

Quoted 4 lines

Our inject_load_failure functionality allows to insert one failure during driver load, but it is hard to guess which number should passed as modparam to select specific checkpoint.

Quoted 8 lines
Quoted 2 lines

Use negative number as option to list all available failure checkpoints without triggering any failure.

Hmm, it was only intended for use with the coupled igt test. Mind expanding upon the use case you have? Could you not use that iterative search for finding the injection value you want for repeated runs? For the bisect case, do you not want to keep it iterating over all in case the value changes? How stable do you want the modparam?

Iterative approach is good for validation team to verify that all existing failure points are correctly handled (ie. we don't cause crash/panic), but it is less useful when you are interested in adding new checkpoints just for your code, as it requires both time and luck as you may be hit by earlier checkpoint that no longer works ;)

Quoted 4 lines

Btw, IMHO this modparam should only be exposed in DEBUG config (as it introduces some code and text), and maybe we should also consider extending it to support more than one failure (as then it will be easy to check several code paths (like failure in fallback)

Sure, let's get it under the IS_ENABLED(CONFIG_DRM_I915_DEBUG).

Quoted 3 lines

This patch was trying to keep definition of modparam unchanged (extra -1 value should not be noticed by any existing use case) but since it is purely debug feature I'm not against making bigger changes here.

From my pov, it's very useful to define how you expect it to work, and how to make it more useful than drv_module_reload and to keep it working as you intend. A pure fault-counter doesn't seem very robust or intuitive for me when you are trying to develop a new fault point. Otoh, I don't mind if the developer has to fix all the earlier fails when testing his (those fails are all our responsibility) -- or at least file bugs so that awareness is raised.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
Quoted 24 lines · Chris Wilson

Quoting Michal Wajdeczko (2018-02-01 14:47:05)

Quoted 23 lines
Quoted 5 lines · Chris Wilson

Quoting Michal Wajdeczko (2018-01-31 18:23:47)

Quoted 4 lines

Our inject_load_failure functionality allows to insert one failure during driver load, but it is hard to guess which number should passed as modparam to select specific checkpoint.

Quoted 8 lines
Quoted 2 lines

Use negative number as option to list all available failure checkpoints without triggering any failure.

Hmm, it was only intended for use with the coupled igt test. Mind expanding upon the use case you have? Could you not use that iterative search for finding the injection value you want for repeated runs? For the bisect case, do you not want to keep it iterating over all in case the value changes? How stable do you want the modparam?

Iterative approach is good for validation team to verify that all existing failure points are correctly handled (ie. we don't cause crash/panic), but it is less useful when you are interested in adding new checkpoints just for your code, as it requires both time and luck as you may be hit by earlier checkpoint that no longer works ;)

Quoted 6 lines
Quoted 4 lines

Btw, IMHO this modparam should only be exposed in DEBUG config (as it introduces some code and text), and maybe we should also consider extending it to support more than one failure (as then it will be easy to check several code paths (like failure in fallback)

Sure, let's get it under the IS_ENABLED(CONFIG_DRM_I915_DEBUG).

I'll send separate patch for this.

Quoted 6 lines
Quoted 4 lines

This patch was trying to keep definition of modparam unchanged (extra -1 value should not be noticed by any existing use case) but since it is purely debug feature I'm not against making bigger changes here.

From my pov, it's very useful to define how you expect it to work, and

I was assuming these steps:

1. add new failure checkpoint(s) to the code
2. boot driver with inject modparam=-1 to list active checkpoints
3. note the number of checkpoint that we want to trigger
4. boot driver with inject modparam=n to trigger selected checkpoint
5. repeat steps 2-4 in case of rebase/code refactor/new checkpoints

Quoted 3 lines

how to make it more useful than drv_module_reload and to keep it working as you intend. A pure fault-counter doesn't seem very robust or intuitive for me when you are trying to develop a new fault point. Otoh,

Currently we identify fault checkpoint by pair [function:line] so if we want to invest more in this mechanism we can change modparam to char* and then check against function and line instead of the counter. Then no iteration (or listing checkpoints) would be needed.

Quoted 3 lines

I don't mind if the developer has to fix all the earlier fails when testing his (those fails are all our responsibility) -- or at least file bugs so that awareness is raised.

Agree.

Michal
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

Quoting Michal Wajdeczko (2018-02-01 15:51:58)

Quoted 12 lines

I was assuming these steps:

1. add new failure checkpoint(s) to the code
2. boot driver with inject modparam=-1 to list active checkpoints
3. note the number of checkpoint that we want to trigger
4. boot driver with inject modparam=n to trigger selected checkpoint
5. repeat steps 2-4 in case of rebase/code refactor/new checkpoints

Quoted 3 lines

how to make it more useful than drv_module_reload and to keep it working as you intend. A pure fault-counter doesn't seem very robust or intuitive for me when you are trying to develop a new fault point. Otoh,

Quoted 5 lines

Currently we identify fault checkpoint by pair [function:line] so if we want
to invest more in this mechanism we can change modparam to char* and then check against function and line instead of the counter. Then no iteration (or listing checkpoints) would be needed.

So I've no strong objection to the overall approach. (If time were infinite, I would push the fault-counters into a .data section so we could probe them from the i915.ko without loading.) I think though to make it really useful would be to add a tag to each fault-point (NULL for boring existing ones unless you're feeling inventive). Then the developer need only say ./tests/drv_reload_fault my-tag and that will then be stable across different kernels.

The minimum bar for adding this dev feature would be the corresponding tool for igt, with a small integrated test. (Hmm, if we could push the tags to .data, we could even tell how many fault-injection sites were hit.)

Long term desire would be kprobe/ebpf hookup, or some [soon-to-be] existing infrastructure for fault-injection along those lines. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx