下面是跟踪log方法,可以调试suspend,resume,earlysuspend lateresume等方面的问题,如哪一过程时间过长,跟踪log才可以很好定位问题,解决问题。
1:early_suspend late_resume添加log
在earlysuspend.c中
static int debug_mask = DEBUG_USER_STATE;
->
static int debug_mask = DEBUG_USER_STATE | DEBUG_SUSPEND |
DEBUG_VERBOSE;
就可以打印出对应的设备。
2:resume suspend debug
在platform.c(driver/base)中添加log,打印相应设备:
int platform_pm_suspend(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->suspend)
ret = drv->pm->suspend(dev);
+printk("%s called name = %s\n",__func__,drv->name);
} else {
ret = platform_legacy_suspend(dev, PMSG_SUSPEND);
}
return ret;
}
int platform_pm_resume(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->resume)
ret = drv->pm->resume(dev);
+printk("%s called name = %s\n",__func__,drv->name);
} else {
ret = platform_legacy_resume(dev);
}
return ret;
}
log:
<6>[ 53.643766] request_suspend_state: sleep (0->3) at 53636581667
(1970-01-02 08:21:01.108440452 UTC)
<6>[ 53.651854] early_suspend: call handlers
<6>[ 53.655669] early_suspend: calling ft5x06_ts_early_suspend
<6>[ 53.663818] early_suspend: calling stop_drawing_early_suspend
<6>[ 53.682527] early_suspend: calling kgsl_early_suspend_driver
<6>[ 53.687166] early_suspend: calling msmfb_early_suspend
<6>[ 53.748298] msm_hsic_host msm_hsic_host: HSIC-USB exited from low
power mode
<3>[ 53.757271] mdp4_mixer_blend_setup: Error: no bg_pipe at mixer=0
<4>[ 53.762276] mipi_sharp_lcd_off
<6>[ 53.921562] mipi_dsi_lms_panel_power: on=0
<6>[ 53.926171] early_suspend: calling msmfb_early_suspend
<6>[ 53.930749] early_suspend: calling mdp_early_suspend
<3>[ 53.935235] dtv_pipe is not configured yet
<6>[ 53.951716] early_suspend: calling msmsdcc_early_suspend
<6>[ 53.955989] early_suspend: calling msmsdcc_early_suspend
<6>[ 53.961819] PM: Syncing filesystems...
<6>[ 53.966061] sync done.
<6>[ 53.967404] active wake lock msm_hsic_host
<6>[ 53.971463] active wake lock PowerManagerService
<6>[ 55.280024] msm_hsic_host msm_hsic_host: HSIC-USB in low power
mode
<6>[ 55.425301] msm_hsic_host msm_hsic_host: HSIC-USB exited from low
power mode
<6>[ 57.269342] msm_hsic_host msm_hsic_host: HSIC-USB in low power
mode
<6>[ 58.209522] suspend: enter suspend
<6>[ 58.211963] PM: suspend entry 1970-01-02 08:21:05.676635122 UTC
<6>[ 58.217945] PM: Syncing filesystems...
<6>[ 58.225911] sync done.
<6>[ 58.227468] PM: Syncing filesystems...
<6>[ 58.232992] sync done.
<4>[ 58.234640] Freezing user space processes ... (elapsed 0.04
seconds) done.
<4>[ 58.283076] Freezing remaining freezable tasks ... (elapsed 0.02
seconds) done.
<4>[ 58.312711] Suspending console(s) (use no_console_suspend to
debug)
<4>[ 58.330901] platform_pm_suspend called name = diag_bridge
<4>[ 58.331634] platform_pm_suspend called name = msm_hsic_host
<4>[ 58.331725] platform_pm_suspend called name = DIAG
<4>[ 58.331756] platform_pm_suspend called name = DIAG_CNTL
<4>[ 58.331909] platform_pm_suspend called name = APPS_RIVA_DATA
<4>[ 58.331970] platform_pm_suspend called name = APPS_RIVA_CTRL
<4>[ 58.333984] platform_pm_suspend called name = soc-audio
<4>[ 58.335876] PM_DEBUG_MXP:set max sleep time diff=1796.
<6>[ 58.335907] msm_pm_set_max_sleep_time: Requested 1796000000000 ns
Giving 58852442 sclk ticks
<4>[ 58.337494] platform_pm_suspend called name = tabla_codec
<4>[ 58.338806] platform_pm_suspend called name = msm_fb
<4>[ 58.338837] platform_pm_suspend called name = mdp
<6>[ 58.338989] msm_fb_ext_suspend: Turning off HPD circuitry
<4>[ 58.339203] platform_pm_suspend called name = msm_fb
<4>[ 58.339264] platform_pm_suspend called name = mdp
<4>[ 58.339294] platform_pm_suspend called name = dtv
<4>[ 58.339417] platform_pm_suspend called name = msm_fb
<4>[ 58.339447] platform_pm_suspend called name = mdp
<4>[ 58.343506] tsl2771_suspend Called
<4>[ 58.343842] platform_pm_suspend called name = gpio-keys
<4>[ 58.344269] platform_pm_suspend called name = kgsl-3d
<4>[ 58.344300] platform_pm_suspend called name = dtv
<4>[ 58.344391] platform_pm_suspend called name = mdp
<4>[ 58.344544] platform_pm_suspend called name = msm_fb
<4>[ 58.345246] platform_pm_suspend called name = msm_serial_hsl
<4>[ 58.345338] platform_pm_suspend called name = msm_slim_ctrl
<4>[ 58.346528] platform_pm_suspend called name = msm_sdcc
<4>[ 58.346589] platform_pm_suspend called name = msm_sdcc
<4>[ 58.346680] platform_pm_suspend called name = qup_i2c
<4>[ 58.346772] platform_pm_suspend called name = qup_i2c
<4>[ 58.346864] platform_pm_suspend called name = qup_i2c
<4>[ 58.346955] platform_pm_suspend called name = qup_i2c
<4>[ 58.347047] platform_pm_suspend called name = tsens8960-tm
<4>[ 58.347565] platform_pm_suspend called name = msm_vidc
<4>[ 58.348695] platform_pm_suspend called name = msm_watchdog
<4>[ 58.348817] platform_pm_suspend called name = wcnss_wlan
<4>[ 58.348878] platform_pm_suspend called name = msm_hsusb_host
<4>[ 58.348939] platform_pm_suspend called name = msm_otg
<4>[ 58.349214] platform_pm_suspend called name = pm8xxx-vib
<4>[ 58.349336] platform_pm_suspend called name = pm8xxx-tm
<4>[ 58.349580] platform_pm_suspend called name = pm8xxx-adc
<4>[ 58.349641] platform_pm_suspend called name = pm8921-charger
<4>[ 58.349702] platform_pm_suspend called name = pm8xxx-pwrkey
<4>[ 58.349763] platform_pm_suspend called name = rtc-pm8xxx
<4>[ 58.350099] platform_pm_suspend called name = msm_dmov
<4>[ 58.351045] platform_pm_suspend called name = power
<6>[ 58.351472] PM: suspend of devices complete after 23.775 msecs
<6>[ 58.355226] PM: late suspend of devices complete after 3.692 msecs
<6>[ 58.363528] power_suspend_late return 0
<6>[ 58.363558] PM: noirq suspend of devices complete after 8.301
msecs
<4>[ 58.363589] Disabling non-boot CPUs ...
<6>[ 58.364474] msm_pm_enter
<6>[ 58.364474] msm_pm_enter: power collapse
<6>[ 58.364474] msm_mpm_irqs_detectable: cannot monitor
000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000,00000000,00000000,00000000,00008000,00000000
<6>[ 58.364474] msm_pm_enter: return
<6>[ 58.371738] PM: noirq resume of devices complete after 6.470 msecs
<6>[ 58.375064] wakeup wake lock: event2-624
<6>[ 58.379337] PM: early resume of devices complete after 3.905
msecs //
<4>[ 58.381748] platform_pm_resume called name = power
<4>[ 58.382267] platform_pm_resume called name = msm_dmov
<4>[ 58.382450] platform_pm_resume called name = rtc-pm8xxx
<4>[ 58.382481] platform_pm_resume called name = pm8xxx-pwrkey
<4>[ 58.382542] platform_pm_resume called name = pm8921-charger
<4>[ 58.382572] platform_pm_resume called name = pm8xxx-adc
<4>[ 58.382694] platform_pm_resume called name = pm8xxx-tm
<4>[ 58.382755] platform_pm_resume called name = pm8xxx-vib
<4>[ 58.382908] platform_pm_resume called name = msm_otg
<4>[ 58.382939] platform_pm_resume called name = msm_hsusb_host
<4>[ 58.383000] platform_pm_resume called name = wcnss_wlan
<4>[ 58.383061] platform_pm_resume called name = msm_watchdog
<4>[ 58.383732] platform_pm_resume called name = msm_vidc
<4>[ 58.384037] platform_pm_resume called name = tsens8960-tm
<4>[ 58.384129] platform_pm_resume called name = qup_i2c
<4>[ 58.384190] platform_pm_resume called name = qup_i2c
<4>[ 58.384251] platform_pm_resume called name = qup_i2c
<4>[ 58.384312] platform_pm_resume called name = qup_i2c
<4>[ 58.384373] platform_pm_resume called name = msm_sdcc
<4>[ 58.384404] platform_pm_resume called name = msm_sdcc
<4>[ 58.384434] platform_pm_resume called name = msm_slim_ctrl
<4>[ 58.385319] platform_pm_resume called name = msm_serial_hsl
<4>[ 58.385380] platform_pm_resume called name = msm_fb
<4>[ 58.385472] platform_pm_resume called name = mdp
<4>[ 58.385533] platform_pm_resume called name = dtv
<4>[ 58.385594] platform_pm_resume called name = kgsl-3d
<4>[ 58.385869] platform_pm_resume called name = gpio-keys
<4>[ 58.386082] tsl2771_resume called
<4>[ 58.388921] platform_pm_resume called name = mdp
<4>[ 58.388951] platform_pm_resume called name = msm_fb
<4>[ 58.389012] platform_pm_resume called name = dtv
<4>[ 58.389043] platform_pm_resume called name = mdp
<6>[ 58.389256] msm_fb_ext_resume: Turning on HPD circuitry
<4>[ 58.389287] platform_pm_resume called name = msm_fb
<4>[ 58.389378] platform_pm_resume called name = mdp
<4>[ 58.389409] platform_pm_resume called name = msm_fb
<4>[ 58.390172] platform_pm_resume called name = tabla_codec
<4>[ 58.392675] platform_pm_resume called name = soc-audio
<4>[ 58.393834] platform_pm_resume called name = APPS_RIVA_CTRL
<4>[ 58.393865] platform_pm_resume called name = APPS_RIVA_DATA
<4>[ 58.393987] platform_pm_resume called name = DIAG_CNTL
<4>[ 58.394017] platform_pm_resume called name = DIAG
<4>[ 58.394109] platform_pm_resume called name = msm_hsic_host
<4>[ 58.395757] platform_pm_resume called name = diag_bridge
<6>[ 58.396184] PM: resume of devices complete after 16.836 msecs
<4>[ 58.937524] PS/ALS power not enable
<4>[ 58.940759] Restarting tasks ...
<4>[ 58.960598] QSEECOM: qseecom_receive_req: Interrupted: exiting
wait_rcv_req loop
<3>[ 58.967190] QSEECOM: qseecom_ioctl: failed qseecom_receive_req:
-512
<4>[ 58.973630] QSEECOM: qseecom_receive_req: Interrupted: exiting
wait_rcv_req loop
<4>[ 58.986967] done.
<3>[ 58.991301] QSEECOM: qseecom_ioctl: failed qseecom_receive_req:
-512
<6>[ 59.007294] PM: suspend exit 1970-01-02 08:21:08.615414069 UTC
<6>[ 59.012482] suspend: exit suspend, ret = 0 (1970-01-02
08:21:08.620600665 UTC)
<6>[ 59.145154] request_suspend_state: wakeup (3->0) at 59137427297
(1970-01-02 08:21:08.753199711 UTC)
<6>[ 59.153425] late_resume: call handlers
<6>[ 59.156966] late_resume: calling msmsdcc_late_resume
<6>[ 59.170517] late_resume: calling msmsdcc_late_resume
<6>[ 59.174576] late_resume: calling mdp_early_resume
<6>[ 59.207569] late_resume: calling msmfb_early_resume
<6>[ 59.215870] late_resume: calling msmfb_early_resume
<6>[ 59.263787] mipi_dsi_lms_panel_power: on=1
<4>[ 59.343323] mipi_sharp_lcd_on
<6>[ 59.423164] msm_hsic_host msm_hsic_host: HSIC-USB exited from low
power mode
<6>[ 59.478345] late_resume: calling kgsl_late_resume_driver
<6>[ 59.482923] late_resume: calling start_drawing_late_resume
<6>[ 59.494277] late_resume: calling ft5x06_ts_late_resume
<4>[ 59.498702] Set RESET: 0
<4>[ 59.552021] Set RESET: 1
<6>[ 59.553547] late_resume: done
<0>[ 59.579551] ALS average: 28mipi_set_backlight level =25.