From f5e306f78517823264b78f7feb016bb8384aee5e Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 25 Aug 2016 14:55:14 -0700 Subject: [PATCH] qcacmn: Fail PM suspend if target has sent initial wake up Host is not handling target initial wake up properly which is leading to resume failure. Fail PM suspend request if target has sent initial wake up message. Change-Id: I3797f1afa99ed9412b7ded3e1ea85c344bd0f435 CRs-Fixed: 1059543 --- htc/htc_api.h | 1 + htc/htc_recv.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htc/htc_api.h b/htc/htc_api.h index 835cc014ebae..4768c0aac663 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -57,6 +57,7 @@ typedef struct _HTC_INIT_INFO { void *pContext; /* context for target notifications */ void (*TargetFailure)(void *Instance, QDF_STATUS Status); void (*TargetSendSuspendComplete)(void *ctx, bool is_nack); + void (*target_initial_wakeup_cb)(void); } HTC_INIT_INFO; /* Struct for HTC layer packet stats*/ diff --git a/htc/htc_recv.c b/htc/htc_recv.c index 49e2fddebba0..cc466d514278 100644 --- a/htc/htc_recv.c +++ b/htc/htc_recv.c @@ -440,16 +440,21 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf, qdf_event_set(&target->ctrl_response_valid); break; -#ifdef CONFIG_MCL +#ifdef HTC_MSG_WAKEUP_FROM_SUSPEND_ID case HTC_MSG_WAKEUP_FROM_SUSPEND_ID: AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Received initial wake up\n")); + ("Received initial wake up")); LOCK_HTC_CREDIT(target); htc_credit_record(HTC_INITIAL_WAKE_UP, pEndpoint->TxCredits, HTC_PACKET_QUEUE_DEPTH( &pEndpoint->TxQueue)); UNLOCK_HTC_CREDIT(target); + if (target->HTCInitInfo.target_initial_wakeup_cb) + target->HTCInitInfo.target_initial_wakeup_cb(); + else + AR_DEBUG_PRINTF(ATH_DEBUG_ANY, + ("No initial wake up cb")); break; #endif case HTC_MSG_SEND_SUSPEND_COMPLETE: