[Nexus 4 Q&A, Help & Troubleshooting] XDA_Bam:
Hi guys,

I have a problem with my N4 ever since updating to 5.1: The phone randomly reboots every two to five days while it's asleep. The screens lights up, the Google logo shows and it boots up normally. The device is rooted, now running LMY48T stock ROM with stock recovery. I upgraded to the latest handful of security releases by manually flashing radio, recovery, boot and system from factory images via fastboot.

Did a quick search and came up with 2 similar threads ([1],[2]) on the forums and this one on the Google forums. There's a multitude of solutions discussed (safe mode, keep WiFi off, keep Bluetooth on, clear cache, full wipe), but none is confirmed to be a global solution - probably because nobody seems to know what the actual problem is. I always cleared the cache after any update and because I flashed partitions from 4 or 5 factory images since the problem first appeared, it can't be a problem with corrupt images. Didn't try the other "solutions" yet, because they're all just poking around in the dark.

But I got lucky an hour ago and caught a reboot while the phone was sitting on the table in front of me. I tried a logcat, but this seems to show the after-boot stuff only. But the last_kmesg got it:

[28518.648487] msm_pm_enter
[28518.648487] msm_pm_enter: power collapse
[28518.648487] msm_mpm_irqs_detectable: cannot monitor 000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000
[28518.648487] msm_pm_enter: return
[28518.648487] gic_show_resume_irq: 234 triggered
[28518.648487] Resume caused by IRQ 234, wcnss_wlan
[28518.650288] PM: noirq resume of devices complete after 1.586 msecs
[28518.652669] PM: early resume of devices complete after 0.976 msecs
[28518.654408] wakeup wake lock: qcom_rx_wakelock
[28518.657064] msm_fb_ext_resume: Turning on HPD circuitry
[28518.660665] PM: resume of devices complete after 7.963 msecs
[28518.662954] Restarting tasks ... done.
[28518.665518] PM: suspend exit 2015-10-14 15:36:25.007841530 UTC
[28518.665640] suspend: exit suspend, ret = 0 (2015-10-14 15:36:25.007963577 UTC)
[28518.665701] active wake lock qcom_rx_wakelock, time left 3
[28518.665823] suspend: abort suspend
[28518.695489] wake lock qcom_rx_wakelock, expired
[28518.695763] PM: Syncing filesystems...
[28518.704279] suspend: enter suspend
[28518.704431] PM: suspend entry 2015-10-14 15:36:25.046700550 UTC
[28518.706720] sync done.
[28518.706842] PM: Syncing filesystems...
[28518.716670] sync done.
[28518.773163] Freezing user space processes ... (elapsed 0.005 seconds) done.
[28518.779359] Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
[28518.783632] Suspending console(s) (use no_console_suspend to debug)
[28518.795443] msm_fb_ext_suspend: Turning off HPD circuitry
[28518.812870] PM: suspend of devices complete after 25.373 msecs
[28518.814488] PM: late suspend of devices complete after 1.585 msecs
[28518.817875] power_suspend_late return 0
[28518.817906] PM: noirq suspend of devices complete after 3.415 msecs
[28518.817936] Disabling non-boot CPUs ...
[28518.818791] msm_pm_enter
[28518.818791] msm_pm_enter: power collapse
[28518.818791] msm_mpm_irqs_detectable: cannot monitor 000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000
[28518.818791] msm_pm_enter: return
[28518.818791] gic_show_resume_irq: 234 triggered
[28518.818791] Resume caused by IRQ 234, wcnss_wlan
[28518.821996] PM: noirq resume of devices complete after 2.653 msecs
[28518.825414] PM: early resume of devices complete after 1.555 msecs
[28518.828374] wakeup wake lock: qcom_rx_wakelock
[28518.832861] msm_fb_ext_resume: Turning on HPD circuitry
[28518.837195] PM: resume of devices complete after 11.741 msecs
[28518.839514] Restarting tasks ... done.
[28518.842231] PM: suspend exit 2015-10-14 15:36:29.008051614 UTC
[28518.842292] suspend: exit suspend, ret = 0 (2015-10-14 15:36:29.008143110 UTC)
[28518.842383] active wake lock qcom_rx_wakelock, time left 4
[28518.842444] suspend: abort suspend
[28518.877054] wake lock qcom_rx_wakelock, expired
[28518.877237] PM: Syncing filesystems...
[28518.885692] suspend: enter suspend
[28518.885844] PM: suspend entry 2015-10-14 15:36:29.051657969 UTC
[28518.889873] sync done.
[28518.890117] PM: Syncing filesystems...
[28518.901288] sync done.
[28518.953142] Freezing user space processes ... (elapsed 0.005 seconds) done.
[28518.959215] Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
[28518.963274] Suspending console(s) (use no_console_suspend to debug)
[28518.975269] msm_fb_ext_suspend: Turning off HPD circuitry
[28518.992604] PM: suspend of devices complete after 25.283 msecs
[28518.994222] PM: late suspend of devices complete after 1.585 msecs
[28518.997640] power_suspend_late return 0
[28518.997671] PM: noirq suspend of devices complete after 3.415 msecs
[28518.997671] Disabling non-boot CPUs ...
[28518.998556] msm_pm_enter
[28518.998556] msm_pm_enter: power collapse
[28518.998556] msm_mpm_irqs_detectable: cannot monitor 000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000
[28518.998556] msm_pm_enter: return
[28518.998556] gic_show_resume_irq: 230 triggered
[28518.998556] Resume caused by IRQ 230, smd_dev
[28519.001761] PM: noirq resume of devices complete after 2.653 msecs
[28519.005270] PM: early resume of devices complete after 1.525 msecs
[28519.010612] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28519.011039] wakeup wake lock: event0-585
[28519.012351] msm_fb_ext_resume: Turning on HPD circuitry
[28519.016899] PM: resume of devices complete after 11.620 msecs
[28519.019279] Restarting tasks ... done.
[28519.029961] PM: suspend exit 2015-10-14 15:36:39.014333914 UTC
[28519.030084] suspend: exit suspend, ret = 0 (2015-10-14 15:36:39.014455882 UTC)
[28519.030145] active wake lock alarm, time left 500
[28519.030236] suspend: abort suspend
[28528.470065] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28528.475895] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28528.476017] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -74, Alpha 5
[28528.496587] adjust_soc: ibat_ua = 297200, vbat_uv = 3830741, soc = 57, batt_temp=238
[28528.518226] active wake lock alarm, time left 500
[28528.518318] suspend: abort suspend
[28528.518501] active wake lock alarm, time left 500
[28528.518562] suspend: abort suspend
[28528.518989] active wake lock alarm, time left 500
[28528.519050] suspend: abort suspend
[28528.519325] active wake lock alarm, time left 500
[28528.519417] suspend: abort suspend
[28528.519905] active wake lock alarm, time left 500
[28528.519966] suspend: abort suspend
[28528.520363] active wake lock alarm, time left 500
[28528.520424] suspend: abort suspend
[28528.520760] active wake lock alarm, time left 500
[28528.520882] suspend: abort suspend
[28528.521217] active wake lock alarm, time left 500
[28528.521339] suspend: abort suspend
[28528.521675] active wake lock alarm, time left 500
[28528.521736] suspend: abort suspend
[28528.522133] active wake lock alarm, time left 500
[28528.522194] suspend: abort suspend
[28528.522438] active wake lock alarm, time left 500
[28528.522560] suspend: abort suspend
[28528.522957] active wake lock alarm, time left 500
[28528.523049] suspend: abort suspend
[28528.523415] active wake lock alarm, time left 500
[28528.523476] suspend: abort suspend
[28528.523689] active wake lock alarm, time left 500
[28528.523812] suspend: abort suspend
[28528.524117] active wake lock alarm, time left 500
[28528.524208] suspend: abort suspend
[28537.426909] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28537.466738] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28538.431152] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28538.431396] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -74, Alpha 5
[28539.806583] wlan: [27367:E :SME] csrNeighborRoamResultsRefreshTimerCallback: 2615: Non 11R or CCX Association:results refresh timer expired
[28544.910169] healthd: battery l=57 v=3832 t=23.8 h=2 st=3 c=322 chg=
[28545.312641] wlan: [27367:E :SME] csrNeighborRoamPrepareScanProfileFilter: 1197: Filtering for SSID ******** from scan results,length of SSID = 11
[28545.312824] wlan: [27367:E :SME] csrNeighborRoamProcessScanComplete: 1867: No candidate found after scanning in state 3..
[28549.796694] adjust_soc: ibat_ua = 210900, vbat_uv = 3838052, soc = 58, batt_temp=237
[28549.805881] healthd: battery l=57 v=3839 t=23.8 h=2 st=3 c=254 chg=
[28557.704462] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28557.746610] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28558.700463] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28558.700799] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28562.721492] healthd: battery l=57 v=3850 t=23.8 h=2 st=3 c=165 chg=
[28566.003500] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28566.036462] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28567.000814] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28567.001028] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28572.460665] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28572.496679] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28573.461062] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28573.461458] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28579.829259] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28579.876566] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28580.166754] adjust_soc: ibat_ua = 245800, vbat_uv = 3826937, soc = 58, batt_temp=238
[28580.174750] healthd: battery l=57 v=3839 t=23.8 h=2 st=3 c=245 chg=
[28580.980152] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28580.980518] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28583.295153] healthd: battery l=57 v=3839 t=23.8 h=2 st=3 c=222 chg=
[28586.280808] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28586.316487] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28587.280473] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28587.280839] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28588.904736] suspend: enter suspend
[28588.904858] PM: suspend entry 2015-10-14 15:37:48.888561905 UTC
[28588.904950] PM: Syncing filesystems...
[28588.973773] Freezing user space processes ... (elapsed 0.002 seconds) done.
[28588.980427] sync done.
[28589.216502] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[28589.218760] Suspending console(s) (use no_console_suspend to debug)
[28589.222698] msm_fb_ext_suspend: Turning off HPD circuitry
[28589.239606] PM: suspend of devices complete after 19.319 msecs
[28589.240796] PM: late suspend of devices complete after 1.159 msecs
[28589.243146] active wake lock alarm, time left 473
[28589.243146] power_suspend_late return -11
[28589.243177] dpm_run_callback(): power_suspend_late+0x0/0x58 returns -11
[28589.243207] PM: Device power.0 failed to suspend noirq: error -11
[28589.244642] PM: noirq resume of devices complete after 1.434 msecs
[28589.247328] PM: early suspend of devices complete after 1.251 msecs
[28589.247328] PM: Some devices failed to power down
[28589.250837] msm_fb_ext_resume: Turning on HPD circuitry
[28589.252119] PM: resume of devices complete after 4.761 msecs
[28589.254011] Restarting tasks ... done.
[28589.256697] PM: suspend exit 2015-10-14 15:37:49.240370238 UTC
[28589.256758] suspend: exit suspend, ret = -11 (2015-10-14 15:37:49.240461800 UTC)
[28589.256850] active wake lock alarm, time left 471
[28589.256911] suspend: abort suspend
[28594.575971] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28594.606461] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28595.580335] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28595.580671] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28600.103546] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28600.146610] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28600.485112] wlan: [27367:E :TL ] Current Region number is 0, cannot decrease anymore
[28600.485325] wlan: [27367:E :TL ] ----> CRegion 0, hRSSI -79, Alpha 5
[28600.485783] wlan: [27367:E :TL ] ----> CRegion 0, hRSSI -79, Alpha 5
[28600.486058] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28600.486546] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28600.487065] wlan: [27367:E :TL ] ----> CRegion 0, hRSSI -79, Alpha 5
[28600.487309] wlan: [27367:E :TL ] ----> CRegion 0, hRSSI -79, Alpha 5
[28600.487767] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28600.488011] wlan: [27367:E :TL ] ----> CRegion 1, hRSSI -79, Alpha 5
[28600.733212] wlan: [27367:E :SME] csrNeighborRoamPrepareScanProfileFilter: 1197: Filtering for SSID ******** from scan results,length of SSID = 11
[28600.733792] wlan: [27367:E :SME] csrNeighborRoamProcessScanComplete: 1867: No candidate found after scanning in state 3..
[28600.734250] wlan: [27367:E :SME] csrNeighborRoamHandleEmptyScanResult: 1669: Registering DOWN event neighbor lookup callback with TL for RSSI = -79
[28600.973071] wlan: [27367:E :SME] csrNeighborRoamPrepareScanProfileFilter: 1197: Filtering for SSID ******** from scan results,length of SSID = 11
[28600.973651] wlan: [27367:E :SME] csrNeighborRoamProcessScanComplete: 1867: No candidate found after scanning in state 3..
[28601.110993] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28601.716670] adjust_soc: ibat_ua = 192800, vbat_uv = 3831619, soc = 57, batt_temp=238
[28604.752989] wlan: [27367:E :SME] csrNeighborRoamPrepareScanProfileFilter: 1197: Filtering for SSID ******** from scan results,length of SSID = 11
[28604.753416] wlan: [27367:E :SME] csrNeighborRoamProcessScanComplete: 1797: Get Scan Result status code 39
[28604.753783] wlan: [27367:E :SME] csrNeighborRoamProcessScanComplete: 1867: No candidate found after scanning in state 3..
[28605.301928] healthd: battery l=57 v=3834 t=23.8 h=2 st=3 c=226 chg=
[28618.545023] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28618.586592] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28619.313984] healthd: battery l=57 v=3824 t=23.8 h=2 st=3 c=272 chg=
[28619.540384] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28622.376642] adjust_soc: ibat_ua = 215400, vbat_uv = 3826353, soc = 57, batt_temp=238
[28624.991872] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28625.026543] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28625.990224] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28633.291887] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28633.336447] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28634.300067] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6
[28650.799227] wlan: [27367:E :PE ] limDeactivateAndChangeTimer: 1438: Deactivated probe after hb timer
[28650.846534] wlan: [27367:E :PE ] limHandleHeartBeatFailureTimeout: 7199: Probe_hb_failure: SME 12, MLME 16, HB-Count 1
[28651.800143] wlan: [27367:E :SME] sme_QosPmcDeviceStateUpdateInd: 7219: nothing to process in PMC state 6

No errors detected
Boot info:
Last boot reason: watchdog

I once did some kernel hacking on a Samsung phone, but I'm no pro and do not really know what the log is telling me. Can anybody who know's have a look and help identify the problem? :confused: Any help is greatly appreciated - this bug is really bugging me!

(sorry for pun)