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.

关于DM3730的安卓系统的休眠问题

Other Parts Discussed in Thread: DM3730

最近在做安卓的系统的产品,平台是DM3730,做到休眠唤醒的时候遇到了问题,实在是走不动了,希望得到帮助:

1、软件是从官网下的TI Android ICS 4.0.3 DevKit 3.0.0,遇到的问题和我尝试解决的办法如下:

1、休眠的时候会报错,

[  110.055938] Powerdomain (mpu_pwrdm) didn't enter target state 0

 [  110.062133] Powerdomain (neon_pwrdm) didn't enter target state 0

 [  110.068389] Powerdomain (core_pwrdm) didn't enter target state 0

 [  110.074676] Powerdomain (per_pwrdm) didn't enter target state 0

 [  110.080871] Could not enter target state in pm_suspend

[  110.202423] cm: Module associated with clock usbhost_48m_fck didn't enable in 100000 tries

[  110.223144] last sysfs file: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state

 [  110.231323] Modules linked in: omaplfb pvrsrvkm

 [  110.236053] CPU: 0    Not tainted  (2.6.37 #205)

[  110.240905] PC is at ehci_omap_enable+0x24/0x70

[  110.245635] LR is at omap2_clk_enable+0x100/0x178

先从usb的错误入手,根据内核的提醒,我找到了问题的位置,是在恢复usb的时候失败了,从网上找了一个说

In reply to zell wu:

Hi Zell,

I had encountered this issue earlier. This happens in the following sequence

EHCI USB suspend -> Wake Lock driver suspend(power.0) reports an Active Wakelock, Returns EAGAIN(-11) -> EHCI USB resume

On this premature resume of EHCI USB, Interface clock enable fails and results in crash when accessing registers.

I could not find out why this clock enable fails. I have a patch which changes the order of suspend calls, moving the EHCI USB suspend to the end of driver suspend list.

Please try the attached patch and it is a hack to fix the issue.

Regards,

根据他的描述,好像是暂停和恢复的顺序问题,我按照他的patch修改了之后问题依旧,后来我就试着在睡眠和恢复的时候不调用ehci_omap_enable函数,但是测试虽然不报错了,但是却会提示

Powerdomain (usbhost_pwrdm) didn't enter target state 0

这是因为没有停止usb的时钟造成的,因为usb没有停止所以无法进去睡眠状态,所以还是需要解决这个问题的。

2、以下错误

[  110.055938] Powerdomain (mpu_pwrdm) didn't enter target state 0

[  110.062133] Powerdomain (neon_pwrdm) didn't enter target state 0

[  110.068389] Powerdomain (core_pwrdm) didn't enter target state 0

 [  110.074676] Powerdomain (per_pwrdm) didn't enter target state 0

根据提示着明显是因为这几个核心无法进入休眠造成的,我用了cat /debug/pm_debug/count查看的结果是

usbhost_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 sgx_pwrdm (ON),OFF:1,RET:0,INA:0,ON:2,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0

per_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 dss_pwrdm (OFF),OFF:4,RET:0,INA:4,ON:7,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0

cam_pwrdm (OFF),OFF:1,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 core_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0

neon_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0

mpu_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0

iva2_pwrdm (OFF),OFF:1,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0,RET-MEMBANK4-OFF:0

 per_clkdm->per_pwrdm (13)

 usbhost_clkdm->usbhost_pwrdm (3)

cam_clkdm->cam_pwrdm (0)

 dss_clkdm->dss_pwrdm (0)

 core_l4_clkdm->core_pwrdm (17)

 core_l3_clkdm->core_pwrdm (5)

d2d_clkdm->core_pwrdm (0)

sgx_clkdm->sgx_pwrdm (2)

iva2_clkdm->iva2_pwrdm (0)

neon_clkdm->neon_pwrdm (0)

mpu_clkdm->mpu_pwrdm (0)

prm_clkdm->wkup_pwrdm (0)

cm_clkdm->core_pwrdm (0)

根据上面的提示,可以看出来确实是没有进入睡眠模式,但是usb的还好解释,虽然不能解决,但是起码知道错在哪,其他几个核心就

真的是没有头绪了,为什么不能睡眠。