This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM37x: loop when entering suspend mode

Hello, I am porting Android 4.0 to a DM37x board. I used the rowboat kernel (rowboat-kernel-2.6.37 branch) as a base and added my device-specific board files and drivers on top. I am facing an issue when entering suspend mode: it seems that something (probably a wakelock) wakes the device right after suspend and it goes into a loop:

request_suspend_state: sleep (0->3) at 84432126265 (2000-01-01 00:01:21.405057172 UTC)
PM: Syncing filesystems ... done.
PM: Preparing system for mem sleep
Freezing user space processes ...
Freezing of user space  aborted

Restarting tasks ... done.
suspend: exit suspend, ret = -16 (2000-01-01 00:01:21.450275136 UTC)
PM: Syncing filesystems ... done.
PM: Preparing system for mem sleep
Freezing user space processes ... (elapsed 0.02 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
PM: Entering mem sleep
td028ttec1_panel_suspend()
gta04_disable_lcd()
PM: suspend of devices complete after 142.365 msecs
PM: late suspend of devices complete after 0.335 msecs
Successfully put all powerdomains to target state
PM: early resume of devices complete after 0.213 msecs
td028ttec1_panel_resume()
platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
gta04_enable_lcd()
wakeup wake lock: event0-1086
PM: resume of devices complete after 590.118 msecs
PM: Finishing wakeup.
Restarting tasks ... done.
suspend: exit suspend, ret = 0 (2000-01-01 00:01:23.544219970 UTC)
PM: Syncing filesystems ... done.
PM: Preparing system for mem sleep
Freezing user space processes ... (elapsed 0.01 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
PM: Entering mem sleep
td028ttec1_panel_suspend()
gta04_disable_lcd()
PM: suspend of devices complete after 142.120 msecs
PM: late suspend of devices complete after 0.335 msecs
Successfully put all powerdomains to target state
PM: early resume of devices complete after 0.183 msecs
td028ttec1_panel_resume()
platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
gta04_enable_lcd()
wakeup wake lock: event0-1086
PM: resume of devices complete after 583.282 msecs
PM: Finishing wakeup.
Restarting tasks ... done.
suspend: exit suspend, ret = 0 (2000-01-01 00:01:24.535400390 UTC)
PM: Syncing filesystems ... done.
PM: Preparing system for mem sleep
Freezing user space processes ... (elapsed 0.02 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
PM: Entering mem sleep
td028ttec1_panel_suspend()
gta04_disable_lcd()
PM: suspend of devices complete after 141.540 msecs
PM: late suspend of devices complete after 0.335 msecs
Successfully put all powerdomains to target state
PM: early resume of devices complete after 0.183 msecs
td028ttec1_panel_resume()
platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
gta04_enable_lcd()
wakeup wake lock: event0-1086
PM: resume of devices complete after 583.831 msecs
PM: Finishing wakeup.
Restarting tasks ... done.
suspend: exit suspend, ret = 0 (2000-01-01 00:01:25.524902342 UTC)
PM: Syncing filesystems ... done.
PM: Preparing system for mem sleep
Freezing user space processes ... (elapsed 0.02 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
PM: Entering mem sleep
td028ttec1_panel_suspend()
gta04_disable_lcd()
PM: suspend of devices complete after 148.986 msecs
PM: late suspend of devices complete after 0.335 msecs
Powerdomain (core_pwrdm) didn't enter target state 1
Powerdomain (usbhost_pwrdm) didn't enter target state 1
Could not enter target state in pm_suspend
PM: early resume of devices complete after 0.183 msecs
td028ttec1_panel_resume()
platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
gta04_enable_lcd()
wakeup wake lock: event0-1086
PM: resume of devices complete after 584.259 msecs
PM: Finishing wakeup.
Restarting tasks ... done.
request_suspend_state: wakeup (3->0) at 98690124448 (2000-01-01 00:01:38.516906738 UTC)
done.
suspend: exit suspend, ret = 0 (2000-01-01 00:01:38.527648924 UTC)

Thanks for your help!

  • Hi Paul,

    The system is entering into complete suspend state, it looks from the logs. But a H/W wake up event is immediately causing resume. So some GPIO/SYSNIRQ line is already triggered a wake up event while going into suspend state. Can you check if the MUX settings for the SYSNIRQ line is configured like this for beagleboard?

    --- a/arch/arm/mach-omap2/board-omap3beagle.c
    +++ b/arch/arm/mach-omap2/board-omap3beagle.c
    @@ -856,6 +856,9 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
     
     #ifdef CONFIG_OMAP_MUX
     static struct omap_board_mux board_mux[] __initdata = {
    +    OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP |
    +                OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
    +                OMAP_PIN_OFF_WAKEUPENABLE),
            { .reg_offset = OMAP_MUX_TERMINATOR },
     };
     #endif

    Regards,

    Arun

  • Hi Arun,

    The MUX setting is indeed configured that way, just like the beagleboard code and this issue keeps happening.

    By board is lacking twl4030 power scripts: should I try to add some from other boards to maybe see the issue disappear?

  • Paul,

    Do you set enable_off_mode in debugfs? If yes, then you need to initialize twl4030 power scripts.

    Also can you check all GPIOs which has ".wakeup" field set.

    Regards,

    Arun

  • Hi Arun,

    enable_off_mode is not set in debugfs (and it fails with it enabled too). I didn't add any GPIO with a wakeup field on my board file (even disabled gpio keys).

    Would it help if I provide you the wakeup_sources from debugfs?

  • It seems to be because of a UART wakeup: when I disable omap_uart.1 wakeup, it goes to suspend fine. That's the Bluetooth UART line: I wonder whether this is actually the chip writing something to the uart or a problem in the kernel.

    Anyways, now that it suspends correctly, there still seems to be an issue at wakeup (which causes the endless loop problem): when I wakeup the device (by writing to the console UART for instance), it wakes up and instantly goes back to suspend (which works now):

    Powerdomain (core_pwrdm) didn't enter target state 1
    Could not enter target state in pm_suspend
    PM: early resume of devices complete after 0.213 msecs
    td028ttec1_panel_resume()
    platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
    platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
    gta04_enable_lcd()
    musb android_usb gadget disconnected.
    wakeup wake lock: event0-1970
    PM: resume of devices complete after 587.463 msecs
    PM: Finishing wakeup.
    Restarting tasks ...
    adb_release
    adb_open
    done.
    suspend: exit suspend, ret = 0 (2000-01-01 09:46:38.563537598 UTC)
    PM: Syncing filesystems ... done.
    PM: Preparing system for mem sleep
    Freezing user space processes ... (elapsed 0.02 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    PM: Entering mem sleep
    android_usb gadget: high speed config #1: android
    td028ttec1_panel_suspend()
    gta04_disable_lcd()
    PM: suspend of devices complete after 149.719 msecs
    PM: late suspend of devices complete after 0.335 msecs