Message ID | 1435940854-24585-1-git-send-email-bing.niu@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, Jul 04, 2015 at 12:27:34AM +0800, bing.niu@intel.com wrote: > From: "Niu,Bing" <bing.niu@intel.com> > > It is found that i915 will not reset gpu under execlist mode when > unload module. that will lead to some issues when unload/load module > with different submission mode. e.g. from execlist mode to ring > buffer mode via loading/unloading i915. Because HW is not in a reset > state and registers are not clean under such condition. > > Signed-off-by: Niu,Bing <bing.niu@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> I think we may end up doing the reset unconditionally in i915_driver_unload() because this argument holds for almost everything we setup. It's a bigger risk because of doing the gpu-reset on more machines, but module-unloading is a "developer feature"! The only issue is making sure that the reset is ordered appropriately. -Chris
Chris Wilson <chris@chris-wilson.co.uk> writes: > On Sat, Jul 04, 2015 at 12:27:34AM +0800, bing.niu@intel.com wrote: >> From: "Niu,Bing" <bing.niu@intel.com> >> >> It is found that i915 will not reset gpu under execlist mode when >> unload module. that will lead to some issues when unload/load module >> with different submission mode. e.g. from execlist mode to ring >> buffer mode via loading/unloading i915. Because HW is not in a reset >> state and registers are not clean under such condition. >> >> Signed-off-by: Niu,Bing <bing.niu@intel.com> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> > > I think we may end up doing the reset unconditionally in > i915_driver_unload() because this argument holds for almost everything > we setup. It's a bigger risk because of doing the gpu-reset on more > machines, but module-unloading is a "developer feature"! And after that has been sorted, we should try reset on module load. This way initial state would be identical to after reset/unload state. Now we have this situation that we don't know how much we are leaning on bios on state setup. -Mika > The only issue is making sure that the reset is ordered appropriately. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index be35f04..7855dd3 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -5115,6 +5115,14 @@ i915_gem_cleanup_ringbuffer(struct drm_device *dev) for_each_ring(ring, dev_priv, i) dev_priv->gt.cleanup_ring(ring); + + if (i915.enable_execlists) + /* + * Neither the BIOS, ourselves or any other kernel + * expects the system to be in execlists mode on startup, + * so we need to reset the GPU back to legacy mode. + */ + intel_gpu_reset(dev); } static void