On 01/22/2014 07:14 PM, Paulo Zanoni wrote: > 2014/1/22: >> From: Naresh Kumar Kachhi >> >> with current code intel_runtime_pm_gpu_idle is getting called >> even before runtime_pm is initialized. Moving runtime_pm_init >> before i915_gem_init >> >> Following is the call stack, note: by this time >> runtime_pm was not initialized >> >> intel_runtime_pm_gpu_idle+0x37/0x90 >> i915_gem_retire_requests+0x8d/0xa0 >> i915_gem_init_seqno+0x48/0x90 >> i915_gem_set_seqno+0x2a/0x70 >> i915_gem_init_hw+0x19c/0x300 >> ? >> i915_gem_context_init+0x123/0x220 >> i915_gem_init+0x57/0x1a0 >> i915_driver_load+0xbf4/0xd50 > And why exactly is this a problem? Delaying intel_init_runtime_pm is a > nice thing because we don't want our driver trying to runtime suspend > while it's still being loaded. pm.gpu_idle will be false (dev_priv is zeroed) until the init_runtime_pm is called. In the call stack mentioned above we might see a call to intel_runtime_pm_gpu_idle. If runtime pm is not initialized by now, pm.gpu_idle will be false and we will do a runtime_put, without a matching runtime_get. However in you patch http://lists.freedesktop.org/archives/intel-gfx/2013-December/037729.html, i saw you have moved the initializing gpu_idle in intel_pm_setup, which will fix this problem. We will not need this patch with your new patches. only concern in this patch is that we are scattering the pm initialization across two function (runtime_pm_init and pm_setup). >> Signed-off-by: Naresh Kumar Kachhi >> --- >> drivers/gpu/drm/i915/i915_dma.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c >> index b5af745..85162da 100644 >> --- a/drivers/gpu/drm/i915/i915_dma.c >> +++ b/drivers/gpu/drm/i915/i915_dma.c >> @@ -1511,6 +1511,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) >> mutex_init(&dev_priv->dpio_lock); >> mutex_init(&dev_priv->modeset_restore_lock); >> >> + intel_init_runtime_pm(dev_priv); >> + >> intel_pm_setup(dev); >> >> intel_display_crc_init(dev); >> @@ -1674,8 +1676,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) >> if (IS_GEN5(dev)) >> intel_gpu_ips_init(dev_priv); >> >> - intel_init_runtime_pm(dev_priv); >> - >> return 0; >> >> out_power_well: >> -- >> 1.8.1.2 >> >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx >