summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorSkylar Chang <chiaweic@codeaurora.org>2016-04-12 16:53:17 -0700
committerKyle Yan <kyan@codeaurora.org>2016-04-27 19:04:46 -0700
commit81d9bef7e6c95d4be648e994de7960f46a23a078 (patch)
tree775091bc05dac50da255d938d8cc4087d9663ce5 /drivers/platform
parent710b2695c142e338e37b8f4fe5481728f3acff40 (diff)
msm: ipa3: use user parameter for GSI ring len
Calculate GSI ring length based on the input parameter to setup pipe API. Change-Id: I151400624f374262a955a04d211a96c43feb6d98 CRs-Fixed: 996292 Acked-by: Ady Abraham <adya@qti.qualcomm.com> Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_dp.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
index 41d6548d76ff..5e67101a987f 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
@@ -52,7 +52,6 @@
#define IPA_SIZE_DL_CSUM_META_TRAILER 8
#define IPA_GSI_EVT_RING_LEN 4096
-#define IPA_GSI_CHANNEL_RING_LEN 4096
#define IPA_GSI_MAX_CH_LOW_WEIGHT 15
#define IPA_GSI_EVT_RING_INT_MODT 3200 /* 0.1s under 32KHz clock */
@@ -75,7 +74,8 @@ static void ipa3_cleanup_wlan_rx_common_cache(void);
static void ipa3_wq_repl_rx(struct work_struct *work);
static void ipa3_dma_memcpy_notify(struct ipa3_sys_context *sys,
struct ipa3_mem_buffer *mem_info);
-static int ipa_gsi_setup_channel(struct ipa3_ep_context *ep);
+static int ipa_gsi_setup_channel(struct ipa_sys_connect_params *in,
+ struct ipa3_ep_context *ep);
static int ipa_populate_tag_field(struct ipa3_desc *desc,
struct ipa3_tx_pkt_wrapper *tx_pkt,
struct ipahal_imm_cmd_pyld **tag_pyld_ret);
@@ -1174,7 +1174,7 @@ int ipa3_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl)
}
if (ipa3_ctx->transport_prototype == IPA_TRANSPORT_TYPE_GSI) {
- result = ipa_gsi_setup_channel(ep);
+ result = ipa_gsi_setup_channel(sys_in, ep);
if (result) {
IPAERR("Failed to setup GSI channel\n");
goto fail_gen2;
@@ -3569,7 +3569,8 @@ static void ipa_dma_gsi_irq_rx_notify_cb(struct gsi_chan_xfer_notify *notify)
}
-static int ipa_gsi_setup_channel(struct ipa3_ep_context *ep)
+static int ipa_gsi_setup_channel(struct ipa_sys_connect_params *in,
+ struct ipa3_ep_context *ep)
{
struct gsi_evt_ring_props gsi_evt_ring_props;
struct gsi_chan_props gsi_channel_props;
@@ -3642,10 +3643,19 @@ static int ipa_gsi_setup_channel(struct ipa3_ep_context *ep)
gsi_channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
gsi_channel_props.re_size = GSI_CHAN_RE_SIZE_16B;
- gsi_channel_props.ring_len = IPA_GSI_CHANNEL_RING_LEN;
+ /*
+ * GSI ring length is calculated based on the desc_fifo_sz which was
+ * meant to define the BAM desc fifo. GSI descriptors are 16B as opposed
+ * to 8B for BAM. For PROD pipes there is also an additional descriptor
+ * for TAG STATUS immediate command.
+ */
+ if (IPA_CLIENT_IS_PROD(ep->client))
+ gsi_channel_props.ring_len = 4 * in->desc_fifo_sz;
+ else
+ gsi_channel_props.ring_len = 2 * in->desc_fifo_sz;
gsi_channel_props.ring_base_vaddr =
- dma_alloc_coherent(ipa3_ctx->pdev, IPA_GSI_CHANNEL_RING_LEN,
- &dma_addr, 0);
+ dma_alloc_coherent(ipa3_ctx->pdev, gsi_channel_props.ring_len,
+ &dma_addr, 0);
gsi_channel_props.ring_base_addr = dma_addr;
/* copy mem info */