public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: initialize ret in i915_gem_evict_something
@ 2017-01-05 14:41 Matthew Auld
  2017-01-05 15:13 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Matthew Auld @ 2017-01-05 14:41 UTC (permalink / raw)
  To: intel-gfx

If we find a suitable victim node on our first pass, then ret
will be uninitialized which could lead to some funny business later.

Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 50129ec1caab..19716548c455 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -109,7 +109,7 @@ i915_gem_evict_something(struct i915_address_space *vm,
 	}, **phase;
 	struct i915_vma *vma, *next;
 	struct drm_mm_node *node;
-	int ret;
+	int ret = 0;
 
 	lockdep_assert_held(&vm->i915->drm.struct_mutex);
 	trace_i915_gem_evict(vm, min_size, alignment, flags);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: initialize ret in i915_gem_evict_something
  2017-01-05 14:41 [PATCH] drm/i915: initialize ret in i915_gem_evict_something Matthew Auld
@ 2017-01-05 15:13 ` Chris Wilson
  2017-01-05 15:26   ` Matthew Auld
  2017-01-05 15:29 ` ✓ Fi.CI.BAT: success for drm/i915: initialize ret in i915_gem_evict_something Patchwork
  2017-01-05 16:53 ` ✗ Fi.CI.BAT: warning for drm/i915: initialize ret in i915_gem_evict_something (rev2) Patchwork
  2 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2017-01-05 15:13 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx

On Thu, Jan 05, 2017 at 02:41:31PM +0000, Matthew Auld wrote:
> If we find a suitable victim node on our first pass, then ret
> will be uninitialized which could lead to some funny business later.
> 
> Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_evict.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> index 50129ec1caab..19716548c455 100644
> --- a/drivers/gpu/drm/i915/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> @@ -109,7 +109,7 @@ i915_gem_evict_something(struct i915_address_space *vm,
>  	}, **phase;
>  	struct i915_vma *vma, *next;
>  	struct drm_mm_node *node;
> -	int ret;
> +	int ret = 0;

Please don't randomly initialise locals. It is meant to be initialised
just prior to the unbind loop. It appears that my patches are
out-of-order. :|
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: initialize ret in i915_gem_evict_something
  2017-01-05 15:13 ` Chris Wilson
@ 2017-01-05 15:26   ` Matthew Auld
  2017-01-05 15:59     ` [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something() Chris Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Auld @ 2017-01-05 15:26 UTC (permalink / raw)
  To: Chris Wilson, Matthew Auld, Intel Graphics Development

On 5 January 2017 at 15:13, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Jan 05, 2017 at 02:41:31PM +0000, Matthew Auld wrote:
>> If we find a suitable victim node on our first pass, then ret
>> will be uninitialized which could lead to some funny business later.
>>
>> Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_gem_evict.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
>> index 50129ec1caab..19716548c455 100644
>> --- a/drivers/gpu/drm/i915/i915_gem_evict.c
>> +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
>> @@ -109,7 +109,7 @@ i915_gem_evict_something(struct i915_address_space *vm,
>>       }, **phase;
>>       struct i915_vma *vma, *next;
>>       struct drm_mm_node *node;
>> -     int ret;
>> +     int ret = 0;
>
> Please don't randomly initialise locals. It is meant to be initialised
> just prior to the unbind loop. It appears that my patches are
> out-of-order. :|
Oh, then I misread the intention of the code, sorry.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: initialize ret in i915_gem_evict_something
  2017-01-05 14:41 [PATCH] drm/i915: initialize ret in i915_gem_evict_something Matthew Auld
  2017-01-05 15:13 ` Chris Wilson
@ 2017-01-05 15:29 ` Patchwork
  2017-01-05 16:53 ` ✗ Fi.CI.BAT: warning for drm/i915: initialize ret in i915_gem_evict_something (rev2) Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2017-01-05 15:29 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: initialize ret in i915_gem_evict_something
URL   : https://patchwork.freedesktop.org/series/17552/
State : success

== Summary ==

Series 17552v1 drm/i915: initialize ret in i915_gem_evict_something
https://patchwork.freedesktop.org/api/1.0/series/17552/revisions/1/mbox/

Test kms_force_connector_basic:
        Subgroup prune-stale-modes:
                dmesg-warn -> PASS       (fi-snb-2520m)

fi-bdw-5557u     total:246  pass:231  dwarn:0   dfail:0   fail:1   skip:14 
fi-bsw-n3050     total:246  pass:206  dwarn:0   dfail:0   fail:1   skip:39 
fi-bxt-j4205     total:246  pass:223  dwarn:0   dfail:0   fail:1   skip:22 
fi-bxt-t5700     total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:218  dwarn:0   dfail:0   fail:1   skip:27 
fi-byt-n2820     total:246  pass:214  dwarn:0   dfail:0   fail:1   skip:31 
fi-hsw-4770      total:246  pass:226  dwarn:0   dfail:0   fail:1   skip:19 
fi-hsw-4770r     total:246  pass:226  dwarn:0   dfail:0   fail:1   skip:19 
fi-ivb-3520m     total:246  pass:224  dwarn:0   dfail:0   fail:1   skip:21 
fi-kbl-7500u     total:246  pass:224  dwarn:0   dfail:0   fail:1   skip:21 
fi-skl-6260u     total:246  pass:232  dwarn:0   dfail:0   fail:1   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:221  dwarn:3   dfail:0   fail:1   skip:21 
fi-skl-6770hq    total:246  pass:232  dwarn:0   dfail:0   fail:1   skip:13 
fi-snb-2520m     total:246  pass:214  dwarn:0   dfail:0   fail:1   skip:31 
fi-snb-2600      total:246  pass:213  dwarn:0   dfail:0   fail:1   skip:32 

6a304f1f2e7446fe71bf7845c34dcdc73436c547 drm-tip: 2017y-01m-05d-11h-52m-09s UTC integration manifest
7d234c9 drm/i915: initialize ret in i915_gem_evict_something

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3437/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something()
  2017-01-05 15:26   ` Matthew Auld
@ 2017-01-05 15:59     ` Chris Wilson
  2017-01-05 16:33       ` Chris Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2017-01-05 15:59 UTC (permalink / raw)
  To: intel-gfx

Missed when rebasing patches, I failed to set ret to zero before
starting the unbind loop (which depends upon ret being zero).

Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 50129ec1caab..026ebc5a452a 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -209,6 +209,7 @@ i915_gem_evict_something(struct i915_address_space *vm,
 	}
 
 	/* Unbinding will emit any required flushes */
+	ret = 0;
 	while (!list_empty(&eviction_list)) {
 		vma = list_first_entry(&eviction_list,
 				       struct i915_vma,
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something()
  2017-01-05 15:59     ` [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something() Chris Wilson
@ 2017-01-05 16:33       ` Chris Wilson
  2017-01-05 16:36         ` Matthew Auld
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2017-01-05 16:33 UTC (permalink / raw)
  To: intel-gfx

On Thu, Jan 05, 2017 at 03:59:40PM +0000, Chris Wilson wrote:
> Missed when rebasing patches, I failed to set ret to zero before
> starting the unbind loop (which depends upon ret being zero).
> 
> Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
> Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: <stable@vger.kernel.org> # v4.9+
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something()
  2017-01-05 16:33       ` Chris Wilson
@ 2017-01-05 16:36         ` Matthew Auld
  2017-01-05 16:49           ` Chris Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Auld @ 2017-01-05 16:36 UTC (permalink / raw)
  To: Chris Wilson, Intel Graphics Development

On 5 January 2017 at 16:33, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Jan 05, 2017 at 03:59:40PM +0000, Chris Wilson wrote:
>> Missed when rebasing patches, I failed to set ret to zero before
>> starting the unbind loop (which depends upon ret being zero).
>>
>> Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
>> Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> Cc: <stable@vger.kernel.org> # v4.9+
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something()
  2017-01-05 16:36         ` Matthew Auld
@ 2017-01-05 16:49           ` Chris Wilson
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2017-01-05 16:49 UTC (permalink / raw)
  To: Matthew Auld; +Cc: Intel Graphics Development

On Thu, Jan 05, 2017 at 04:36:06PM +0000, Matthew Auld wrote:
> On 5 January 2017 at 16:33, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Thu, Jan 05, 2017 at 03:59:40PM +0000, Chris Wilson wrote:
> >> Missed when rebasing patches, I failed to set ret to zero before
> >> starting the unbind loop (which depends upon ret being zero).
> >>
> >> Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
> >> Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> > Cc: <stable@vger.kernel.org> # v4.9+
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Thanks for spotting my mistake, pushed before it starts to cause
problems in the wild.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* ✗ Fi.CI.BAT: warning for drm/i915: initialize ret in i915_gem_evict_something (rev2)
  2017-01-05 14:41 [PATCH] drm/i915: initialize ret in i915_gem_evict_something Matthew Auld
  2017-01-05 15:13 ` Chris Wilson
  2017-01-05 15:29 ` ✓ Fi.CI.BAT: success for drm/i915: initialize ret in i915_gem_evict_something Patchwork
@ 2017-01-05 16:53 ` Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2017-01-05 16:53 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: initialize ret in i915_gem_evict_something (rev2)
URL   : https://patchwork.freedesktop.org/series/17552/
State : warning

== Summary ==

Series 17552v2 drm/i915: initialize ret in i915_gem_evict_something
https://patchwork.freedesktop.org/api/1.0/series/17552/revisions/2/mbox/

Test kms_force_connector_basic:
        Subgroup force-edid:
                pass       -> DMESG-WARN (fi-snb-2520m)
        Subgroup prune-stale-modes:
                dmesg-warn -> PASS       (fi-snb-2520m)

fi-bdw-5557u     total:246  pass:231  dwarn:0   dfail:0   fail:1   skip:14 
fi-bsw-n3050     total:246  pass:206  dwarn:0   dfail:0   fail:1   skip:39 
fi-bxt-j4205     total:246  pass:223  dwarn:0   dfail:0   fail:1   skip:22 
fi-bxt-t5700     total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:218  dwarn:0   dfail:0   fail:1   skip:27 
fi-byt-n2820     total:246  pass:214  dwarn:0   dfail:0   fail:1   skip:31 
fi-hsw-4770      total:246  pass:226  dwarn:0   dfail:0   fail:1   skip:19 
fi-hsw-4770r     total:246  pass:226  dwarn:0   dfail:0   fail:1   skip:19 
fi-ivb-3520m     total:246  pass:224  dwarn:0   dfail:0   fail:1   skip:21 
fi-ivb-3770      total:246  pass:224  dwarn:0   dfail:0   fail:1   skip:21 
fi-kbl-7500u     total:246  pass:224  dwarn:0   dfail:0   fail:1   skip:21 
fi-skl-6260u     total:246  pass:232  dwarn:0   dfail:0   fail:1   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:221  dwarn:3   dfail:0   fail:1   skip:21 
fi-skl-6770hq    total:246  pass:232  dwarn:0   dfail:0   fail:1   skip:13 
fi-snb-2520m     total:246  pass:213  dwarn:1   dfail:0   fail:1   skip:31 
fi-snb-2600      total:246  pass:213  dwarn:0   dfail:0   fail:1   skip:32 

6a304f1f2e7446fe71bf7845c34dcdc73436c547 drm-tip: 2017y-01m-05d-11h-52m-09s UTC integration manifest
b45bcf3 drm/i915: Clear ret before unbinding in i915_gem_evict_something()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3440/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-05 16:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05 14:41 [PATCH] drm/i915: initialize ret in i915_gem_evict_something Matthew Auld
2017-01-05 15:13 ` Chris Wilson
2017-01-05 15:26   ` Matthew Auld
2017-01-05 15:59     ` [PATCH] drm/i915: Clear ret before unbinding in i915_gem_evict_something() Chris Wilson
2017-01-05 16:33       ` Chris Wilson
2017-01-05 16:36         ` Matthew Auld
2017-01-05 16:49           ` Chris Wilson
2017-01-05 15:29 ` ✓ Fi.CI.BAT: success for drm/i915: initialize ret in i915_gem_evict_something Patchwork
2017-01-05 16:53 ` ✗ Fi.CI.BAT: warning for drm/i915: initialize ret in i915_gem_evict_something (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox