From 8523472ac8fbbef893238b6b2e7f53455f400dae Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Fri, 17 Feb 2017 16:37:45 +0530 Subject: [PATCH] qcacld-3.0: Avoid ROC duration to exceed maximum ROC duration While extending the duration for ROC, the driver updates the new duration value with the 2 or 5 times of the current duration value, that leads to exceed the maximum ROC duration value. The change is to check the current duration value and increase it accordingly to avoid exceeding the maximum ROC duration value. Change-Id: I05658adfdeae32eecdfff939d132484c584c0aa8 CRs-Fixed: 2008441 --- core/hdd/src/wlan_hdd_p2p.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 6baf215cfd50..4de2bfe791d9 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -591,10 +591,12 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, /* Extending duration for proactive extension logic for RoC */ duration = pRemainChanCtx->duration; - if (isGoPresent == true) - duration = P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT * duration; - else - duration = P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT * duration; + if (duration < HDD_P2P_MAX_ROC_DURATION) { + if (isGoPresent == true) + duration *= P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT; + else + duration *= P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT; + } hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.roc);