forked from Minki/linux
PM: sleep: Add device name to suspend_report_result()
Currently, suspend_report_result() prints only function information. If any driver uses a common PM function, nobody knows who exactly called the failing function. A device pinter is needed to recognize the failing device. For example: PM: dpm_run_callback(): pnp_bus_suspend+0x0/0x10 returns 0 PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns 0 become after the change: serial 00:05: PM: dpm_run_callback(): pnp_bus_suspend+0x0/0x10 returns 0 pci 0000:00:01.3: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns 0 Signed-off-by: Youngjin Jang <yj84.jang@samsung.com> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
7a64ca17e4
commit
a759de6991
@ -485,7 +485,7 @@ static int dpm_run_callback(pm_callback_t cb, struct device *dev,
|
||||
trace_device_pm_callback_start(dev, info, state.event);
|
||||
error = cb(dev);
|
||||
trace_device_pm_callback_end(dev, error);
|
||||
suspend_report_result(cb, error);
|
||||
suspend_report_result(dev, cb, error);
|
||||
|
||||
initcall_debug_report(dev, calltime, cb, error);
|
||||
|
||||
@ -1568,7 +1568,7 @@ static int legacy_suspend(struct device *dev, pm_message_t state,
|
||||
trace_device_pm_callback_start(dev, info, state.event);
|
||||
error = cb(dev, state);
|
||||
trace_device_pm_callback_end(dev, error);
|
||||
suspend_report_result(cb, error);
|
||||
suspend_report_result(dev, cb, error);
|
||||
|
||||
initcall_debug_report(dev, calltime, cb, error);
|
||||
|
||||
@ -1855,7 +1855,7 @@ unlock:
|
||||
device_unlock(dev);
|
||||
|
||||
if (ret < 0) {
|
||||
suspend_report_result(callback, ret);
|
||||
suspend_report_result(dev, callback, ret);
|
||||
pm_runtime_put(dev);
|
||||
return ret;
|
||||
}
|
||||
@ -1960,10 +1960,10 @@ int dpm_suspend_start(pm_message_t state)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dpm_suspend_start);
|
||||
|
||||
void __suspend_report_result(const char *function, void *fn, int ret)
|
||||
void __suspend_report_result(const char *function, struct device *dev, void *fn, int ret)
|
||||
{
|
||||
if (ret)
|
||||
pr_err("%s(): %pS returns %d\n", function, fn, ret);
|
||||
dev_err(dev, "%s(): %pS returns %d\n", function, fn, ret);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__suspend_report_result);
|
||||
|
||||
|
@ -596,7 +596,7 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state)
|
||||
int error;
|
||||
|
||||
error = drv->suspend(pci_dev, state);
|
||||
suspend_report_result(drv->suspend, error);
|
||||
suspend_report_result(dev, drv->suspend, error);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@ -775,7 +775,7 @@ static int pci_pm_suspend(struct device *dev)
|
||||
int error;
|
||||
|
||||
error = pm->suspend(dev);
|
||||
suspend_report_result(pm->suspend, error);
|
||||
suspend_report_result(dev, pm->suspend, error);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@ -821,7 +821,7 @@ static int pci_pm_suspend_noirq(struct device *dev)
|
||||
int error;
|
||||
|
||||
error = pm->suspend_noirq(dev);
|
||||
suspend_report_result(pm->suspend_noirq, error);
|
||||
suspend_report_result(dev, pm->suspend_noirq, error);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@ -1010,7 +1010,7 @@ static int pci_pm_freeze(struct device *dev)
|
||||
int error;
|
||||
|
||||
error = pm->freeze(dev);
|
||||
suspend_report_result(pm->freeze, error);
|
||||
suspend_report_result(dev, pm->freeze, error);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
@ -1030,7 +1030,7 @@ static int pci_pm_freeze_noirq(struct device *dev)
|
||||
int error;
|
||||
|
||||
error = pm->freeze_noirq(dev);
|
||||
suspend_report_result(pm->freeze_noirq, error);
|
||||
suspend_report_result(dev, pm->freeze_noirq, error);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
@ -1116,7 +1116,7 @@ static int pci_pm_poweroff(struct device *dev)
|
||||
int error;
|
||||
|
||||
error = pm->poweroff(dev);
|
||||
suspend_report_result(pm->poweroff, error);
|
||||
suspend_report_result(dev, pm->poweroff, error);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
@ -1154,7 +1154,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
|
||||
int error;
|
||||
|
||||
error = pm->poweroff_noirq(dev);
|
||||
suspend_report_result(pm->poweroff_noirq, error);
|
||||
suspend_report_result(dev, pm->poweroff_noirq, error);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ static int __pnp_bus_suspend(struct device *dev, pm_message_t state)
|
||||
|
||||
if (pnp_drv->driver.pm && pnp_drv->driver.pm->suspend) {
|
||||
error = pnp_drv->driver.pm->suspend(dev);
|
||||
suspend_report_result(pnp_drv->driver.pm->suspend, error);
|
||||
suspend_report_result(dev, pnp_drv->driver.pm->suspend, error);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ static int suspend_common(struct device *dev, bool do_wakeup)
|
||||
HCD_WAKEUP_PENDING(hcd->shared_hcd))
|
||||
return -EBUSY;
|
||||
retval = hcd->driver->pci_suspend(hcd, do_wakeup);
|
||||
suspend_report_result(hcd->driver->pci_suspend, retval);
|
||||
suspend_report_result(dev, hcd->driver->pci_suspend, retval);
|
||||
|
||||
/* Check again in case wakeup raced with pci_suspend */
|
||||
if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) ||
|
||||
@ -556,7 +556,7 @@ static int hcd_pci_suspend_noirq(struct device *dev)
|
||||
dev_dbg(dev, "--> PCI %s\n",
|
||||
pci_power_name(pci_dev->current_state));
|
||||
} else {
|
||||
suspend_report_result(pci_prepare_to_sleep, retval);
|
||||
suspend_report_result(dev, pci_prepare_to_sleep, retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -770,11 +770,11 @@ extern int dpm_suspend_late(pm_message_t state);
|
||||
extern int dpm_suspend(pm_message_t state);
|
||||
extern int dpm_prepare(pm_message_t state);
|
||||
|
||||
extern void __suspend_report_result(const char *function, void *fn, int ret);
|
||||
extern void __suspend_report_result(const char *function, struct device *dev, void *fn, int ret);
|
||||
|
||||
#define suspend_report_result(fn, ret) \
|
||||
#define suspend_report_result(dev, fn, ret) \
|
||||
do { \
|
||||
__suspend_report_result(__func__, fn, ret); \
|
||||
__suspend_report_result(__func__, dev, fn, ret); \
|
||||
} while (0)
|
||||
|
||||
extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
|
||||
@ -814,7 +814,7 @@ static inline int dpm_suspend_start(pm_message_t state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define suspend_report_result(fn, ret) do {} while (0)
|
||||
#define suspend_report_result(dev, fn, ret) do {} while (0)
|
||||
|
||||
static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user