From adbb0e79a2ca370fb09a70c9c17eb66dfe2498ed Mon Sep 17 00:00:00 2001 From: edwakuwaku Date: Mon, 13 May 2024 15:05:38 +0800 Subject: [PATCH] os/pm: Cleanup PM code - Remove some logs, change tick printing to %lld because we are using u64 for clock_t --- os/arch/arm/src/amebasmart/amebasmart_pmhelpers.c | 1 - .../src/component/soc/amebad2/misc/ameba_tizenrt_pmu.c | 6 +++++- os/pm/pm_wakehandler.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/os/arch/arm/src/amebasmart/amebasmart_pmhelpers.c b/os/arch/arm/src/amebasmart/amebasmart_pmhelpers.c index cefa0ee167..d05791cd2c 100644 --- a/os/arch/arm/src/amebasmart/amebasmart_pmhelpers.c +++ b/os/arch/arm/src/amebasmart/amebasmart_pmhelpers.c @@ -151,7 +151,6 @@ void SOCPS_LPWAP_ipc_int(VOID *Data, u32 IrqStatus, u32 ChanNum) UNUSED(IrqStatus); UNUSED(ChanNum); - pmvdbg("IPC wakeup interrupt handler!!\n"); pm_activity(PM_IDLE_DOMAIN, 9); ipc_get_message(IPC_LP_TO_AP, IPC_L2A_Channel1); diff --git a/os/board/rtl8730e/src/component/soc/amebad2/misc/ameba_tizenrt_pmu.c b/os/board/rtl8730e/src/component/soc/amebad2/misc/ameba_tizenrt_pmu.c index 0dfd317d7a..0020c7ba66 100644 --- a/os/board/rtl8730e/src/component/soc/amebad2/misc/ameba_tizenrt_pmu.c +++ b/os/board/rtl8730e/src/component/soc/amebad2/misc/ameba_tizenrt_pmu.c @@ -296,6 +296,10 @@ void tizenrt_pre_sleep_processing(uint32_t *expected_idle_time) SOCPS_SleepPG(); } + /* When we reach back here, LP core might be still printing information + Thus, we should add wait LOGUART TX complete, before AP core start printing logs */ + LOGUART_WaitTxComplete(); + /* update kernel tick by calculating passed tick from gtimer */ /* get current gtimer timestamp */ tick_passed = SYSTIMER_GetPassTick(tick_before_sleep); @@ -311,7 +315,7 @@ void tizenrt_pre_sleep_processing(uint32_t *expected_idle_time) #else #ifdef CONFIG_PM_TICKSUPPRESS if (tizenrt_sleep_handler) { - tizenrt_sleep_handler(ms_passed); /* update kernel tick */ + tizenrt_sleep_handler((u64)ms_passed); /* update kernel tick */ } #endif #endif diff --git a/os/pm/pm_wakehandler.c b/os/pm/pm_wakehandler.c index 8301f030aa..cf2e8409e8 100644 --- a/os/pm/pm_wakehandler.c +++ b/os/pm/pm_wakehandler.c @@ -55,7 +55,7 @@ void pm_wakehandler(clock_t missing_tick) { irqstate_t flags = enter_critical_section(); - pmllvdbg("missing_tick: %d\n", missing_tick); + pmllvdbg("missing_tick: %lld\n", missing_tick); if (missing_tick > 0) { clock_timer_nohz((clock_t)missing_tick);