mfld_pmu: add might_sleep in pmu_pci_set_power_state
authorIllyas Mansoor <illyas.mansoor@intel.com>
Sun, 15 Apr 2012 16:13:25 +0000 (21:43 +0530)
committerbuildbot <buildbot@intel.com>
Tue, 17 Apr 2012 17:33:08 +0000 (10:33 -0700)
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>
arch/x86/platform/intel-mid/mfld-pmu.c

index 13632c3..aa715a3 100644 (file)
@@ -1653,6 +1653,8 @@ int __ref pmu_pci_set_power_state(struct pci_dev *pdev, pci_power_t state)
        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);