BZ: 31847
It is possible that pmu_pci_set_power_state() could be called from atomic
context if pm_runtime_irq_safe() is set by a driver and runtime_put/get called
from an atomic context.
But our implementation of set_power_state() does not allow calls to be made to
pmu_pci_set_power_state() is atomic context
Hence make it explicit by calling might_sleep() and let it provide a call stack
if anyone attempts to do so.
Change-Id: I141e1573e97e017c018c4a2576dfe4494c6d8f32
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
Reviewed-on: http://android.intel.com:8080/43507
Reviewed-by: Hogander, Jouni <jouni.hogander@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Martin, LoicX <loicx.martin@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
if (unlikely((!pmu_initialized)))
return 0;
+ might_sleep();
+
/* Try to acquire the scu_ready_sem, if not
* get blocked, until pmu_sc_irq() releases */
down(&mid_pmu_cxt->scu_ready_sem);