From 65a2613ab63410ab3e533d9798d26e9749349f0f Mon Sep 17 00:00:00 2001 From: Yuan Liu Date: Tue, 6 Nov 2018 09:48:11 +0800 Subject: [PATCH] IOC mediator: fix wakeup reason issue when UOS resuming IOC mediator should keep sending acnrd boot reason until received UOS heartbeat init message, then turn to send SOS wakeup reason through read native cbc lifecycle cdev. Tracked-On: #1727 Signed-off-by: Yuan Liu Acked-by: Yu Wang --- devicemodel/hw/platform/ioc_cbc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/devicemodel/hw/platform/ioc_cbc.c b/devicemodel/hw/platform/ioc_cbc.c index 0d8721b4e..2388c34ac 100644 --- a/devicemodel/hw/platform/ioc_cbc.c +++ b/devicemodel/hw/platform/ioc_cbc.c @@ -652,14 +652,14 @@ cbc_process_wakeup_reason(struct cbc_pkt *pkt) /* Unset RTC bit if UOS sends active heartbeat */ reason &= ~CBC_WK_RSN_RTC; } else { - reason &= ~CBC_WK_RSN_SOC; - /* - * Set RTC bit when bootup or resuming reason is - * RTC wakeup reason, and hold the bit until UOS - * sends active heartbeat. + * If UOS is inactive, indicate the acrnd boot reason + * as UOS periodic wakeup reason. */ - reason |= pkt->ioc->boot_reason & CBC_WK_RSN_RTC; + reason = pkt->ioc->boot_reason; + + /* Unset SoC bit */ + reason &= ~CBC_WK_RSN_SOC; } /* Update periodic wakeup reason */ @@ -949,7 +949,8 @@ cbc_tx_handler(struct cbc_pkt *pkt) /* Heartbeat init also indicates UOS enter active state */ pkt->uos_active = true; } else if (pkt->req->rtype == CBC_REQ_T_UOS_ACTIVE) { - cbc_update_wakeup_reason(pkt, pkt->reason | CBC_WK_RSN_SOC); + cbc_update_wakeup_reason(pkt, pkt->ioc->boot_reason | + CBC_WK_RSN_SOC); cbc_send_pkt(pkt); /* Enable UOS active flag */