msm: ipa: change default low watermark for rx buffers

Change the threshold for resubmitting RX buffers to IPA in case
of allocation errors to a bigger number than 0.
In some corner cases a packet from IPA to AP might be larger than
the side of 1 buffer, which can result in IPA stall if threshold
is 0.

CRs-Fixed: 1027726
Change-Id: Ic841de25597c2cd4ce007823f9b9727e858a73cb
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
This commit is contained in:
Skylar Chang 2016-06-27 14:10:12 -07:00 committed by Kyle Yan
parent 0806bdaa9a
commit e9e09e35af
4 changed files with 17 additions and 9 deletions

View file

@ -1165,7 +1165,7 @@ void ipa_update_repl_threshold(enum ipa_client_type ipa_client)
* Determine how many buffers/descriptors remaining will * Determine how many buffers/descriptors remaining will
* cause to drop below the yellow WM bar. * cause to drop below the yellow WM bar.
*/ */
ep->rx_replenish_threshold = ipa_get_sys_yellow_wm() ep->rx_replenish_threshold = ipa_get_sys_yellow_wm(ep->sys)
/ ep->sys->rx_buff_sz; / ep->sys->rx_buff_sz;
} }
@ -1361,7 +1361,7 @@ int ipa2_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl)
* Determine how many buffers/descriptors remaining will * Determine how many buffers/descriptors remaining will
* cause to drop below the yellow WM bar. * cause to drop below the yellow WM bar.
*/ */
ep->rx_replenish_threshold = ipa_get_sys_yellow_wm() ep->rx_replenish_threshold = ipa_get_sys_yellow_wm(ep->sys)
/ ep->sys->rx_buff_sz; / ep->sys->rx_buff_sz;
/* Only when the WAN pipes are setup, actual threshold will /* Only when the WAN pipes are setup, actual threshold will
* be read from the register. So update LAN_CONS ep again with * be read from the register. So update LAN_CONS ep again with

View file

@ -1911,7 +1911,7 @@ int ipa2_uc_mhi_stop_event_update_channel(int channelHandle);
int ipa2_uc_mhi_print_stats(char *dbg_buff, int size); int ipa2_uc_mhi_print_stats(char *dbg_buff, int size);
int ipa_uc_memcpy(phys_addr_t dest, phys_addr_t src, int len); int ipa_uc_memcpy(phys_addr_t dest, phys_addr_t src, int len);
u32 ipa_get_num_pipes(void); u32 ipa_get_num_pipes(void);
u32 ipa_get_sys_yellow_wm(void); u32 ipa_get_sys_yellow_wm(struct ipa_sys_context *sys);
struct ipa_smmu_cb_ctx *ipa2_get_smmu_ctx(void); struct ipa_smmu_cb_ctx *ipa2_get_smmu_ctx(void);
struct ipa_smmu_cb_ctx *ipa2_get_wlan_smmu_ctx(void); struct ipa_smmu_cb_ctx *ipa2_get_wlan_smmu_ctx(void);
struct ipa_smmu_cb_ctx *ipa2_get_uc_smmu_ctx(void); struct ipa_smmu_cb_ctx *ipa2_get_uc_smmu_ctx(void);

View file

@ -44,6 +44,8 @@
#define IPA_EOT_COAL_GRAN_MIN (1) #define IPA_EOT_COAL_GRAN_MIN (1)
#define IPA_EOT_COAL_GRAN_MAX (16) #define IPA_EOT_COAL_GRAN_MAX (16)
#define IPA_DEFAULT_SYS_YELLOW_WM 32
#define IPA_AGGR_BYTE_LIMIT (\ #define IPA_AGGR_BYTE_LIMIT (\
IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_BMSK >> \ IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_BMSK >> \
IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_SHFT) IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_SHFT)
@ -5074,15 +5076,19 @@ int ipa2_bind_api_controller(enum ipa_hw_type ipa_hw_type,
* ipa_get_sys_yellow_wm()- Return yellow WM value for IPA SYS pipes. * ipa_get_sys_yellow_wm()- Return yellow WM value for IPA SYS pipes.
* *
* Return value: IPA_YELLOW_MARKER_SYS_CFG_OFST register if IPA_HW_v2.6L, * Return value: IPA_YELLOW_MARKER_SYS_CFG_OFST register if IPA_HW_v2.6L,
* 0 otherwise. * IPA_DEFAULT_SYS_YELLOW_WM otherwise.
*/ */
u32 ipa_get_sys_yellow_wm(void) 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) {
return ipa_read_reg(ipa_ctx->mmio, return ipa_read_reg(ipa_ctx->mmio,
IPA_YELLOW_MARKER_SYS_CFG_OFST); IPA_YELLOW_MARKER_SYS_CFG_OFST);
else } else {
if (!sys)
return 0; return 0;
return IPA_DEFAULT_SYS_YELLOW_WM * sys->rx_buff_sz;
}
} }
EXPORT_SYMBOL(ipa_get_sys_yellow_wm); EXPORT_SYMBOL(ipa_get_sys_yellow_wm);

View file

@ -68,6 +68,8 @@
/* The below virtual channel cannot be used by any entity */ /* The below virtual channel cannot be used by any entity */
#define IPA_GSI_CH_20_WA_VIRT_CHAN 29 #define IPA_GSI_CH_20_WA_VIRT_CHAN 29
#define IPA_DEFAULT_SYS_YELLOW_WM 32
static struct sk_buff *ipa3_get_skb_ipa_rx(unsigned int len, gfp_t flags); static struct sk_buff *ipa3_get_skb_ipa_rx(unsigned int len, gfp_t flags);
static void ipa3_replenish_wlan_rx_cache(struct ipa3_sys_context *sys); static void ipa3_replenish_wlan_rx_cache(struct ipa3_sys_context *sys);
static void ipa3_replenish_rx_cache(struct ipa3_sys_context *sys); static void ipa3_replenish_rx_cache(struct ipa3_sys_context *sys);
@ -2300,7 +2302,7 @@ static void ipa3_fast_replenish_rx_cache(struct ipa3_sys_context *sys)
queue_work(sys->repl_wq, &sys->repl_work); queue_work(sys->repl_wq, &sys->repl_work);
if (rx_len_cached == 0) { if (rx_len_cached <= IPA_DEFAULT_SYS_YELLOW_WM) {
if (sys->ep->client == IPA_CLIENT_APPS_WAN_CONS) if (sys->ep->client == IPA_CLIENT_APPS_WAN_CONS)
IPA_STATS_INC_CNT(ipa3_ctx->stats.wan_rx_empty); IPA_STATS_INC_CNT(ipa3_ctx->stats.wan_rx_empty);
else if (sys->ep->client == IPA_CLIENT_APPS_LAN_CONS) else if (sys->ep->client == IPA_CLIENT_APPS_LAN_CONS)