diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 24a3013728c3d..9ee58bf49d133 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -465,7 +465,17 @@ static int rpm_idle(struct device *dev, int rpmflags) dev->power.idle_notification = true; - retval = __rpm_callback(callback, dev); + if (dev->power.irq_safe) + spin_unlock(&dev->power.lock); + else + spin_unlock_irq(&dev->power.lock); + + retval = callback(dev); + + if (dev->power.irq_safe) + spin_lock(&dev->power.lock); + else + spin_lock_irq(&dev->power.lock); dev->power.idle_notification = false; wake_up_all(&dev->power.wait_queue);