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.

camera not working after suspend resume

Hi,

I am working on beagle board-xm, my kernel version is 3.9.6-x3. I am executing camera with below script,

media-ctl -v -r -l '"mt9v115 2-003d":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":
1->"OMAP3 ISP resizer":0[1], "OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":0
[1]'
media-ctl -f '"mt9v115 2-003d":0 [UYVY2X8 640x480], "OMAP3 ISP CCDC":1 [UYVY2X8 
640x480], "OMAP3 ISP resizer":1 [UYVY2X8 640x480]'
yavta -f UYVY -s 640x480 --skip=99999 --capture=100000 --file=image.uyvy /dev/video6
convert -size 640x480 image.uyvy imaFrame.jpg
rm -rf image.uyvy

Now I am suspending the processor using the below command

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

after suspend resume the camera is not working.

when I execute the script for camera I get the below error. Dmesg logs are as shown below.

[ 9519.674133] PM: Syncing filesystems ... done.
[ 9521.473449] PM: Preparing system for mem sleep
[ 9521.510833] Freezing user space processes ... (elapsed 0.01 seconds) done.
[ 9521.524078] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
[ 9521.544006] PM: Entering mem sleep
[ 9521.544036] Suspending console(s) (use no_console_suspend to debug)
[ 9521.593017] wlcore: down
[ 9521.714935] PM: suspend of devices complete after 169.067 msecs
[ 9521.717163] PM: late suspend of devices complete after 2.166 msecs
[ 9521.719451] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:891
[ 9521.719451] in_atomic(): 1, irqs_disabled(): 0, pid: 1982, name: suspend_resume.
[ 9521.719543] [<c0014ac4>] (unwind_backtrace+0x0/0x11c) from [<c042fb18>] (__pm_runtime_idle+0x30/0xa0)
[ 9521.719604] [<c042fb18>] (__pm_runtime_idle+0x30/0xa0) from [<c04474a0>] (omap_tll_disable+0x38/0x5c)
[ 9521.719635] [<c04474a0>] (omap_tll_disable+0x38/0x5c) from [<c0446284>] (usbhs_runtime_suspend+0xbc/0xcc)
[ 9521.719696] [<c0446284>] (usbhs_runtime_suspend+0xbc/0xcc) from [<c042ad28>] (pm_generic_runtime_suspend+0x2c/0x38)
[ 9521.719726] [<c042ad28>] (pm_generic_runtime_suspend+0x2c/0x38) from [<c0029c80>] (_od_suspend_noirq+0x48/0x78)
[ 9521.719757] [<c0029c80>] (_od_suspend_noirq+0x48/0x78) from [<c042c39c>] (dpm_run_callback+0x44/0x80)
[ 9521.719787] [<c042c39c>] (dpm_run_callback+0x44/0x80) from [<c042d0ec>] (dpm_suspend_end+0x388/0x538)
[ 9521.719848] [<c042d0ec>] (dpm_suspend_end+0x388/0x538) from [<c007e388>] (suspend_devices_and_enter+0xe8/0x430)
[ 9521.719879] [<c007e388>] (suspend_devices_and_enter+0xe8/0x430) from [<c007e7e4>] (pm_suspend+0x114/0x230)
[ 9521.719909] [<c007e7e4>] (pm_suspend+0x114/0x230) from [<c007d870>] (state_store+0x40/0x6c)
[ 9521.719940] [<c007d870>] (state_store+0x40/0x6c) from [<c036d280>] (kobj_attr_store+0x14/0x20)
[ 9521.720001] [<c036d280>] (kobj_attr_store+0x14/0x20) from [<c017e8d8>] (sysfs_write_file+0x100/0x148)
[ 9521.720031] [<c017e8d8>] (sysfs_write_file+0x100/0x148) from [<c0121524>] (vfs_write+0xa8/0x178)
[ 9521.720062] [<c0121524>] (vfs_write+0xa8/0x178) from [<c0121934>] (sys_write+0x38/0x64)
[ 9521.720123] [<c0121934>] (sys_write+0x38/0x64) from [<c000e240>] (ret_fast_syscall+0x0/0x30)
[ 9521.720642] PM: noirq suspend of devices complete after 3.448 msecs
[ 9521.720642] Disabling non-boot CPUs ...
[ 9521.721221] Successfully put all powerdomains to target state
[ 9521.728912] PM: noirq resume of devices complete after 7.415 msecs
[ 9521.731140] PM: early resume of devices complete after 1.617 msecs
[ 9522.143646] vibra disabling led output
[ 9522.670440] wlcore: firmware booted (Rev 6.3.10.2.115)
[ 9522.747650] wlcore: Association completed.
[ 9522.786682] PM: resume of devices complete after 1055.328 msecs
[ 9522.807189] PM: Finishing wakeup.
[ 9522.807220] Restarting tasks ... done.
[ 9527.379577] s_power 1
[ 9527.394195] MT9V115 beagle_cam_set_xclk 19200000
[ 9527.394805] 
[ 9527.394805]  mclk=172800000 xclk=19200000 xclksel=1 
[ 9527.394866] omap3isp omap3isp: isp_set_xclk(): cam_xclka set to 19200000 Hz
[ 9527.434509] mt9v115 2-003d: Write failed at 0x1a error -121
[ 9527.440460] omap3isp omap3isp: Failed to reset the camera
[ 9527.462799] s_power 1
[ 9527.474304] MT9V115 beagle_cam_set_xclk 19200000
[ 9527.474334] 
[ 9527.474334]  mclk=172800000 xclk=19200000 xclksel=1 
[ 9527.474426] omap3isp omap3isp: isp_set_xclk(): cam_xclka set to 19200000 Hz
[ 9527.514434] mt9v115 2-003d: Write failed at 0x1a error -121
[ 9527.520385] omap3isp omap3isp: Failed to reset the camera

The camera after suspend if found to be working at 1.4Mhz. Before resume the camera was working properly at 24Mhz.