Commit 4bdc7293 authored by Imre Deak's avatar Imre Deak Committed by Daniel Vetter

drm/i915: add missing unregister_oom_notifier to the error/unload path

I'm trying to reduce the WARNs during driver reload and this was one of
them. Also while at it remove the redundant condition from before
unregister_shrinker().

v2:
- fix the error path too and move the unregister to its logical place
(Chris)
- remove redundant condition from before unregister_shrinker()
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 646b4269
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <acpi/video.h> #include <acpi/video.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/oom.h>
#define LP_RING(d) (&((struct drm_i915_private *)(d))->ring[RCS]) #define LP_RING(d) (&((struct drm_i915_private *)(d))->ring[RCS])
...@@ -1741,7 +1742,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1741,7 +1742,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
intel_power_domains_remove(dev_priv); intel_power_domains_remove(dev_priv);
drm_vblank_cleanup(dev); drm_vblank_cleanup(dev);
out_gem_unload: out_gem_unload:
if (dev_priv->mm.shrinker.scan_objects) WARN_ON(unregister_oom_notifier(&dev_priv->mm.oom_notifier));
unregister_shrinker(&dev_priv->mm.shrinker); unregister_shrinker(&dev_priv->mm.shrinker);
if (dev->pdev->msi_enabled) if (dev->pdev->msi_enabled)
...@@ -1793,7 +1794,7 @@ int i915_driver_unload(struct drm_device *dev) ...@@ -1793,7 +1794,7 @@ int i915_driver_unload(struct drm_device *dev)
i915_teardown_sysfs(dev); i915_teardown_sysfs(dev);
if (dev_priv->mm.shrinker.scan_objects) WARN_ON(unregister_oom_notifier(&dev_priv->mm.oom_notifier));
unregister_shrinker(&dev_priv->mm.shrinker); unregister_shrinker(&dev_priv->mm.shrinker);
io_mapping_free(dev_priv->gtt.mappable); io_mapping_free(dev_priv->gtt.mappable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment