drm/i915/guc: Fix doorbell id selection
authorMichel Thierry <[email protected]>
Wed, 31 May 2017 00:05:46 +0000 (17:05 -0700)
committerJoonas Lahtinen <[email protected]>
Wed, 31 May 2017 07:34:03 +0000 (10:34 +0300)
We are passing parameters in the wrong order to find next zero bit, and
when it doesn't find anything it returns size (offset in the code), which
is always zero.

For reference the function is defined as:
find_next_bit( *addr, size, offset )

The incorrect parameter order was added by commit abddffdf3620e
("drm/i915/guc: Sanitize GuC client initialization"). Luckily, currently
we only use a single guc client and a single doorbell, which happens to be
zero; therefore it isn't necessary to backport this fix (which would be for
v4.12).

Cc: Daniele Ceraolo Spurio <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Oscar Mateo <[email protected]>
Signed-off-by: Michel Thierry <[email protected]>
Reviewed-by: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: Joonas Lahtinen <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/i915_guc_submission.c

index e6e0c6ef1084b99b86c50849773925a9fbe065c1..48a1e9349a2ce24efc76da76e2fc09abe5906c5c 100644 (file)
@@ -105,7 +105,7 @@ static int __reserve_doorbell(struct i915_guc_client *client)
                end += offset;
        }
 
-       id = find_next_zero_bit(client->guc->doorbell_bitmap, offset, end);
+       id = find_next_zero_bit(client->guc->doorbell_bitmap, end, offset);
        if (id == end)
                return -ENOSPC;