diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 8bef3cb2424d..2ca2bcf68cdb 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -379,10 +379,11 @@ static int rpm_idle(struct device *dev, int rpmflags) int (*callback)(struct device *); int retval; + dev_info(dev, "%s: begin, rpmflags = %d\n", __func__, rpmflags); trace_rpm_idle_rcuidle(dev, rpmflags); retval = rpm_check_suspend_allowed(dev); if (retval < 0) - ; /* Conditions are wrong. */ + dev_info(dev, "%s: rpm_check_suspend_allowed() returned %d\n", __func__, retval); /* Conditions are wrong. */ /* Idle notifications are allowed only in the RPM_ACTIVE state. */ else if (dev->power.runtime_status != RPM_ACTIVE) @@ -415,6 +416,7 @@ static int rpm_idle(struct device *dev, int rpmflags) dev->power.request_pending = true; queue_work(pm_wq, &dev->power.work); } + dev_info(dev, "%s: queued async idle\n", __func__); trace_rpm_return_int_rcuidle(dev, _THIS_IP_, 0); return 0; } @@ -423,14 +425,17 @@ static int rpm_idle(struct device *dev, int rpmflags) callback = RPM_GET_CALLBACK(dev, runtime_idle); - if (callback) + if (callback) { + dev_info(dev, "%s: before rpm_callback()\n", __func__); retval = __rpm_callback(callback, dev); - + dev_info(dev, "%s: after rpm_callback()\n", __func__); + } dev->power.idle_notification = false; wake_up_all(&dev->power.wait_queue); out: trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval); + dev_info(dev, "%s: end, retval = %d\n", __func__, retval); return retval ? retval : rpm_suspend(dev, rpmflags | RPM_AUTO); } @@ -498,12 +503,13 @@ static int rpm_suspend(struct device *dev, int rpmflags) int retval; trace_rpm_suspend_rcuidle(dev, rpmflags); + dev_info(dev, "%s: begin, rpmflags = %d\n", __func__, rpmflags); repeat: retval = rpm_check_suspend_allowed(dev); if (retval < 0) - ; /* Conditions are wrong. */ + dev_info(dev, "%s: rpm_check_suspend_allowed() returned %d\n", __func__, retval); /* Conditions are wrong. */ /* Synchronous suspends are not allowed in the RPM_RESUMING state. */ else if (dev->power.runtime_status == RPM_RESUMING && @@ -586,6 +592,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) dev->power.request_pending = true; queue_work(pm_wq, &dev->power.work); } + dev_info(dev, "%s: queued async suspend\n", __func__); goto out; } @@ -594,9 +601,13 @@ static int rpm_suspend(struct device *dev, int rpmflags) callback = RPM_GET_CALLBACK(dev, runtime_suspend); dev_pm_enable_wake_irq_check(dev, true); + dev_info(dev, "%s: before rpm_callback()\n", __func__); retval = rpm_callback(callback, dev); - if (retval) + dev_info(dev, "%s: after rpm_callback()\n", __func__); + if (retval) { + dev_info(dev, "%s: rpm_callback() returned %d\n", __func__, retval); goto fail; + } no_callback: __update_runtime_status(dev, RPM_SUSPENDED); @@ -612,6 +623,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) dev->power.deferred_resume = false; rpm_resume(dev, 0); retval = -EAGAIN; + dev_info(dev, "%s: carried out deferred resume\n", __func__); goto out; } @@ -628,7 +640,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) out: trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval); - + dev_info(dev, "%s: end, retval = %d\n", __func__, retval); return retval; fail: @@ -816,6 +828,7 @@ static int rpm_resume(struct device *dev, int rpmflags) callback = RPM_GET_CALLBACK(dev, runtime_resume); dev_pm_disable_wake_irq_check(dev); + dev_info(dev, "rpm_resume\n"); retval = rpm_callback(callback, dev); if (retval) { __update_runtime_status(dev, RPM_SUSPENDED); diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index b9a131137e64..a1815f06fd5e 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -1253,6 +1253,7 @@ static int pci_pm_runtime_suspend(struct device *dev) pci_dev->state_saved = false; error = pm->runtime_suspend(dev); if (error) { + dev_info(dev, "pm->runtime_suspend() returned %d\n", error); /* * -EBUSY and -EAGAIN is used to request the runtime PM core * to schedule a new suspend, so log the event only with debug diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b0c8c79848a9..ba693550d873 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1104,27 +1104,38 @@ static int azx_runtime_suspend(struct device *dev) struct azx *chip; struct hda_intel *hda; - if (!card) + if (!card) { + dev_info(dev, "%s: !card\n", __func__); return 0; + } chip = card->private_data; hda = container_of(chip, struct hda_intel, chip); - if (chip->disabled || hda->init_failed) + if (chip->disabled || hda->init_failed) { + dev_info(dev, "%s: chip->disabled || hda->init_failed\n", __func__); return 0; + } - if (!azx_has_pm_runtime(chip)) + if (!azx_has_pm_runtime(chip)) { + dev_info(dev, "%s: !azx_has_pm_runtime(chip)\n", __func__); return 0; + } /* enable controller wake up event */ + dev_info(dev, "%s: calling azx_writew()\n", __func__); azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | STATESTS_INT_MASK); + dev_info(dev, "%s: calling azx_stop_chip()\n", __func__); azx_stop_chip(chip); + dev_info(dev, "%s: calling azx_enter_link_reset()\n", __func__); azx_enter_link_reset(chip); + dev_info(dev, "%s: calling azx_clear_irq_pending()\n", __func__); azx_clear_irq_pending(chip); if ((chip->driver_caps & AZX_DCAPS_I915_POWERWELL) && hda->need_i915_power) snd_hdac_display_power(azx_bus(chip), false); + dev_info(dev, "%s: finished\n", __func__); trace_azx_runtime_suspend(chip); return 0; @@ -1189,14 +1200,19 @@ static int azx_runtime_idle(struct device *dev) struct azx *chip; struct hda_intel *hda; - if (!card) + if (!card) { + dev_info(dev, "%s: !card\n", __func__); return 0; + } chip = card->private_data; hda = container_of(chip, struct hda_intel, chip); - if (chip->disabled || hda->init_failed) + if (chip->disabled || hda->init_failed) { + dev_info(dev, "%s: chip->disabled || hda->init_failed\n", __func__); return 0; + } + dev_info(dev, "%s: !power_save_controller = %d, !azx_has_pm_runtime(chip) = %d, azx_bus(chip)->codec_powered = %#lx, !chip->running = %d\n", __func__, !power_save_controller, !azx_has_pm_runtime(chip), azx_bus(chip)->codec_powered, !chip->running); if (!power_save_controller || !azx_has_pm_runtime(chip) || azx_bus(chip)->codec_powered || !chip->running) return -EBUSY;