how to enable serial console during android suspend?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to enable serial console during android suspend?

跳至解决方案
6,121 次查看
abraham_v
Contributor IV

Hello,

I have a custom IMX6D board running android based off the sabresd android JB 4.2.2 release. A lot of our debugging is done over the serial (UART1) console. When android goes into its low-power suspend state, the console becomes un-responsive. Only way to 'wake up' the console is to press the power button, which also brings the entire system (including display) back up.

Is there any way to have the system enter low power suspend state, but keep the serial console enabled for debug purposes?

I've tried adding 'no_console_suspend' to the boot arguments for kernel, but the console still goes dead when the system enters suspend mode.

Stumped,

Abraham V.

标签 (3)
标记 (4)
1 解答
3,738 次查看
rickchu
Contributor IV

Hi Abraham,

Do you want to debug suspend/resume stability in your device? Or any others?

The UART will not workable when device into suspend mode, its because the CPU enter suspend mode too.

If you want to suspend Android system only and keep kernel still alive, you can modify /kernel/kernel/power/main.c to block kernel enter suspend.

After above changed, the Android system will suspend (LCD, Touch and Audio also stop working) but kernel still on work, so you can using debug UART on this status.

static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,

    const char *buf, size_t n)

{

#if 0

  /*

  * Not enter suspend mode

  */

  do {} while (0);

  return 0;

#else

#ifdef CONFIG_SUSPEND

....

Exit:

  return error ? error : n;

#endif

}

Rick

在原帖中查看解决方案

4 回复数
3,738 次查看
shanmugamsundar
Contributor IV

hi abraham,

Have enabled the CONFIG_DISABLE_CONSOLE_SUSPEND in your defconfig file? can you plz check it out

Thanks

shan    

0 项奖励
回复
3,738 次查看
abraham_v
Contributor IV

Thanks for replying Shan.

Unfortunately, that was among the things I looked into. When I open up "make menuconfig" before building the kernel and try a search, "CONFIG_DISABLE_CONSOLE_SUSPEND" isn't there. :smileysad:

-Abraham V.

0 项奖励
回复
3,739 次查看
rickchu
Contributor IV

Hi Abraham,

Do you want to debug suspend/resume stability in your device? Or any others?

The UART will not workable when device into suspend mode, its because the CPU enter suspend mode too.

If you want to suspend Android system only and keep kernel still alive, you can modify /kernel/kernel/power/main.c to block kernel enter suspend.

After above changed, the Android system will suspend (LCD, Touch and Audio also stop working) but kernel still on work, so you can using debug UART on this status.

static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,

    const char *buf, size_t n)

{

#if 0

  /*

  * Not enter suspend mode

  */

  do {} while (0);

  return 0;

#else

#ifdef CONFIG_SUSPEND

....

Exit:

  return error ? error : n;

#endif

}

Rick

3,738 次查看
abraham_v
Contributor IV

Thank you Rick!

That was exactly what I was looking for.

Relieved,

Abraham V.

0 项奖励
回复