[Intel-gfx] [PATCH] drm/i915: use correct runtime get/put calls at init/teardown

Paulo Zanoni przanoni at gmail.com
Thu Sep 17 14:40:25 PDT 2015


2015-09-17 18:23 GMT-03:00 Jesse Barnes <jbarnes at virtuousgeek.org>:
> According to the PCI docs and Rafael, we need to be using
> pm_runtime_put_noidle() and pm_runtime_get_noresume() in our init and
> teardown routines, rather than using a direct enable/disable pair (and
> we didn't even have the enable side, so never autosuspended after an
> unload).
>
> This fixes one failure of the basic-pci-d3-state test on my BYT.  I'm
> still debugging why the device never autosuspends.
>
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 85c35fd..1addb8a 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -1822,7 +1822,7 @@ static void intel_runtime_pm_disable(struct drm_i915_private *dev_priv)
>
>         /* Make sure we're not suspended first. */

So is the comment above still valid?

As far as I remember, we explicitly wake up the hardware after unload
because our driver is (was) not prepared to be loaded on a hardware
that is suspended. Did you try module reloading after this change?

Also, basic-pci-d3-state should not be unloading/reloading the driver,
so it's not clear to me how this change helps passing that test.

>         pm_runtime_get_sync(device);
> -       pm_runtime_disable(device);
> +       pm_runtime_get_noresume(device);
>  }
>
>  /**
> @@ -2114,8 +2114,6 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
>         if (!HAS_RUNTIME_PM(dev))
>                 return;
>
> -       pm_runtime_set_active(device);
> -
>         /*
>          * RPM depends on RC6 to save restore the GT HW context, so make RC6 a
>          * requirement.
> @@ -2130,5 +2128,6 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
>         pm_runtime_use_autosuspend(device);
>
>         pm_runtime_put_autosuspend(device);
> +       pm_runtime_put_noidle(device);
>  }
>
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni


More information about the Intel-gfx mailing list