From 8e3f08181433f375aaccc31599fb0f389bc3b660 Mon Sep 17 00:00:00 2001 From: Skylar Chang Date: Wed, 25 Jan 2017 09:16:55 -0800 Subject: [PATCH] msm: rmnet_ipa: do not release resource on pending data In case there is pending data submitted to IPA, IPA RM resource should not be released. The resource release happens only when all packets were processed by IPA. CRs-Fixed: 1116262 Change-Id: I19756cbe4f84a5d09853d6066362e4a2c9ae1f73 Acked-by: Ady Abraham Signed-off-by: Skylar Chang --- drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c index f042d19f196a..214a697a5d91 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1154,8 +1154,9 @@ send: dev->stats.tx_bytes += skb->len; ret = NETDEV_TX_OK; out: - ipa_rm_inactivity_timer_release_resource( - IPA_RM_RESOURCE_WWAN_0_PROD); + if (atomic_read(&wwan_ptr->outstanding_pkts) == 0) + ipa_rm_inactivity_timer_release_resource( + IPA_RM_RESOURCE_WWAN_0_PROD); return ret; } @@ -1206,10 +1207,12 @@ static void apps_ipa_tx_complete_notify(void *priv, wwan_ptr->outstanding_low); netif_wake_queue(wwan_ptr->net); } + + if (atomic_read(&wwan_ptr->outstanding_pkts) == 0) + ipa_rm_inactivity_timer_release_resource( + IPA_RM_RESOURCE_WWAN_0_PROD); __netif_tx_unlock_bh(netdev_get_tx_queue(dev, 0)); dev_kfree_skb_any(skb); - ipa_rm_inactivity_timer_release_resource( - IPA_RM_RESOURCE_WWAN_0_PROD); } /**