Commit 9aa32034 authored by Mitul Golani's avatar Mitul Golani Committed by Imre Deak

drm/i915/display: Fix warning callstack for imbalance wakeref

While executing i915_selftest, wakeref imbalance warning is seen
with i915_selftest failure.

Currently when Driver is suspended, while doing unregister
it is taking wakeref without resuming the device.
This patch is resuming the device, if driver is already suspended
and doing unregister process.
Signed-off-by: default avatarMitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220830085158.577157-1-mitulkumar.ajitkumar.golani@intel.com
parent a5810f55
...@@ -953,7 +953,9 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -953,7 +953,9 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
void i915_driver_remove(struct drm_i915_private *i915) void i915_driver_remove(struct drm_i915_private *i915)
{ {
disable_rpm_wakeref_asserts(&i915->runtime_pm); intel_wakeref_t wakeref;
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
i915_driver_unregister(i915); i915_driver_unregister(i915);
...@@ -977,18 +979,19 @@ void i915_driver_remove(struct drm_i915_private *i915) ...@@ -977,18 +979,19 @@ void i915_driver_remove(struct drm_i915_private *i915)
i915_driver_hw_remove(i915); i915_driver_hw_remove(i915);
enable_rpm_wakeref_asserts(&i915->runtime_pm); intel_runtime_pm_put(&i915->runtime_pm, wakeref);
} }
static void i915_driver_release(struct drm_device *dev) static void i915_driver_release(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
intel_wakeref_t wakeref;
if (!dev_priv->do_release) if (!dev_priv->do_release)
return; return;
disable_rpm_wakeref_asserts(rpm); wakeref = intel_runtime_pm_get(rpm);
i915_gem_driver_release(dev_priv); i915_gem_driver_release(dev_priv);
...@@ -999,7 +1002,8 @@ static void i915_driver_release(struct drm_device *dev) ...@@ -999,7 +1002,8 @@ static void i915_driver_release(struct drm_device *dev)
i915_driver_mmio_release(dev_priv); i915_driver_mmio_release(dev_priv);
enable_rpm_wakeref_asserts(rpm); intel_runtime_pm_put(rpm, wakeref);
intel_runtime_pm_driver_release(rpm); intel_runtime_pm_driver_release(rpm);
i915_driver_late_release(dev_priv); i915_driver_late_release(dev_priv);
......
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