soc: rockchip: power-domain: Fix deadlock between dmcfreq and vop on/off

When change vop status and ddr frequency at the same time,
the following deadlock will happen:

vop no/off                            dmcfreq
vop_crtc_disable                      update_devfreq
->mutex_lock(&vop->vop_lock);         ->mutex_lock(&pd->pmu->mutex);
->pm_runtime_put(vop->dev);           ->mutex_lock(&vop->vop_lock);
  ->mutex_lock(&pd->pmu->mutex);      ...

By set dmc_nb.priority lower than vop to make sure pd notified after vop
to avoid deadlock.

Change-Id: I3ad147e7f5510f2b617efb600b97d8eb5849ee01
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2018-05-17 09:51:10 +08:00
parent 23e4b5d1f9
commit 48b41d013e

View File

@@ -762,6 +762,7 @@ int rockchip_pm_register_notify_to_dmc(struct devfreq *devfreq)
dmc_pmu->devfreq = devfreq;
dmc_pmu->dmc_nb.notifier_call = dmc_notify;
dmc_pmu->dmc_nb.priority = -100; /* notified after vop */
devfreq_register_notifier(dmc_pmu->devfreq, &dmc_pmu->dmc_nb,
DEVFREQ_TRANSITION_NOTIFIER);
return 0;