drm/i915/gen9: Use flush_work to synchronize with dmc loader
authorAnimesh Manna <animesh.manna@intel.com>
Wed, 28 Oct 2015 21:59:05 +0000 (23:59 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 12 Nov 2015 15:30:25 +0000 (17:30 +0200)
During driver unload to ensure we dont have any pending task,
flush_work added to complete firmware loading task.

v1: Initial version.

v2: As per review comments from Daniel,
Removed flush_work from skl_set_power_well. As we have taken
power well refernece and rpm count during firmware loading
by using display_power_domain_get/put - this will always
ensure rpm will be blocked if firmware is not loaded.

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Sunil Kamath <sunil.kamath@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Tested-by: Daniel Stone <daniels@collabora.com> # SKL
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1446069547-24760-12-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_csr.c

index d678b15f7467cc0536cd2c0d84f235008f849cf6..37319b081b8da8ec08612f26a10919fcac14ee06 100644 (file)
@@ -1067,8 +1067,6 @@ static int i915_pm_resume(struct device *dev)
 
 static int skl_suspend_complete(struct drm_i915_private *dev_priv)
 {
-       /* Enabling DC6 is not a hard requirement to enter runtime D3 */
-
        skl_uninit_cdclk(dev_priv);
 
        if (dev_priv->csr.dmc_payload)
index 50790725d5145a12dc08021a1b8f74df508d19b0..2d6527e52acce5dc8bf9f155ee0152f7ccef8540 100644 (file)
@@ -446,5 +446,7 @@ void intel_csr_ucode_fini(struct drm_i915_private *dev_priv)
        if (!HAS_CSR(dev_priv))
                return;
 
+       flush_work(&dev_priv->csr.work);
+
        kfree(dev_priv->csr.dmc_payload);
 }