diff options
author | Utkarsh Saxena <usaxena@codeaurora.org> | 2017-03-03 15:38:45 +0530 |
---|---|---|
committer | Utkarsh Saxena <usaxena@codeaurora.org> | 2017-03-07 16:44:12 +0530 |
commit | 03cbd472f6c2edb31610706b384b40adeb783541 (patch) | |
tree | f88545b9e31b9a939fd18e895a1107ab82fb0955 /drivers/platform/msm | |
parent | 2a7bbea49bd05426d54b3392ac780a93490c6542 (diff) |
msm: ipa: Fix updating the repl_trig_thresh for LAN_CONS
Replenish trigger threshold for LAN_CONS is calculated
before updating the rx_pool_sz. This can result into
division by 0 which can make the system unstable.
Make a change to update the rx_pool_sz before updating
the replenish trigger threshold.
Change-Id: I62f6c114ce7aee571833ef05146ab75cab0fb5d2
Acked-by: Chaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
Diffstat (limited to 'drivers/platform/msm')
-rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa_dp.c | 6 | ||||
-rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa_utils.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c index 7b48991cba65..a2665c9e9688 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-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 @@ -3147,6 +3147,8 @@ static int ipa_assign_policy_v2(struct ipa_sys_connect_params *in, IPA_GENERIC_AGGR_TIME_LIMIT; if (in->client == IPA_CLIENT_APPS_LAN_CONS) { sys->pyld_hdlr = ipa_lan_rx_pyld_hdlr; + sys->rx_pool_sz = + ipa_ctx->lan_rx_ring_size; if (nr_cpu_ids > 1) { sys->repl_hdlr = ipa_fast_replenish_rx_cache; @@ -3156,8 +3158,6 @@ static int ipa_assign_policy_v2(struct ipa_sys_connect_params *in, sys->repl_hdlr = ipa_replenish_rx_cache; } - sys->rx_pool_sz = - ipa_ctx->lan_rx_ring_size; in->ipa_ep_cfg.aggr.aggr_byte_limit = IPA_GENERIC_AGGR_BYTE_LIMIT; in->ipa_ep_cfg.aggr.aggr_pkt_limit = diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c index 9cab7e010c3a..d53121292c03 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c @@ -5161,7 +5161,8 @@ int ipa2_bind_api_controller(enum ipa_hw_type ipa_hw_type, */ u32 ipa_get_sys_yellow_wm(struct ipa_sys_context *sys) { - if (ipa_ctx->ipa_hw_type == IPA_HW_v2_6L) { + if (ipa_ctx->ipa_hw_type == IPA_HW_v2_6L && + ipa_ctx->ipa_uc_monitor_holb) { return ipa_read_reg(ipa_ctx->mmio, IPA_YELLOW_MARKER_SYS_CFG_OFST); } else { |