Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Logic PD support staff and engineers participate, Logic PD does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Logic PD engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Logic PD product download, please subscribe to the TDG Forum of interest.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 31 Aug 2018 01:20 PM by  William Deninger
Mainstream Linux 4.4.y DM3730 Sleep
 13 Replies
Sort:
You are not authorized to post a reply.
Author Messages

William Deninger



New Member


Posts:22
New Member


--
23 Aug 2018 01:42 PM

    Hi Adam, 
    When I try to place the Torpedo DM3730 SOM (w WIFI) into a sleep (standby) state under Mainstream Linux 2018.05.x using 4.4.76, I receive a write error to /sys/power/state. I had modified (and verified) the u-boot optargs environment "no console suspend" was removed using nand unlock, setenv ... and saveenv, reset and printenv optargs. The example you had given under the topic Mainstream DM37x Linux (shown below) could not have been correct in that expected values for state must be 'disk', 'freeze' or 'standby' according to https://01.org/linuxgraphics/gfx-do...tates.html

    modprobe twl4030-pwrbutton
    # mount -t debugfs none /sys/kernel/debug
    # echo 1 > /sys/kernel/debug/pm_debug/enable_off_mode
    # echo 1 > /sys/power/state
    sh: write error: Invalid argument

    Further, within the make linux-menuconfig one finds the option "Power management options ---> Suspend to RAM and standby" the only enabled option.  But if "Hibernation (aka 'suspend to disk') is also enabled, a register /sys/power/disk appears in the rootfs.  This suggests that a register '/sys/power/standby' and/or '/sys/power/freeze' is/are missing, resulting in the Invalid argement errors shown below.

    # echo 'freeze' > state
    sh: write error: Invalid argument
    # echo 'suspend' > state
    sh: write error: Invalid argument

    Has there been a change in the branch 2018.05.x that might cause this? Or perhaps there was a modification on your system at the time that had not been committed??   Any help you could provide me in obtaining a functional standby state on the DM3730 Torpedo (with wifi) would be greatly appreciated.


    -William

     


    William Deninger



    New Member


    Posts:22
    New Member


    --
    24 Aug 2018 05:22 PM

    I reverted back to the Linux 3.0 demo sdcard shipped with the logicpd, and under Linux 3.0 suspend does function albiet using a slightly different /sys/power/state implementation than the newer Linux 4.4.y.


    bradb



    Basic Member


    Posts:196
    Basic Member


    --
    27 Aug 2018 10:21 AM
    William,

    Per DM37x Mainstream Linux BSP User Guide (Beta) section 4.16 Run/Idle/Suspend it recommend using the following command:
    # echo mem > /sys/power/state

    This manual supports 4.9.x kernel version. Please consider downloading the latest manual as this provides more tested feature.

    5/8/2018 DM37x Mainstream Linux BSP User Guide (Beta) zip Rev C 2.1 Mb

    Thanks,
    Brad



    William Deninger



    New Member


    Posts:22
    New Member


    --
    27 Aug 2018 01:41 PM

    Hi Brad,

    Although not included in the original email, attempts to write 'mem' into /sys/poser/state have been tried and yield the same results.  I had provided a link to the Linux power management instructions (Basic Interfaces for System Suspend and Hibernation) in the original posting as well (https://01.org/linuxgraphics/gfx-do...tes.html).

    # echo 'mem' > /sys/power/state
    sh: write error: Invalid argument

    According to the Linux power management link, in order for 'mem' to be a valid argument, a 'mem_sleep' file would need to be present in the /sys/power directory.  It is not.

    -W


    bradb



    Basic Member


    Posts:196
    Basic Member


    --
    27 Aug 2018 01:45 PM
    William,

    I agree in that I don't see information indicating this was tested with kernel 4.4.y. Can you update to kernel 4.9? This feature and many more has been tested within kernel 4.9 and should work.

    Thanks,
    Brad

    William Deninger



    New Member


    Posts:22
    New Member


    --
    27 Aug 2018 04:20 PM

    OK... will do.


    William Deninger



    New Member


    Posts:22
    New Member


    --
    28 Aug 2018 01:19 PM

    Following update to the 4.9.89 kernel, I see that both freeze and mem are available options for /sys/power/state.  And writing 'mem' does seem to place the processor into a suspended state. 

    However, it should be of note that the 'mem' suspend draws approximately 170mW (SOM Backup battery) under Mainstream Linux 4.9.89, whereas only draws 4mW under the LTIB Linux 3.0.0 build.

    -William 


    William Deninger



    New Member


    Posts:22
    New Member


    --
    28 Aug 2018 02:39 PM

    Mainstream Linux 4.9.89 echo 'mem' /sys/power/state never reaches pm_suspend target state 1.

    [ 4667.162841] PM: Suspending system (mem)
    [ 4667.285827] PM: suspend of devices complete after 118.041 msecs
    [ 4667.293731] PM: late suspend of devices complete after 1.647 msecs
    [ 4667.302642] PM: noirq suspend of devices complete after 2.227 msecs
    [ 4667.309356] Powerdomain (core_pwrdm) didn't enter target state 1
    [ 4667.309356] Could not enter target state in pm_suspend
    [ 4667.309356] Suspended for 6.743 seconds

    bradb



    Basic Member


    Posts:196
    Basic Member


    --
    29 Aug 2018 11:15 AM
    William,

    I have confirmed the power usage you reported in the suspend mode using kernel 4.9.x. The message indicating that it never reaches pm_suspend target state 1 is due to one or more drivers not supporting suspend/resume.

    This has been filed as LDMLK-69 internally and will be investigated further. We will get back with you if additional development is need to reduce the power usage similar to that what is seen in the earlier kernel revision.

    Thanks,
    Brad


    William Deninger



    New Member


    Posts:22
    New Member


    --
    29 Aug 2018 03:43 PM

    Mainstream Linux 4.9.122 (NOTE minor version upgrade).

    I've removed all drivers possible from the linux-menuconfig, but the results appear the same; "Could not enter target state in pm_suspend". All remaining modules loaded or static in the kernel have been listed below.

    To further my exploration, how would I remove video drivers or I2C drivers?? These don't seem to appear anywhere in the make menuconfig or make linux-menuconfig options other than those already disabled.

     

    -William

     

    # echo 'mem' > /sys/power/state
    [   22.133483] PM: Syncing filesystems ... done.
    [   22.141906] PM: Preparing system for sleep (mem)
    [   22.148956] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [   22.157806] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [   22.167114] PM: Suspending system (mem)
    [   22.171997] PM: suspend of devices complete after 0.610 msecs
    [   22.178375] PM: late suspend of devices complete after 0.335 msecs
    [   22.185424] PM: noirq suspend of devices complete after 0.518 msecs
    [   22.191955] Powerdomain (core_pwrdm) didn't enter target state 1
    [   22.191955] Could not enter target state in pm_suspend

    [   22.191955] Suspended for 1.192 seconds
    [   22.192382] PM: noirq resume of devices complete after 0.366 msecs
    [   22.203216] PM: early resume of devices complete after 0.213 msecs
    [   22.210113] PM: resume of devices complete after 0.396 msecs
    [   22.216278] PM: Finishing wakeup.
    [   22.219726] Restarting tasks ... [   22.223571] omapdss_dss 48050000.dss: master bind failed: -517
    [   22.230041] panel-dpi display: failed to find video source
     [   22.237243] done.
    sh: write error: Operation not permitted

    #  lsmod
    Module                  Size  Used by

     

     

    # cat /lib/modules/$(uname -r)/modules.builtin
    kernel/kernel/configs.ko
    kernel/fs/binfmt_misc.ko
    kernel/fs/binfmt_script.ko
    kernel/fs/mbcache.ko
    kernel/fs/configfs/configfs.ko
    kernel/fs/cramfs/cramfs.ko
    kernel/fs/exportfs/exportfs.ko
    kernel/fs/ext2/ext2.ko
    kernel/fs/ext4/ext4.ko
    kernel/fs/fat/fat.ko
    kernel/fs/fat/vfat.ko
    kernel/fs/fat/msdos.ko
    kernel/fs/jbd2/jbd2.ko
    kernel/fs/jffs2/jffs2.ko
    kernel/fs/nls/nls_base.ko
    kernel/fs/nls/nls_cp437.ko
    kernel/fs/nls/nls_iso8859-1.ko
    kernel/fs/quota/quota_v2.ko
    kernel/fs/quota/quota_tree.ko
    kernel/fs/ubifs/ubifs.ko
    kernel/crypto/crypto.ko
    kernel/crypto/crypto_wq.ko
    kernel/crypto/crypto_algapi.ko
    kernel/crypto/aead.ko
    kernel/crypto/crypto_blkcipher.ko
    kernel/crypto/crypto_hash.ko
    kernel/crypto/akcipher.ko
    kernel/crypto/kpp.ko
    kernel/crypto/cryptomgr.ko
    kernel/crypto/crypto_null.ko
    kernel/crypto/aes_generic.ko
    kernel/crypto/deflate.ko
    kernel/crypto/michael_mic.ko
    kernel/crypto/crc32c_generic.ko
    kernel/crypto/crct10dif_common.ko
    kernel/crypto/crct10dif_generic.ko
    kernel/crypto/lzo.ko
    kernel/crypto/rng.ko
    kernel/block/deadline-iosched.ko
    kernel/block/cfq-iosched.ko
    kernel/drivers/base/firmware_class.ko
    kernel/drivers/base/regmap/regmap-i2c.ko
    kernel/drivers/base/regmap/regmap-mmio.ko
    kernel/drivers/bus/omap_l3_smx.ko
    kernel/drivers/bus/omap_l3_noc.ko
    kernel/drivers/bus/omap-ocp2scp.ko
    kernel/drivers/clk/ti/adpll.ko
    kernel/drivers/cpufreq/cpufreq_performance.ko
    kernel/drivers/cpufreq/cpufreq_powersave.ko
    kernel/drivers/cpufreq/cpufreq_userspace.ko
    kernel/drivers/cpufreq/cpufreq_ondemand.ko
    kernel/drivers/cpufreq/cpufreq_conservative.ko
    kernel/drivers/hid/hid.ko
    kernel/drivers/i2c/i2c-core.ko
    kernel/drivers/i2c/i2c-dev.ko
    kernel/drivers/i2c/busses/i2c-omap.ko
    kernel/drivers/input/input-core.ko
    kernel/drivers/input/mousedev.ko
    kernel/drivers/input/touchscreen/of_touchscreen.ko
    kernel/drivers/mfd/tps65217.ko
    kernel/drivers/mfd/tps65218.ko
    kernel/drivers/mfd/mfd-core.ko
    kernel/drivers/misc/eeprom/at24.ko
    kernel/drivers/misc/eeprom/eeprom_93cx6.ko
    kernel/drivers/mtd/mtd.ko
    kernel/drivers/mtd/ofpart.ko
    kernel/drivers/mtd/cmdlinepart.ko
    kernel/drivers/mtd/mtd_blkdevs.ko
    kernel/drivers/mtd/mtdblock.ko
    kernel/drivers/mtd/mtdoops.ko
    kernel/drivers/mtd/chips/chipreg.ko
    kernel/drivers/mtd/chips/cfi_probe.ko
    kernel/drivers/mtd/chips/cfi_util.ko
    kernel/drivers/mtd/chips/cfi_cmdset_0001.ko
    kernel/drivers/mtd/chips/gen_probe.ko
    kernel/drivers/mtd/maps/physmap.ko
    kernel/drivers/mtd/maps/physmap_of.ko
    kernel/drivers/mtd/nand/nand.ko
    kernel/drivers/mtd/nand/nand_ecc.ko
    kernel/drivers/mtd/nand/nand_bch.ko
    kernel/drivers/mtd/nand/nand_ids.ko
    kernel/drivers/mtd/nand/omap2_nand.ko
    kernel/drivers/mtd/nand/omap_elm.ko
    kernel/drivers/mtd/onenand/onenand.ko
    kernel/drivers/mtd/onenand/omap2.ko
    kernel/drivers/mtd/ubi/ubi.ko
    kernel/drivers/nvmem/nvmem_core.ko
    kernel/drivers/phy/phy-omap-control.ko
    kernel/drivers/phy/phy-ti-pipe3.ko
    kernel/drivers/pinctrl/pinctrl-single.ko
    kernel/drivers/pps/pps_core.ko
    kernel/drivers/regulator/fixed.ko
    kernel/drivers/regulator/palmas-regulator.ko
    kernel/drivers/regulator/pbias-regulator.ko
    kernel/drivers/scsi/scsi_mod.ko
    kernel/drivers/scsi/sd_mod.ko
    kernel/drivers/tty/serial/serial_core.ko
    kernel/drivers/tty/serial/omap-serial.ko
    kernel/drivers/tty/serial/8250/8250.ko
    kernel/drivers/tty/serial/8250/8250_base.ko
    kernel/drivers/tty/serial/8250/8250_of.ko
    kernel/drivers/video/backlight/lcd.ko
    kernel/drivers/video/backlight/platform_lcd.ko
    kernel/drivers/video/backlight/backlight.ko
    kernel/drivers/video/console/fbcon.ko
    kernel/drivers/video/console/bitblit.ko
    kernel/drivers/video/console/softcursor.ko
    kernel/drivers/video/console/tileblit.ko
    kernel/drivers/video/console/fbcon_rotate.ko
    kernel/drivers/video/console/fbcon_cw.ko
    kernel/drivers/video/console/fbcon_ud.ko
    kernel/drivers/video/console/fbcon_ccw.ko
    kernel/drivers/video/fbdev/core/fb.ko
    kernel/drivers/video/fbdev/core/cfbfillrect.ko
    kernel/drivers/video/fbdev/core/cfbcopyarea.ko
    kernel/drivers/video/fbdev/core/cfbimgblt.ko
    kernel/drivers/video/fbdev/omap2/omapfb/omapfb.ko
    kernel/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.ko
    kernel/drivers/video/fbdev/omap2/omapfb/dss/omapdss.ko
    kernel/arch/arm/oprofile/oprofile.ko
    kernel/lib/bitrev.ko
    kernel/lib/crc-ccitt.ko
    kernel/lib/crc16.ko
    kernel/lib/crc-t10dif.ko
    kernel/lib/crc-itu-t.ko
    kernel/lib/crc32.ko
    kernel/lib/crc7.ko
    kernel/lib/libcrc32c.ko
    kernel/lib/bch.ko
    kernel/lib/fonts/font.ko
    kernel/lib/lz4/lz4_decompress.ko
    kernel/lib/lzo/lzo_compress.ko
    kernel/lib/lzo/lzo_decompress.ko
    kernel/lib/xz/xz_dec.ko
    kernel/lib/zlib_deflate/zlib_deflate.ko
    kernel/lib/zlib_inflate/zlib_inflate.ko

     


    William Deninger



    New Member


    Posts:22
    New Member


    --
    29 Aug 2018 04:30 PM
    Update.... above was actually Mainstream 4.4.89.

    bradb



    Basic Member


    Posts:196
    Basic Member


    --
    30 Aug 2018 08:51 AM
    William,

    Check to see if you have no_console_suspend define in your bootargs within u-boot. If this is being past to the Linux kernel, it could be preventing all power domains from entering their target state. If so, try removing no_console_suspend. This is used to help debug suspend messages. By removing no_console_suspend I was able to get down to approximately 30mW.

    Here are the commands I used to remove no_console_suspend
    OMAP Logic # setenv optargs "ignore_loglevel early_printk"
    OMAP Logic # saveenv
    OMAP Logic # reset
    resetting ...

    Here is the messages I received after removing no_console_suspend:
    # echo mem > /sys/power/state
    [ 91.635406] PM: Syncing filesystems ... done.
    [ 91.640136] PM: Preparing system for sleep (mem)
    [ 91.646850] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 91.655975] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [ 91.665466] PM: Suspending system (mem)
    [ 91.669525] Suspending console(s) (use no_console_suspend to debug)
    [ 91.794860] PM: suspend of devices complete after 117.858 msecs
    [ 91.796600] PM: late suspend of devices complete after 1.708 msecs
    [ 91.798919] PM: noirq suspend of devices complete after 2.319 msecs
    [ 91.798950] Successfully put all powerdomains to target state
    [ 91.798950] Suspended for 8.302 seconds
    [ 91.800903] PM: noirq resume of devices complete after 1.861 msecs
    [ 91.803192] PM: early resume of devices complete after 1.861 msecs
    [ 91.974822] PM: resume of devices complete after 171.539 msecs
    [ 92.025787] PM: Finishing wakeup.
    [ 92.029266] Restarting tasks ... done.
    #

    Thanks,
    Brad

    William Deninger



    New Member


    Posts:22
    New Member


    --
    31 Aug 2018 01:10 PM

    My goodness I'm having personal troubles communicating this week. Above it should say 4.9.89.  I should just stick with cutting and pasting.

    pkg install -forge Linux buildroot 4.9.89 #2 Wed Aug 29 15:24:59 PDT 2018 armv7l GNU/Linux

     

     


    William Deninger



    New Member


    Posts:22
    New Member


    --
    31 Aug 2018 01:20 PM

    OK... verified I forgot to remove the no_console_suspend optargs.  I no longer get the "didn't enter target state 1".  Power consumption is still about 110mW through (25x more than Linux 3.0.0). 

    I'll go back and remove all those drivers again to see if I can reduce the power.

    -W

    You are not authorized to post a reply.