diff mbox series

drm/i915: Fix i915_driver_init_mmio error path

Message ID 20181011121951.27184-1-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Fix i915_driver_init_mmio error path | expand

Commit Message

Michal Wajdeczko Oct. 11, 2018, 12:19 p.m. UTC
In case of the error we missed to call i915_mmio_cleanup
that matches earlier call to i915_mmio_setup.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Wilson Oct. 11, 2018, 12:26 p.m. UTC | #1
Quoting Michal Wajdeczko (2018-10-11 13:19:51)
> In case of the error we missed to call i915_mmio_cleanup
> that matches earlier call to i915_mmio_setup.

True, doesn't look fatal atm; worst being we left the register bar mmapped
(which would be ok as we map it again using the same constraints on next
load) and left the mchbar flagged as active (if we enabled it on
i915/i965).

We should pair this with a patch to add a i915_inject_load_failure() to
intel_engine_init_mmio.
 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Mika Kuoppala Oct. 11, 2018, 12:26 p.m. UTC | #2
Michal Wajdeczko <michal.wajdeczko@intel.com> writes:

> In case of the error we missed to call i915_mmio_cleanup
> that matches earlier call to i915_mmio_setup.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 19302342..baac35f 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1030,6 +1030,7 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
>  
>  err_uncore:
>  	intel_uncore_fini(dev_priv);
> +	i915_mmio_cleanup(dev_priv);
>  err_bridge:
>  	pci_dev_put(dev_priv->bridge_dev);
>  
> -- 
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 19302342..baac35f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1030,6 +1030,7 @@  static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
 
 err_uncore:
 	intel_uncore_fini(dev_priv);
+	i915_mmio_cleanup(dev_priv);
 err_bridge:
 	pci_dev_put(dev_priv->bridge_dev);