diff mbox

drm/i915/guc: Fix doorbell id selection

Message ID 20170531000546.30762-1-michel.thierry@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michel Thierry May 31, 2017, 12:05 a.m. UTC
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 <daniele.ceraolospurio@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniele Ceraolo Spurio May 31, 2017, 12:19 a.m. UTC | #1
On 30/05/17 17:05, Michel Thierry wrote:
> 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 <daniele.ceraolospurio@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Oscar Mateo <oscar.mateo@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Thanks,
Daniele

>  drivers/gpu/drm/i915/i915_guc_submission.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> index fb936bb5cb93..ec391ef981aa 100644
> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> @@ -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;
>
>
Joonas Lahtinen May 31, 2017, 7:37 a.m. UTC | #2
On ti, 2017-05-30 at 17:19 -0700, Daniele Ceraolo Spurio wrote:
> 
> On 30/05/17 17:05, Michel Thierry wrote:
> > 
> > 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).

Whoops, a good catch.

Regards, Joonas
Joonas Lahtinen May 31, 2017, 7:37 a.m. UTC | #3
On ke, 2017-05-31 at 00:21 +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915/guc: Fix doorbell id selection
> URL   : https://patchwork.freedesktop.org/series/25076/
> State : success

Merged. Thanks for the patch and review.

Regards, Joonas
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index fb936bb5cb93..ec391ef981aa 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -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;