drm/i915: Fix off-by-one in reporting hanging process
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 15 Mar 2019 16:39:33 +0000 (16:39 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 15 Mar 2019 21:10:08 +0000 (21:10 +0000)
ffs() is 1-indexed, but we want to use it as an index into an array, so
use __ffs() instead.

Fixes: eb8d0f5af4ec ("drm/i915: Remove GPU reset dependence on struct_mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190315163933.19352-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gpu_error.c

index 3d80208886042f6b24de01a25a4a17bc49b295cc..26bac517e38360ea9f1e4113690b4c41d07045b8 100644 (file)
@@ -1656,7 +1656,7 @@ error_msg(struct i915_gpu_state *error, unsigned long engines, const char *msg)
                        i915_error_generate_code(error, engines));
        if (engines) {
                /* Just show the first executing process, more is confusing */
-               i = ffs(engines);
+               i = __ffs(engines);
                len += scnprintf(error->error_msg + len,
                                 sizeof(error->error_msg) - len,
                                 ", in %s [%d]",