Skip to contentSkip to conversation

drm/i915: Fix uninitialized return from mi_set_context

PATCH In review Tvrtko Ursulin 4 participants 4 messages Feb 14, 2017

Subsystems (2)
lore
Share & tools
lore

Tvrtko Ursulin

author maintainer
#0 lore raw

PATCH 1/1 drm/i915: Fix uninitialized return from mi_set_context

From: Tvrtko Ursulin <[email protected]>

For some reason my compiler (and CI as well) failed to spot the uninitialized ret in mi_set_context.

Fixes 73dec95e6ba3 ("drm/i915: Emit to ringbuffer directly")
Cc Tvrtko Ursulin <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +3 -3
index 9037356536dc..262452055563 100644
@@ -604,7 +604,7 @@ mi_set_context(struct drm_i915_gem_request *req, u32 hw_flags)
 		i915.semaphores ?
 		INTEL_INFO(dev_priv)->num_rings - 1 :
 		0;
-	int len, ret;
+	int len;
 
 	/* w/a: If Flush TLB Invalidation Mode is enabled, driver must do a TLB
 	 * invalidation prior to MI_SET_CONTEXT. On GEN6 we don't set the value
@@ -612,7 +612,7 @@ mi_set_context(struct drm_i915_gem_request *req, u32 hw_flags)
 	 * itlb_before_ctx_switch.
 	 */
 	if (IS_GEN6(dev_priv)) {
-		ret = engine->emit_flush(req, EMIT_INVALIDATE);
+		int ret = engine->emit_flush(req, EMIT_INVALIDATE);
 		if (ret)
 			return ret;
 	}
@@ -687,7 +687,7 @@ mi_set_context(struct drm_i915_gem_request *req, u32 hw_flags)
 
 	intel_ring_advance(req, cs);
 
-	return ret;
+	return 0;
 }
 
 static int remap_l3(struct drm_i915_gem_request *req, int slice)
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

For some reason my compiler (and CI as well) failed to spot the uninitialized ret in mi_set_context.

Fixes 73dec95e6ba3 ("drm/i915: Emit to ringbuffer directly")
Cc Tvrtko Ursulin <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>

Ah, it was only because I don't have that redundant flush did my compile spot the uninit ret.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

✓ Fi.CI.BAT: success for drm/i915: Fix uninitialized return from mi_set_context

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915: Fix uninitialized return from mi_set_context
URL : https://patchwork.freedesktop.org/series/19642/
State : success

== Summary ==

Series 19642v1 drm/i915: Fix uninitialized return from mi_set_context
https://patchwork.freedesktop.org/api/1.0/series/19642/revisions/1/mbox/

fi-bdw-5557u     total:252  pass:241  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:252  pass:213  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:83   pass:70   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:252  pass:225  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:252  pass:202  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:252  pass:235  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:252  pass:230  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:252  pass:224  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:252  pass:223  dwarn:0   dfail:0   fail:0   skip:29 

7b80cb5504b3b3cebaea944d35f25e27415e89a6 drm-tip: 2017y-02m-14d-14h-36m-43s UTC integration manifest 579751c drm/i915: Fix uninitialized return from mi_set_context

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3810/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: ✓ Fi.CI.BAT: success for drm/i915: Fix uninitialized return from mi_set_context

Quoted 30 lines · Patchwork

== Series Details ==

Series: drm/i915: Fix uninitialized return from mi_set_context
URL : https://patchwork.freedesktop.org/series/19642/
State : success

== Summary ==

Series 19642v1 drm/i915: Fix uninitialized return from mi_set_context
https://patchwork.freedesktop.org/api/1.0/series/19642/revisions/1/mbox/

fi-bdw-5557u     total:252  pass:241  dwarn:0   dfail:0   fail:0   skip:11
fi-bsw-n3050     total:252  pass:213  dwarn:0   dfail:0   fail:0   skip:39
fi-bxt-j4205     total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19
fi-bxt-t5700     total:83   pass:70   dwarn:0   dfail:0   fail:0   skip:12
fi-byt-j1900     total:252  pass:225  dwarn:0   dfail:0   fail:0   skip:27
fi-byt-n2820     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31
fi-hsw-4770      total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16
fi-hsw-4770r     total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16
fi-ilk-650       total:252  pass:202  dwarn:0   dfail:0   fail:0   skip:50
fi-ivb-3520m     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18
fi-ivb-3770      total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18
fi-kbl-7500u     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18
fi-skl-6260u     total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10
fi-skl-6700hq    total:252  pass:235  dwarn:0   dfail:0   fail:0   skip:17
fi-skl-6700k     total:252  pass:230  dwarn:4   dfail:0   fail:0   skip:18
fi-skl-6770hq    total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10
fi-snb-2520m     total:252  pass:224  dwarn:0   dfail:0   fail:0   skip:28
fi-snb-2600      total:252  pass:223  dwarn:0   dfail:0   fail:0   skip:29
Quoted 2 lines

7b80cb5504b3b3cebaea944d35f25e27415e89a6 drm-tip: 2017y-02m-14d-14h-36m-43s UTC integration manifest 579751c drm/i915: Fix uninitialized return from mi_set_context

Pushed, thanks for the bug report and the review!

Regards,

Tvrtko

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