[Intel-gfx] [PATCH v12 01/11] drm/i915: Create GEM runtime resume helper and handle GEM suspend/resume errors
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Fri Sep 29 11:43:48 UTC 2017
On Thu, 2017-09-28 at 12:18 +0530, Sagar Arun Kamble wrote:
> These changes are preparation to handle GuC suspend/resume. Prepared
> helper i915_gem_runtime_resume to reinitialize suspended gem setup.
> Returning status from i915_gem_runtime_suspend and i915_gem_resume.
> This will be placeholder for handling any errors from uC suspend/resume
> in upcoming patches. Restructured the suspend/resume routines w.r.t setup
> creation and rollback order.
> This also fixes issue of ordering of i915_gem_runtime_resume with
> intel_runtime_pm_enable_interrupts.
>
> v2: Fixed return from intel_runtime_resume. (Michał Winiarski)
>
> v3: Not returning status from gem_runtime_resume. (Chris)
>
> v4: Refined return from i915_gem_runtime_suspend. (Michal Wajdeczko)
>
> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Imre Deak <imre.deak at intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Michał Winiarski <michal.winiarski at intel.com>
<SNIP>
> @@ -1666,7 +1667,9 @@ static int i915_drm_resume(struct drm_device *dev)
>
> intel_csr_ucode_resume(dev_priv);
>
> - i915_gem_resume(dev_priv);
> + ret = i915_gem_resume(dev_priv);
> + if (ret)
> + dev_err(&pdev->dev, "GEM resume failed\n");
Not DRM_ERROR like other paths?
Also, this might be worth a WARN(). I'm open for discussion.
> @@ -2560,6 +2561,15 @@ static int intel_runtime_suspend(struct device *kdev)
>
> DRM_DEBUG_KMS("Device suspended\n");
> return 0;
> +
> +err_suspend_complete:
err_disable:
> + intel_runtime_pm_enable_interrupts(dev_priv);
> + intel_guc_resume(dev_priv);
> + i915_gem_runtime_resume(dev_priv);
> +
> +err_gem_suspend:
err_gem:
We are in "suspend" function, after all.
> + enable_rpm_wakeref_asserts(dev_priv);
> + return ret;
> }
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list