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.

ti8147 hangs on attempt to use vpss after resume

Other Parts Discussed in Thread: TPS65910, TLC59108

I'm attempting to exercise the suspend/resume functionality on the ti1847.  I have reviewed the following guide:

http://processors.wiki.ti.com/index.php/TI81XX_PSP_PM_SUSPEND_RESUME_User_Guide

and run the following to suspend to RAM:

echo -n "mem" > /sys/power/state

The system supends, and resumes properly.  However any attempt to use the VPSS effectively hangs the system:

VPSS_FVID2: contrl event 0x10040018 timeout
VPSS_DCTRL: failed to get node input status
VPSS_GRPX : failed to set grpx0 nodes
ti81xxfb ti81xxfb: fvid2 create failed.

I'm using the following sequence of commands on the Mistral TI8147 EVK to demonstrate the issue:

echo 0 > /sys/devices/platform/vpss/display1/enabled
echo 29232,800/40/40/48, 480/13/29/3,1/3 > /sys/devices/platform/vpss/display1/timings
echo triplediscrete,rgb888,0/0/1/0 > /sys/devices/platform/vpss/display1/output
echo 1 > /sys/devices/platform/vpss/display1/enabled
modprobe ti81xxfb
fbset -xres 800 -yres 480 -vxres 800 -vyres 480
echo 1:dvo2 > /sys/devices/platform/vpss/graphics0/node
# cat /img.fb > /dev/fb0 works as expected
echo mem > /sys/power/state
<suspend happens, resume>
cat /img.fb > /dev/fb0
VPSS_FVID2: contrl event 0x10040018 timeout
VPSS_DCTRL: failed to get node input status
VPSS_GRPX : failed to set grpx0 nodes
ti81xxfb ti81xxfb: fvid2 create failed.

It seems like TI's power management document suggests that power management is supported, but it is the implementor's responsibility to go through all of TI's drivers to add suspend/resume hooks.  Is that correct?  Has anyone already gone through that exercise for the various drivers related to the LCD?

Thanks in advance,

Devin

  • Devin,

    Could you please provide full log for your suspend/resume flow.

    Are you using the target # /etc/init.d/pvr-init stop, target # /etc/init.d/matrix-gui-e stop and target # /etc/init.d/load-hd-firmware.sh stop before suspend to RAM?

    Are you using the target # /etc/init.d/pvr-init start, target # /etc/init.d/matrix-gui-e start and target # /etc/init.d/load-hd-firmware.sh start after resume and before using the LCD?

    If not, please try.

    BR
    Pavel


  • Hello Pavel,

     

    Thanks for taking the time to reply.

    Yes, if I kill my Qt application, unload ti81xxfb and vpss, and unload the firmware (via load-hd-firmware.sh), and then bring everything back up after the resume, then yes it does appear to work after the resume.  Of course this isn't actually vpss being power management aware - it's an awful workaround that adds seconds to both the suspend and resume processes (the need to start our application back up on resume adds nearly ten seconds to the process).

    I need to be able to suspend/resume without tearing down the entire driver and application stack in the system.  The suggestion offered is not acceptable due to the time required.

    Regards,

    Devin

  • Devin,

    Are you using EZSDK 5.05.02.00? By EVK do you mean EVM? If not, what is EVK? Could you please provide full log (u-boot + linux kernel + user space) and the steps to reproduce the issue on my side (I am using DM8148 EVM).

    Best regards,
    Pavel

  • Hello Pavel,

    Yes, I was referring to the EVM (specifically the TI DM814x Evaluation Module by Mistral).

    I'm still running 5.05.01.04.  The release notes for 5.05.02 didn't suggest there was anything we were interested in that warranted going through the work to do an upgrade.

    Regarding getting you the logs, I can certainly boot back to the original EVM filesystem and collect the logs as requested.  However it should be trivial to reproduce by simply booting the EVM, running "echo mem > /sys/power/state" (without unloading the firmware or applications), and then watch the system hang/crash.  It seems like you're already quite aware of the nature of the underlying problem since you suggested killing the application and unloading the firmware prior to putting the hardware to sleep.

    Devin

  • Devin,

    Devin Heitmueller said:
    However it should be trivial to reproduce by simply booting the EVM, running "echo mem > /sys/power/state" (without unloading the firmware or applications), and then watch the system hang/crash.

    Yes, I was suspecting this is the issue, but I need to double check with you. Now it is clear.

    Suspend to mem/wfi does not include suspending other cores as we do not know the current status of the sw running on them. But suspend framework provides hooks to implement suspend on other cores.
     
    The suspend calls of respective core/driver should communicate with the corresponding core and put the core into suspend/resume using IPC such as syslink/rpmsg.

    Best regards,
    Pavel
  • Hi Pavel,

    Ok, so you have indeed confirmed my worst fear - that TI shipped a product claiming it supports suspend/resume, but for some reason they don't think that should include the LCD.  Wow.  That's absolutely amazing.

    I'm familiar with the example you pointed to for disabling the clocks on the DSP.  If I were building some custom DSP application, that would be quite useful.  However since we're talking about TI's binary firmware running on the M3, it isn't really any help.  You suggested using syslink/rpmsg to put the core into suspend/resume.  Does the FVID2 API for talking to TI's M3 firmware provide a call I can make to suspend the firmware?   As far as I can tell, the answer is "no".

    Do you have any idea what's going on inside the M3 when the suspend occurs?  As far as I can tell, the power domains are not being touched and the clocks are in an identical state before the suspend compared to after the resume.  Any information you can provide on *why* the core stops responding to syslink requests?  Does it not recover properly when the clocks are restored?  Is the firmware no longer running at all on the MPU?

    If I have to reload the firmware, I'm going to lose all the internal state of the M3, and hence won't be able to have the graphics pipelines pick up where they left off.  It would be good to know whether this is a case where I simply need to be configuring the clocks on the VPSS driver (e.g. adding suspend/resume PM events to the VPSS driver to manage the clocks), or whether the driver would have to tear down all the internal state inside of the VPSS driver, the M3 core and the FB driver, and then be able to recreate it on resume.

    Again, I am absolutely amazed that I'm expected to do this work and not some employee of TI who wrote and maintains the VPSS driver.

    Devin

  • Devin,

    I also think FVID2 API does not provide a call to M3 for suspend. At least I can not find anything in the {EZSDK}/board-support/linux-2.6.37-pspxx.xx.xx.xx/drivers/video/ti81xx/vpss/fvid2.c file.

    The first place of stuck of the suspend process, when M3 firmware is not unloaded/stopped is right after the "PM: Syncing filesystems ... done." line. I workaround this "stuck" with removing the following function:

    ti-ezsdk_dm814x-evm_5_05_02_00/board-support/linux-2.6.37-psp04.04.00.01/drivers/tty/vt/vt_ioctl.c

    static void vt_event_wait(struct vt_event_wait *vw)
    {

        unsigned long flags;

         

        /* Prepare the event */

        INIT_LIST_HEAD(&vw->list);

        vw->done = 0;

        /* Queue our event */

         

        spin_lock_irqsave(&vt_event_lock, flags);

        list_add(&vw->list, &vt_events);

        spin_unlock_irqrestore(&vt_event_lock, flags);

        /* Wait for it to pass */

         

      
      //wait_event_interruptible_tty(vt_event_waitqueue, vw->done);  -----> I comment this function
        /* Dequeue it */

         

        spin_lock_irqsave(&vt_event_lock, flags);

        list_del(&vw->list);

        spin_unlock_irqrestore(&vt_event_lock, flags);

    }


    I tested the suspend/resume with and without the M3 firmware. In both cases the suspend/resume works fine without executing the wait_event_interruptible_tty() function.

    Couple of things to check:

    1.       Check if you are re-enabling all clocks required by the LCD.

    2.       See if you are restoring the pin-mux settings including LCD related

    3.       LCD driver does calibration during init, you might need to re-run ts_calibrate.

    Regards,
    Pavel

  • Hello Pavel,

    That sounds very promising.  I'll give that a try and report back the results.

    I understand about the LCD clocking, pin-muxing, calibration, etc. and have no problem dealing with those issues.

    Thanks,

    Devin

  • Hi Pavel,

    So I did a bit of testing on this, and while the system doesn't hang when you run "cat /img.bin >/dev/fb0", I'm not confident it's actually working either.

    Did you actually see any output on the LCD after doing the resume?  Or are you assuming that it should be outputting to the LCD but you didn't actually seen anything because you don't think the LCD is enabled.

    I'm testing on the EVM and not seeing any output, but I'm also testing on our proprietary platform and I'm not seeing output there either (even though I *know* the LCD is being reinitialized after the resume).

    Further, if I run the following, I get a VPSS timeout.

    root@dm814x-evm:/bin# cat /sys/devices/platform/vpss/display1/enabled
    [  178.367187] VPSS_FVID2: contrl event 0x1004001a timeout
    [  178.375000] VPSS_DCTRL: failed to get venc info.
    [  178.375000] VPSS_DCTRL:  Failed to get venc infor
    cat: read error: Invalid argument

    In addition, the change you're proposing seems pretty dangerous.  That code path is used in a variety of places unrelated to the VPSS subsystem and it seems more likely that you should be waking up that work queue rather than commenting out the code that tells it to wait.

    I'm just trying to understand whether you've actually confirmed your change results in the VPSS subsystem working properly after the resume, or whether you simply concluded that the change was correct because the system no longer hangs after commenting out that line of code.  I'm worried that the change you've proposed is just obscuring the actual problem (which is that the VPSS firmware is no longer responding to requests).

    Devin

  • Devin,

     

    Devin Heitmueller said:
    Did you actually see any output on the LCD after doing the resume?  Or are you assuming that it should be outputting to the LCD but you didn't actually seen anything because you don't think the LCD is enabled.

    No, I am providing you some hints that might help you. I received these hints from our PSP team.

    Devin Heitmueller said:
    In addition, the change you're proposing seems pretty dangerous.  That code path is used in a variety of places unrelated to the VPSS subsystem and it seems more likely that you should be waking up that work queue rather than commenting out the code that tells it to wait.

    If you do not comment the wait_event_interruptible_tty(vt_event_waitqueue, vw->done); than how do you workaround the stuck after the "PM: Syncing filesystems ... done." message?

    When I keep the wait_event_interruptible_tty(vt_event_waitqueue, vw->done); function, I can workaround the stuck with pressing Ctrl+C, but even after that I have the VPSS timeout:

    root@dm814x-evm:/bin# cat /sys/devices/platform/vpss/display1/enabled
     VPSS_FVID2: contrl event 0x1004001a timeout
     VPSS_DCTRL: failed to get venc info.
     VPSS_DCTRL:  Failed to get venc infor
    cat: read error: Invalid argument

    So I doubt that commenting wait_event_interruptible_tty(vt_event_waitqueue, vw->done); is causing this VPSS timeout.

    Which HDVPSS clock signals you are gating at suspend and then enable again at resume?

    I can provide you a presentation for the DSP <-> Cortex-A8 communication at suspend/resume: 2480.DSP_Susp_design.pptx

    I think that the M3 <-> Cortex A8 communication should be similar.

    Regards,
    Pavel

  • Devin,

    I have also found that when using the 'core' test mode, the LCD suspend/resume fine. See the log below:

    root@dm814x-evm:~# echo core > /sys/power/pm_test
    root@dm814x-evm:~# echo mem > /sys/power/state
    PM: Syncing filesystems ... done.
    PM: Preparing system for mem sleep
    PM: Adding info for No Bus:vcs63
    PM: Adding info for No Bus:vcsa63
    Freezing user space processes ... (elapsed 0.01 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    PM: Entering mem sleep
    Suspending console(s) (use no_console_suspend to debug)
    platform reg-dummy: preparing suspend
    platform mpu.0: preparing suspend
    platform l3_slow.0: preparing suspend
    omap_gpio omap_gpio.0: preparing suspend
    omap_gpio omap_gpio.1: preparing suspend
    omap_gpio omap_gpio.2: preparing suspend
    omap_gpio omap_gpio.3: preparing suspend
    omap_uart omap_uart.0: preparing suspend
    omap_uart omap_uart.1: preparing suspend
    omap_uart omap_uart.2: preparing suspend
    omap_uart omap_uart.3: preparing suspend
    omap_uart omap_uart.4: preparing suspend
    omap_uart omap_uart.5: preparing suspend
    omap_i2c omap_i2c.1: preparing suspend
    omap_i2c omap_i2c.3: preparing suspend
    davinci-mcasp davinci-mcasp.2: preparing suspend
    mmci-omap-hs mmci-omap-hs.0: preparing suspend
    omap2-nand omap2-nand.0: preparing suspend
    ti81xx-usbss ti81xx-usbss: preparing suspend
    omap-mailbox omap-mailbox: preparing suspend
    omap2_mcspi omap2_mcspi.1: preparing suspend
    omap2_mcspi omap2_mcspi.2: preparing suspend
    omap2_mcspi omap2_mcspi.3: preparing suspend
    omap2_mcspi omap2_mcspi.4: preparing suspend
    omap2_elm omap2_elm.1: preparing suspend
    arm-pmu arm-pmu.0: preparing suspend
    davinci_mdio davinci_mdio.0: preparing suspend
    cpsw cpsw.0: preparing suspend
    ti81xx_pcie ti81xx_pcie.0: preparing suspend
    edma edma: preparing suspend
    davinci-pcm-audio davinci-pcm-audio: preparing suspend
    d_can d_can: preparing suspend
    ahci ahci.0: preparing suspend
    omap_rtc omap_rtc: preparing suspend
    vpss vpss: preparing suspend
    platform t81xx_vidout: preparing suspend
    TI81XX_HDMI TI81XX_HDMI: preparing suspend
    ti81xxfb ti81xxfb: preparing suspend
    platform ti81xxvin: preparing suspend
    omap_wdt omap_wdt: preparing suspend
    musb-hdrc musb-hdrc.0: preparing suspend
    musb-hdrc musb-hdrc.1: preparing suspend
    tps65910-pmic tps65910-pmic: preparing suspend
    platform tps65910-rtc: preparing suspend
    platform tps65910-power: preparing suspend
    nop_usb_xceiv nop_usb_xceiv.0: preparing suspend
    usb usb1: preparing type suspend, may wakeup
    nop_usb_xceiv nop_usb_xceiv.1: preparing suspend
    usb usb2: preparing type suspend, may wakeup
    omap-iommu omap-iommu.0: preparing suspend
    omap-iommu omap-iommu.1: preparing suspend
    serial8250 serial8250: preparing suspend
    soc-audio soc-audio.0: preparing suspend
    pvrsrvkm pvrsrvkm: preparing suspend
    pvrsrvkm pvrsrvkm: suspend
    backlight tlc59108-bl: legacy class suspend
    mmcblk mmc0:ac19: suspend
    soc-audio soc-audio.0: suspend
    rtc rtc0: legacy class suspend
    input input0: type suspend
    Generic PHY 0:01: suspend
    Generic PHY 0:00: suspend
    mtd mtd5ro: legacy class suspend
    mtd mtd5: legacy class suspend
    mtd mtd4ro: legacy class suspend
    mtd mtd4: legacy class suspend
    mtd mtd3ro: legacy class suspend
    mtd mtd3: legacy class suspend
    mtd mtd2ro: legacy class suspend
    mtd mtd2: legacy class suspend
    mtd mtd1ro: legacy class suspend
    mtd mtd1: legacy class suspend
    mtd mtd0ro: legacy class suspend
    mtd mtd0: legacy class suspend
    serial8250 serial8250: suspend
    omap-iommu omap-iommu.1: suspend
    omap-iommu omap-iommu.0: suspend
    nop_usb_xceiv nop_usb_xceiv.1: suspend
    nop_usb_xceiv nop_usb_xceiv.0: suspend
    i2c 3-0021: suspend
    i2c i2c-3: suspend
    platform tps65910-power: suspend
    platform tps65910-rtc: suspend
    tps65910-pmic tps65910-pmic: suspend
    tps65910 1-002d: suspend
    qt602240_ts 1-004a: suspend
    scsi host0: suspend
    hub 2-0:1.0: suspend
    usb usb2: type suspend, may wakeup
    usb usb2: suspend, may wakeup
    hub 1-0:1.0: suspend
    usb usb1: type suspend, may wakeup
    usb usb1: suspend, may wakeup
    pcf857x 1-0021: suspend
    tlc59108 1-0040: suspend
    i2c 1-0020: suspend
    tlv320aic3x-codec 1-0018: suspend
    i2c 1-0023: suspend
    i2c 1-0050: suspend
    i2c i2c-1: suspend
    musb-hdrc musb-hdrc.1: suspend
    musb-hdrc musb-hdrc.0: suspend
    spi spi1.0: legacy suspend
    omap_wdt omap_wdt: suspend
    platform ti81xxvin: suspend
    ti81xxfb ti81xxfb: suspend
    TI81XX_HDMI TI81XX_HDMI: suspend
    platform t81xx_vidout: suspend
    vpss vpss: suspend
    omap_rtc omap_rtc: suspend
    ahci ahci.0: suspend
    d_can d_can: suspend
    davinci-pcm-audio davinci-pcm-audio: suspend
    edma edma: suspend
    ti81xx_pcie ti81xx_pcie.0: suspend
    cpsw cpsw.0: suspend
    davinci_mdio davinci_mdio.0: suspend
    arm-pmu arm-pmu.0: suspend
    omap2_elm omap2_elm.1: suspend
    omap2_mcspi omap2_mcspi.4: suspend
    omap2_mcspi omap2_mcspi.3: suspend
    omap2_mcspi omap2_mcspi.2: suspend
    omap2_mcspi omap2_mcspi.1: suspend
    omap-mailbox omap-mailbox: suspend
    ti81xx-usbss ti81xx-usbss: suspend
    omap2-nand omap2-nand.0: suspend
    mmci-omap-hs mmci-omap-hs.0: suspend
    davinci-mcasp davinci-mcasp.2: suspend
    omap_i2c omap_i2c.3: suspend
    omap_i2c omap_i2c.1: suspend
    omap_uart omap_uart.5: suspend
    omap_uart omap_uart.4: suspend
    omap_uart omap_uart.3: suspend
    omap_uart omap_uart.2: suspend
    omap_uart omap_uart.1: suspend
    omap_uart omap_uart.0: suspend
    omap_gpio omap_gpio.3: suspend
    omap_gpio omap_gpio.2: suspend
    omap_gpio omap_gpio.1: suspend
    omap_gpio omap_gpio.0: suspend
    platform l3_slow.0: suspend
    platform mpu.0: suspend
    platform reg-dummy: suspend
    PM: suspend of devices complete after 5.521 msecs
    pvrsrvkm pvrsrvkm: LATE suspend
    mmcblk mmc0:ac19: LATE suspend
    soc-audio soc-audio.0: LATE suspend
    input input0: LATE type suspend
    mdio_bus 0:01: LATE suspend
    mdio_bus 0:00: LATE suspend
    scsi host0: LATE suspend
    serial8250 serial8250: LATE suspend
    omap-iommu omap-iommu.1: LATE suspend
    omap-iommu omap-iommu.0: LATE suspend
    hub 2-0:1.0: LATE suspend
    usb usb2: LATE type suspend, may wakeup
    usb usb2: LATE suspend, may wakeup
    nop_usb_xceiv nop_usb_xceiv.1: LATE suspend
    hub 1-0:1.0: LATE suspend
    usb usb1: LATE type suspend, may wakeup
    usb usb1: LATE suspend, may wakeup
    nop_usb_xceiv nop_usb_xceiv.0: LATE suspend
    i2c 3-0021: LATE suspend
    i2c i2c-3: LATE suspend
    platform tps65910-power: LATE suspend
    platform tps65910-rtc: LATE suspend
    tps65910-pmic tps65910-pmic: LATE suspend
    tps65910 1-002d: LATE suspend
    qt602240_ts 1-004a: LATE suspend
    pcf857x 1-0021: LATE suspend
    tlc59108 1-0040: LATE suspend
    i2c 1-0020: LATE suspend
    tlv320aic3x-codec 1-0018: LATE suspend
    i2c 1-0023: LATE suspend
    i2c 1-0050: LATE suspend
    i2c i2c-1: LATE suspend
    musb-hdrc musb-hdrc.1: LATE suspend
    musb-hdrc musb-hdrc.0: LATE suspend
    omap_wdt omap_wdt: LATE suspend
    platform ti81xxvin: LATE suspend
    ti81xxfb ti81xxfb: LATE suspend
    TI81XX_HDMI TI81XX_HDMI: LATE suspend
    platform t81xx_vidout: LATE suspend
    vpss vpss: LATE suspend
    omap_rtc omap_rtc: LATE suspend
    ahci ahci.0: LATE suspend
    d_can d_can: LATE suspend
    davinci-pcm-audio davinci-pcm-audio: LATE suspend
    edma edma: LATE suspend
    ti81xx_pcie ti81xx_pcie.0: LATE suspend
    cpsw cpsw.0: LATE suspend
    davinci_mdio davinci_mdio.0: LATE suspend
    arm-pmu arm-pmu.0: LATE suspend
    omap2_elm omap2_elm.1: LATE suspend
    omap2_mcspi omap2_mcspi.4: LATE suspend
    omap2_mcspi omap2_mcspi.3: LATE suspend
    omap2_mcspi omap2_mcspi.2: LATE suspend
    omap2_mcspi omap2_mcspi.1: LATE suspend
    omap-mailbox omap-mailbox: LATE suspend
    ti81xx-usbss ti81xx-usbss: LATE suspend
    omap2-nand omap2-nand.0: LATE suspend
    mmci-omap-hs mmci-omap-hs.0: LATE suspend
    davinci-mcasp davinci-mcasp.2: LATE suspend
    omap_i2c omap_i2c.3: LATE suspend
    omap_i2c omap_i2c.1: LATE suspend
    omap_uart omap_uart.5: LATE suspend
    omap_uart omap_uart.4: LATE suspend
    omap_uart omap_uart.3: LATE suspend
    omap_uart omap_uart.2: LATE suspend
    omap_uart omap_uart.1: LATE suspend
    omap_uart omap_uart.0: LATE suspend
    omap_gpio omap_gpio.3: LATE suspend
    omap_gpio omap_gpio.2: LATE suspend
    omap_gpio omap_gpio.1: LATE suspend
    omap_gpio omap_gpio.0: LATE suspend
    platform l3_slow.0: LATE suspend
    platform mpu.0: LATE suspend
    platform reg-dummy: LATE suspend
    PM: late suspend of devices complete after 0.977 msecs
    suspend debug: Waiting for 5 seconds.
    platform reg-dummy: EARLY resume
    platform mpu.0: EARLY resume
    platform l3_slow.0: EARLY resume
    omap_gpio omap_gpio.0: EARLY resume
    omap_gpio omap_gpio.1: EARLY resume
    omap_gpio omap_gpio.2: EARLY resume
    omap_gpio omap_gpio.3: EARLY resume
    omap_uart omap_uart.0: EARLY resume
    omap_uart omap_uart.1: EARLY resume
    omap_uart omap_uart.2: EARLY resume
    omap_uart omap_uart.3: EARLY resume
    omap_uart omap_uart.4: EARLY resume
    omap_uart omap_uart.5: EARLY resume
    omap_i2c omap_i2c.1: EARLY resume
    omap_i2c omap_i2c.3: EARLY resume
    davinci-mcasp davinci-mcasp.2: EARLY resume
    mmci-omap-hs mmci-omap-hs.0: EARLY resume
    omap2-nand omap2-nand.0: EARLY resume
    ti81xx-usbss ti81xx-usbss: EARLY resume
    omap-mailbox omap-mailbox: EARLY resume
    omap2_mcspi omap2_mcspi.1: EARLY resume
    omap2_mcspi omap2_mcspi.2: EARLY resume
    omap2_mcspi omap2_mcspi.3: EARLY resume
    omap2_mcspi omap2_mcspi.4: EARLY resume
    omap2_elm omap2_elm.1: EARLY resume
    arm-pmu arm-pmu.0: EARLY resume
    davinci_mdio davinci_mdio.0: EARLY resume
    cpsw cpsw.0: EARLY resume
    ti81xx_pcie ti81xx_pcie.0: EARLY resume
    edma edma: EARLY resume
    davinci-pcm-audio davinci-pcm-audio: EARLY resume
    d_can d_can: EARLY resume
    ahci ahci.0: EARLY resume
    omap_rtc omap_rtc: EARLY resume
    vpss vpss: EARLY resume
    platform t81xx_vidout: EARLY resume
    TI81XX_HDMI TI81XX_HDMI: EARLY resume
    ti81xxfb ti81xxfb: EARLY resume
    platform ti81xxvin: EARLY resume
    omap_wdt omap_wdt: EARLY resume
    musb-hdrc musb-hdrc.0: EARLY resume
    musb-hdrc musb-hdrc.1: EARLY resume
    i2c i2c-1: EARLY resume
    i2c 1-0050: EARLY resume
    i2c 1-0023: EARLY resume
    tlv320aic3x-codec 1-0018: EARLY resume
    i2c 1-0020: EARLY resume
    tlc59108 1-0040: EARLY resume
    pcf857x 1-0021: EARLY resume
    qt602240_ts 1-004a: EARLY resume
    tps65910 1-002d: EARLY resume
    tps65910-pmic tps65910-pmic: EARLY resume
    platform tps65910-rtc: EARLY resume
    platform tps65910-power: EARLY resume
    i2c i2c-3: EARLY resume
    i2c 3-0021: EARLY resume
    nop_usb_xceiv nop_usb_xceiv.0: EARLY resume
    usb usb1: EARLY resume
    usb usb1: EARLY type resume
    hub 1-0:1.0: EARLY resume
    nop_usb_xceiv nop_usb_xceiv.1: EARLY resume
    usb usb2: EARLY resume
    usb usb2: EARLY type resume
    hub 2-0:1.0: EARLY resume
    omap-iommu omap-iommu.0: EARLY resume
    omap-iommu omap-iommu.1: EARLY resume
    serial8250 serial8250: EARLY resume
    scsi host0: EARLY resume
    mdio_bus 0:00: EARLY resume
    mdio_bus 0:01: EARLY resume
    input input0: EARLY type resume
    soc-audio soc-audio.0: EARLY resume
    mmcblk mmc0:ac19: EARLY resume
    pvrsrvkm pvrsrvkm: EARLY resume
    PM: early resume of devices complete after 0.701 msecs
    platform reg-dummy: resume
    platform mpu.0: resume
    platform l3_slow.0: resume
    omap_gpio omap_gpio.0: resume
    omap_gpio omap_gpio.1: resume
    omap_gpio omap_gpio.2: resume
    omap_gpio omap_gpio.3: resume
    omap_uart omap_uart.0: resume
    omap_uart omap_uart.1: resume
    omap_uart omap_uart.2: resume
    omap_uart omap_uart.3: resume
    omap_uart omap_uart.4: resume
    omap_uart omap_uart.5: resume
    omap_i2c omap_i2c.1: resume
    omap_i2c omap_i2c.3: resume
    davinci-mcasp davinci-mcasp.2: resume
    mmci-omap-hs mmci-omap-hs.0: resume
    omap2-nand omap2-nand.0: resume
    ti81xx-usbss ti81xx-usbss: resume
    omap-mailbox omap-mailbox: resume
    omap2_mcspi omap2_mcspi.1: resume
    omap2_mcspi omap2_mcspi.2: resume
    omap2_mcspi omap2_mcspi.3: resume
    omap2_mcspi omap2_mcspi.4: resume
    omap2_elm omap2_elm.1: resume
    arm-pmu arm-pmu.0: resume
    davinci_mdio davinci_mdio.0: resume
    cpsw cpsw.0: resume

    CPSW phy found : id is : 0x4dd074

    CPSW phy found : id is : 0x4dd074
    ti81xx_pcie ti81xx_pcie.0: resume
    edma edma: resume
    davinci-pcm-audio davinci-pcm-audio: resume
    d_can d_can: resume
    ahci ahci.0: resume
    omap_rtc omap_rtc: resume
    vpss vpss: resume
    platform t81xx_vidout: resume
    TI81XX_HDMI TI81XX_HDMI: resume
    ti81xxfb ti81xxfb: resume
    platform ti81xxvin: resume
    omap_wdt omap_wdt: resume
    spi spi1.0: legacy resume
    musb-hdrc musb-hdrc.0: resume
    musb-hdrc musb-hdrc.1: resume
    i2c i2c-1: resume
    i2c 1-0050: resume
    i2c 1-0023: resume
    tlv320aic3x-codec 1-0018: resume
    i2c 1-0020: resume
    tlc59108 1-0040: resume
    usb usb1: resume
    usb usb1: type resume
    usb usb2: resume
    usb usb2: type resume
    scsi host0: resume
    pcf857x 1-0021: resume
    qt602240_ts 1-004a: resume
    hub 1-0:1.0: resume
    hub 2-0:1.0: resume
    tps65910 1-002d: resume
    tps65910-pmic tps65910-pmic: resume
    platform tps65910-rtc: resume
    platform tps65910-power: resume
    i2c i2c-3: resume
    i2c 3-0021: resume
    nop_usb_xceiv nop_usb_xceiv.0: resume
    nop_usb_xceiv nop_usb_xceiv.1: resume
    omap-iommu omap-iommu.0: resume
    omap-iommu omap-iommu.1: resume
    serial8250 serial8250: resume
    mtd mtd0: legacy class resume
    mtd mtd0ro: legacy class resume
    mtd mtd1: legacy class resume
    mtd mtd1ro: legacy class resume
    mtd mtd2: legacy class resume
    mtd mtd2ro: legacy class resume
    mtd mtd3: legacy class resume
    mtd mtd3ro: legacy class resume
    mtd mtd4: legacy class resume
    mtd mtd4ro: legacy class resume
    mtd mtd5: legacy class resume
    mtd mtd5ro: legacy class resume
    Generic PHY 0:00: resume
    Generic PHY 0:01: resume
    input input0: type resume
    rtc rtc0: legacy class resume
    soc-audio soc-audio.0: resume
    mmcblk mmc0:ac19: resume
    backlight tlc59108-bl: legacy class resume
    pvrsrvkm pvrsrvkm: resume
    PM: resume of devices complete after 182.936 msecs
    pvrsrvkm pvrsrvkm: completing resume
    soc-audio soc-audio.0: completing resume
    serial8250 serial8250: completing resume
    omap-iommu omap-iommu.1: completing resume
    omap-iommu omap-iommu.0: completing resume
    usb usb2: completing type resume
    nop_usb_xceiv nop_usb_xceiv.1: completing resume
    usb usb1: completing type resume
    nop_usb_xceiv nop_usb_xceiv.0: completing resume
    platform tps65910-power: completing resume
    platform tps65910-rtc: completing resume
    tps65910-pmic tps65910-pmic: completing resume
    musb-hdrc musb-hdrc.1: completing resume
    musb-hdrc musb-hdrc.0: completing resume
    omap_wdt omap_wdt: completing resume
    platform ti81xxvin: completing resume
    ti81xxfb ti81xxfb: completing resume
    TI81XX_HDMI TI81XX_HDMI: completing resume
    platform t81xx_vidout: completing resume
    vpss vpss: completing resume
    omap_rtc omap_rtc: completing resume
    ahci ahci.0: completing resume
    d_can d_can: completing resume
    davinci-pcm-audio davinci-pcm-audio: completing resume
    edma edma: completing resume
    ti81xx_pcie ti81xx_pcie.0: completing resume
    cpsw cpsw.0: completing resume
    davinci_mdio davinci_mdio.0: completing resume
    arm-pmu arm-pmu.0: completing resume
    omap2_elm omap2_elm.1: completing resume
    omap2_mcspi omap2_mcspi.4: completing resume
    omap2_mcspi omap2_mcspi.3: completing resume
    omap2_mcspi omap2_mcspi.2: completing resume
    omap2_mcspi omap2_mcspi.1: completing resume
    omap-mailbox omap-mailbox: completing resume
    ti81xx-usbss ti81xx-usbss: completing resume
    omap2-nand omap2-nand.0: completing resume
    mmci-omap-hs mmci-omap-hs.0: completing resume
    davinci-mcasp davinci-mcasp.2: completing resume
    omap_i2c omap_i2c.3: completing resume
    omap_i2c omap_i2c.1: completing resume
    omap_uart omap_uart.5: completing resume
    omap_uart omap_uart.4: completing resume
    omap_uart omap_uart.3: completing resume
    omap_uart omap_uart.2: completing resume
    omap_uart omap_uart.1: completing resume
    omap_uart omap_uart.0: completing resume
    omap_gpio omap_gpio.3: completing resume
    omap_gpio omap_gpio.2: completing resume
    omap_gpio omap_gpio.1: completing resume
    omap_gpio omap_gpio.0: completing resume
    platform l3_slow.0: completing resume
    platform mpu.0: completing resume
    platform reg-dummy: completing resume
    PM: Finishing wakeup.
    Restarting tasks ... done.
    root@dm814x-evm:~#

    With the 'core' test mode, the LCD turn off then on with success.

    The 'core' test mode tests the freezing of processes, suspending of devices, platform global control methods, the disabling of nonboot CPUs and suspending of platform/system devices. The "core" level tests the hardware and drivers as deeply as possible without creating a hibernation image.

    For more information about the "core" test mode, see linux-src/Documentation/power/basic-pm-debugging.txt

    I will further check about the difference between the normal mode and the "core" test mode.

    Regards,
    Pavel

  • Hi Pavel,

    Thanks for taking the time to continue investigating this.

    When you say "the LCD turns off then on with success", do you mean you actually see output/graphics on the LCD after the resume other than just the backlight turning on?  In my testing with your patch, the backlight turns on, but there is no actual graphics output to the LCD (which in this case is the only thing I would categorize as "success").

    If you do see graphics, then certainly understanding why the core test works but the actual suspend doesn't would be a very useful thing to know.

    Devin

  • Devin,

    Devin Heitmueller said:

     When you say "the LCD turns off then on with success", do you mean you actually see output/graphics on the LCD after the resume other than just the backlight turning on?

    I mean I see output/graphics on the LCD after the resume. The touch screen works fine. I run the 3D Graphics -> Chameleon demo (OpenGL ES Demos) and 2D Graphics -> Moving Blocks demo. Both work fine.

    Also the VPSS-M3 firmware seems to behave correct after the resume:

    omap_gpio omap_gpio.0: completing resume
    platform l3_slow.0: completing resume
    platform mpu.0: completing resume
    platform reg-dummy: completing resume
    PM: Finishing wakeup.
    Restarting tasks ... done.
    root@dm814x-evm:~# cat /sys/devices/platform/vpss/display1/enabled
    1
    root@dm814x-evm:~#

    The difference between the "core" test and the actual suspend should be something related to the VPSS-M3 firmware (/usr/share/ti/ti-media-controller-utils/dm814x_hdvpss.xem3).In the basic-pm-debugging.txt we have:

    In particular, the "core" test allows you to test everything except for the actual invocation of the platform firmware in order to put the system into the sleep state.

    The error that we have after resume is the same as just unload/stop the VPSS-M3 firmware, without running any suspend/resume test:

    Arago 2011.09 dm814x-evm ttyO0

    dm814x-evm login: root
    root@dm814x-evm:~# cat /sys/devices/platform/vpss/display1/enabled
    1
    root@dm814x-evm:~# firmware_loader 2 /usr/share/ti/ti-media-controller-utils/dm814x_hdvpss.xem3 stop
    FIRMWARE: I2cInit will be done by M3
    FIRMWARE: Memory map bin file not passed
    Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]
    ===Mandatory arguments===
    <Processor Id>         0: DSP, 1: Video-M3, 2: Vpss-M3
    <Location of Firmware> firmware binary file
    <start|stop>           to start/stop the firmware
    ===Optional arguments===
    -mmap                  input memory map bin file name
    -i2c                   0: i2c init not done by M3, 1(default): i2c init done by M3
    FIRMWARE: isI2cInitRequiredOnM3: 1
    FIRMWARE: Default memory configuration is used
    Firmware Loader debugging not configured
    Default FL_DEBUG: warning
    Allowed FL_DEBUG levels: error, warning, info, debug, log
    MemCfg: DCMM (Dynamically Configurable Memory Map) Version :  2.1.2.1
    FIRMWARE: 2 stop Successful
    root@dm814x-evm:~# cat /sys/devices/platform/vpss/display1/enabled
    VPSS_FVID2: contrl event 0x1004001a timeout
    VPSS_DCTRL: failed to get venc info.
    VPSS_DCTRL:  Failed to get venc infor
    cat: read error: Invalid argument
    root@dm814x-evm:~#

    I will further investigate on this.

    Best regards,
    Pavel

  • Hi Pavel,

    Ah, excellent.  It sounds like you've successfully reproduced the behavior I'm seeing and narrowed it down to a specific case you can test with.  I look forward to you identifying the issue.

    For my information, are you currently testing with the code change you mentioned in your response on Aug 14th where you commented out the call to wait_event_interruptible_tty()?

    Devin

  • Devin,

    Devin Heitmueller said:
    For my information, are you currently testing with the code change you mentioned in your response on Aug 14th where you commented out the call to wait_event_interruptible_tty()?

    Yes, I am testing with that change. Everything seems to work fine, I can not observe any side effects with that change.

    When I test without this change, the "core" test hang at the "PM : Syncing filesystems... done" line. When I press Ctrl+C, the flow continues and finish with success:

    dm814x-evm login: root
    root@dm814x-evm:~# echo core > /sys/power/pm_test
    root@dm814x-evm:~# echo mem > /sys/power/state
    PM: Syncing filesystems ... done.  ------> stuck here, press Ctrl+C to continue
    Freezing user space processes ... (elapsed 0.01 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    PM: suspend of devices complete after 5.483 msecs
    PM: late suspend of devices complete after 1.071 msecs
    suspend debug: Waiting for 5 seconds.
    PM: early resume of devices complete after 0.784 msecs

    CPSW phy found : id is : 0x4dd074

    CPSW phy found : id is : 0x4dd074
    PM: resume of devices complete after 175.374 msecs
    Restarting tasks ... done.

    mem
    root@dm814x-evm:~# cat /sys/devices/platform/vpss/display1/enabled
    1
    root@dm814x-evm:~#

    When I test with the normal suspend/resume, the flow also stuck at the "PM : Syncing filesystems... done" line. When I press Ctrl+C, the flow continues and finish with black screen on the LCD, as the VPSS-M3 firmware is not re-loaded properly:

    root@dm814x-evm:~# echo none > /sys/power/pm_test
    root@dm814x-evm:~# echo mem > /sys/power/state
    PM: Syncing filesystems ... done.    ------> stuck here, press Ctrl+C to continue
    Freezing user space processes ... (elapsed 0.01 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    PM: suspend of devices complete after 5.430 msecs
    PM: late suspend of devices complete after 1.069 msecs
    PM: early resume of devices complete after 1.029 msecs
     
    CPSW phy found : id is : 0x4dd074

    CPSW phy found : id is : 0x4dd074
    PM: resume of devices complete after 175.144 msecs
    Restarting tasks ... done.

    mem
    root@dm814x-evm:~# cat /sys/devices/platform/vpss/display1/enabled
    VPSS_FVID2: contrl event 0x1004001a timeout
    VPSS_DCTRL: failed to get venc info.
    VPSS_DCTRL:  Failed to get venc infor
    cat: read error: Invalid argument
    root@dm814x-evm:~#

    To sum up, the only difference when I leave the wait_event_interruptible_tty() function not commented in the code, is that I need to press Ctrl+C to workaround the stuck of the flow. All rest is the same.

    Regards,
    Pavel

  • Devin,

    I found that other possible solution for workaround the stuck at the "PM: Syncing filesystems ... done." line is just stopping the Matrix application:

    root@dm814x-evm:~# /etc/init.d/matrix-gui-e stop

    When stopping the Matrix application, you do not need nor to comment the wait_event_interruptible_tty() function, neither to press Ctrl+C.

    Regards,
    Pavel

  • Hi Pavel,

    That is an interesting observation, and hopefully it will lead to identifying the underlying problem in the TI platform.

    I suspect what's likely happening is the matrix application is actively making calls into ti81xx_fb when the suspend happens, and whatever queued request the application has to the driver is what's getting stuck.  I would suspect though that it would happen with *any* application that's actively using the framebuffer.

    As we discussed before, our expectation is that the TI platform will behave like every other Linux system out there - in that we should be able to suspend and resume the hardware without having to kill all the applications in userland which might be using the graphics stack.

    I hope this provides some insight as to the real problem.

    Devin

  • Hello Devin:

                  Have you resolved your problem?I have the same question as you,After suspending the system,then resume it ,The LCD can't wok normally,and

    VPSS_FVID2: contrl event 0x10040018 timeout
    VPSS_DCTRL: failed to get node input status
        I think the key point is how to tell the M3 the System has get in to suspend model

              Thanks.

                                                                                                                                         zhichao.

  • Hello :

      I have the same problem,now the M3 VPSS cant work well after resuming the system,So  wheather I can prevent the LCD(FB or vpss model)not geting into suspend model when execute echo -n "mem" > /sys/power/state?

    Thansk.

     zhichao.

  • Hello:

      And I see the  AM335x  is support the  Cortex-M3 get int to standby model by upgrating M3 source  binary ,According to "

    AM335x Power Management Standby User's Guide

    "