Merge 3cb33329d4 on remote branch

Change-Id: Id01b330601b09e152eb3d9475da78f9058483900
This commit is contained in:
Linux Build Service Account 2021-06-22 23:55:30 -07:00
commit 23ee095331
11 changed files with 181 additions and 48 deletions

View file

@ -39,6 +39,19 @@ include $(srctree)/techpack/dataipa/config/dataipa_gsi_V1_GKI.conf
endif
endif
ifeq ($(CONFIG_ARCH_MONACO), y)
LINUXINCLUDE += -include $(srctree)/techpack/dataipa/config/dataipa_gsi_V1.h
ifeq ($(CONFIG_QGKI),y)
include $(srctree)/techpack/dataipa/config/dataipa_gsi_V1_QGKI.conf
ifeq ($(CONFIG_LOCALVERSION), "-qgki-debug")
include $(srctree)/techpack/dataipa/config/dataipa_debug.conf
LINUXINCLUDE += -include $(srctree)/techpack/dataipa/config/dataipa_debug.h
endif
else
include $(srctree)/techpack/dataipa/config/dataipa_gsi_V1_GKI.conf
endif
endif
DATAIPADRVTOP = $(srctree)/techpack/dataipa/drivers/platform/msm
ifneq (,$(filter $(CONFIG_IPA3),y m))

View file

@ -3213,6 +3213,7 @@ int gsi_stop_channel(unsigned long chan_hdl)
int res;
uint32_t val;
struct gsi_chan_ctx *ctx;
unsigned long flags;
if (!gsi_ctx) {
pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__);
@ -3279,6 +3280,15 @@ int gsi_stop_channel(unsigned long chan_hdl)
goto free_lock;
}
/* If channel is stopped succesfully and has an event with IRQ type MSI
- clear IEOB */
if (ctx->evtr && ctx->evtr->props.intr == GSI_INTR_MSI) {
spin_lock_irqsave(&ctx->evtr->ring.slock, flags);
gsi_writel(1 << ctx->evtr->id, gsi_ctx->base +
GSI_EE_n_CNTXT_SRC_IEOB_IRQ_CLR_OFFS(gsi_ctx->per.ee));
spin_unlock_irqrestore(&ctx->evtr->ring.slock, flags);
}
res = GSI_STATUS_SUCCESS;
free_lock:

View file

@ -190,7 +190,7 @@ struct gsi_evt_ring_props {
enum gsi_evt_chtype intf;
enum gsi_intr_type intr;
enum gsi_evt_ring_elem_size re_size;
uint16_t ring_len;
uint32_t ring_len;
uint64_t ring_base_addr;
void *ring_base_vaddr;
uint16_t int_modt;
@ -473,7 +473,7 @@ struct gsi_chan_props {
uint8_t ch_id;
unsigned long evt_ring_hdl;
enum gsi_chan_ring_elem_size re_size;
uint16_t ring_len;
uint32_t ring_len;
uint16_t max_re_expected;
uint64_t ring_base_addr;
uint8_t db_in_bytes;
@ -1151,7 +1151,7 @@ struct gsi_ring_ctx {
uint64_t rp;
uint64_t wp_local;
uint64_t rp_local;
uint16_t len;
uint32_t len;
uint8_t elem_sz;
uint16_t max_num_elem;
uint64_t end;

View file

@ -681,8 +681,9 @@ static ssize_t gsi_read_gsi_hw_profiling_stats(struct file *file,
totalCycles = stats.mcs_busy_cnt + stats.mcs_idle_cnt +
stats.bp_and_pending_cnt;
if (totalCycles != 0)
util = (100 * (stats.mcs_busy_cnt + stats.bp_and_pending_cnt)) /
totalCycles;
util = div_u64(
100 * (stats.mcs_busy_cnt + stats.bp_and_pending_cnt),
totalCycles);
else
util = 0;

View file

@ -7629,11 +7629,14 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
goto fail_wwan_init;
}
result = ipa3_rmnet_ctl_init();
if (result) {
IPAERR(":ipa3_rmnet_ctl_init err=%d\n", -result);
result = -ENODEV;
goto fail_rmnet_ctl_init;
if (ipa3_ctx->rmnet_ctl_enable) {
result = ipa3_rmnet_ctl_init();
if (result) {
IPAERR(":ipa3_rmnet_ctl_init err=%d\n",
-result);
result = -ENODEV;
goto fail_rmnet_ctl_init;
}
}
}
mutex_init(&ipa3_ctx->app_clock_vote.mutex);

View file

@ -2885,7 +2885,7 @@ static int ipa3_lan_rx_pyld_hdlr(struct sk_buff *skb,
unsigned long ptr;
IPA_DUMP_BUFF(skb->data, 0, skb->len);
trace_ipa3_lan_rx_pyld_hdlr_entry(skb,sys->ep->client);
if (skb->len == 0) {
IPAERR("ZLT packet arrived to AP\n");
goto out;
@ -3167,6 +3167,7 @@ begin:
out:
ipa3_skb_recycle(skb);
trace_ipa3_lan_rx_pyld_hdlr_exit(sys->ep->client);
return 0;
}
@ -3433,6 +3434,7 @@ void ipa3_lan_rx_cb(void *priv, enum ipa_dp_evt_type evt, unsigned long data)
void *client_priv;
ipahal_pkt_status_parse_thin(rx_skb->data, &status);
trace_ipa3_lan_rx_cb_entry(status.endp_src_idx);
src_pipe = status.endp_src_idx;
metadata = status.metadata;
ucp = status.ucp;
@ -3474,6 +3476,7 @@ void ipa3_lan_rx_cb(void *priv, enum ipa_dp_evt_type evt, unsigned long data)
dev_kfree_skb_any(rx_skb);
}
trace_ipa3_lan_rx_cb_exit(status.endp_src_idx);
}
static void ipa3_recycle_rx_wrapper(struct ipa3_rx_pkt_wrapper *rx_pkt)
@ -5246,6 +5249,7 @@ int ipa3_lan_rx_poll(u32 clnt_hdl, int weight)
return cnt;
}
ep = &ipa3_ctx->ep[clnt_hdl];
trace_ipa3_napi_poll_entry(ep->client);
start_poll:
/*
@ -5285,6 +5289,7 @@ start_poll:
IPA_ACTIVE_CLIENTS_DEC_EP_NO_BLOCK(ep->client);
}
trace_ipa3_napi_poll_exit(ep->client, cnt, ep->sys->len);
return cnt;
}
@ -5387,7 +5392,7 @@ start_poll:
IPADBG_LOW("Client = %d not replenished free descripotrs\n",
ep->client);
}
trace_ipa3_napi_poll_exit(ep->client);
trace_ipa3_napi_poll_exit(ep->client, cnt, ep->sys->len);
return cnt;
}

View file

@ -230,19 +230,23 @@ TRACE_EVENT(
TRACE_EVENT(
ipa3_napi_poll_exit,
TP_PROTO(unsigned long client),
TP_PROTO(unsigned long client, u32 cnt, u32 len),
TP_ARGS(client),
TP_ARGS(client, cnt, len),
TP_STRUCT__entry(
__field(unsigned long, client)
__field(unsigned int, cnt)
__field(unsigned int, len)
),
TP_fast_assign(
__entry->client = client;
__entry->cnt = cnt;
__entry->len = len;
),
TP_printk("client=%lu", __entry->client)
TP_printk("client=%lu napi weight cnt = %d sys->len = %d", __entry->client, __entry->cnt, __entry->len)
);
TRACE_EVENT(
@ -297,6 +301,84 @@ TRACE_EVENT(
TP_printk("client=%lu", __entry->client)
);
TRACE_EVENT(
ipa3_lan_rx_pyld_hdlr_entry,
TP_PROTO(const struct sk_buff *skb, unsigned long client),
TP_ARGS(skb, client),
TP_STRUCT__entry(
__field(unsigned int, len)
__field(unsigned int, data_len)
__field(unsigned long, client)
),
TP_fast_assign(
__entry->len = skb->len;
__entry->data_len = skb->data_len;
__entry->client = client;
),
TP_printk("len=%u data_len=%u client=%lu",
__entry->len,
__entry->data_len,
__entry->client)
);
TRACE_EVENT(
ipa3_lan_rx_pyld_hdlr_exit,
TP_PROTO(unsigned long client),
TP_ARGS(client),
TP_STRUCT__entry(
__field(unsigned long, client)
),
TP_fast_assign(
__entry->client = client;
),
TP_printk("client=%lu", __entry->client)
);
TRACE_EVENT(
ipa3_lan_rx_cb_entry,
TP_PROTO(unsigned long client),
TP_ARGS(client),
TP_STRUCT__entry(
__field(unsigned long, client)
),
TP_fast_assign(
__entry->client = client;
),
TP_printk("client=%lu", __entry->client)
);
TRACE_EVENT(
ipa3_lan_rx_cb_exit,
TP_PROTO(unsigned long client),
TP_ARGS(client),
TP_STRUCT__entry(
__field(unsigned long, client)
),
TP_fast_assign(
__entry->client = client;
),
TP_printk("client=%lu", __entry->client)
);
#endif /* _IPA_TRACE_H */
/* This part must be outside protection */

View file

@ -1579,6 +1579,11 @@ int ipa3_uc_quota_monitor(uint64_t quota)
struct IpaQuotaMonitoring_t *quota_info;
IPADBG("Enter\n");
if (!ipa3_ctx->uc_ctx.uc_event_ring_valid) {
IPADBG("uC event ring not initialized\n");
return res;
}
cmd.size = sizeof(*quota_info);
cmd.base = dma_alloc_coherent(ipa3_ctx->uc_pdev, cmd.size,
&cmd.phys_base, GFP_KERNEL);
@ -1655,6 +1660,11 @@ int ipa3_uc_bw_monitor(struct ipa_wdi_bw_info *info)
if (!info)
return -EINVAL;
if (!ipa3_ctx->uc_ctx.uc_event_ring_valid) {
IPADBG("uC event ring not initialized\n");
return res;
}
/* check max entry */
if (info->num > BW_MONITORING_MAX_THRESHOLD) {
IPAERR("%d, support max %d bw monitor\n", info->num,

View file

@ -484,7 +484,7 @@ static int ipa3_wdi_gsi_db(phys_addr_t* db_addr, struct ipa3_ep_context *ep_ctx)
/* write channel scratch */
memset(&gsi_ch_scratch, 0, sizeof(gsi_ch_scratch));
gsi_ch_scratch.wdi3.db_addr_wp_lsb = (u32)mem.phys_base;
gsi_ch_scratch.wdi3.db_addr_wp_msb = (u32)(mem.phys_base >> 32);
gsi_ch_scratch.wdi3.db_addr_wp_msb = (u32)((mem.phys_base & 0xFFFFFFFF00000000) >> 32);
IPADBG("gsi written lsb value 0x%x\n", gsi_ch_scratch.wdi3.db_addr_wp_lsb);
IPADBG("gsi written msb value 0x%x\n", gsi_ch_scratch.wdi3.db_addr_wp_msb);
@ -569,6 +569,22 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
IPADBG("wdi_notify is null\n");
#endif
/* start uC event ring */
if ((ipa3_ctx->ipa_hw_type >= IPA_HW_v4_5 &&
ipa3_ctx->ipa_hw_type != IPA_HW_v4_11) ||
ipa3_ctx->is_bw_monitor_supported) {
if (ipa3_ctx->uc_ctx.uc_loaded &&
!ipa3_ctx->uc_ctx.uc_event_ring_valid) {
if (ipa3_uc_setup_event_ring()) {
IPAERR("failed to set uc_event ring\n");
return -EFAULT;
}
} else
IPAERR("uc-loaded %d, ring-valid %d\n",
ipa3_ctx->uc_ctx.uc_loaded,
ipa3_ctx->uc_ctx.uc_event_ring_valid);
}
/* setup rx ep cfg */
ep_rx->valid = 1;
ep_rx->client = rx_client;
@ -848,22 +864,6 @@ int ipa3_enable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx)
IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(ipa_ep_idx_tx));
/* start uC event ring */
if ((ipa3_ctx->ipa_hw_type >= IPA_HW_v4_5 &&
ipa3_ctx->ipa_hw_type != IPA_HW_v4_11) ||
ipa3_ctx->is_bw_monitor_supported) {
if (ipa3_ctx->uc_ctx.uc_loaded &&
!ipa3_ctx->uc_ctx.uc_event_ring_valid) {
if (ipa3_uc_setup_event_ring()) {
IPAERR("failed to set uc_event ring\n");
return -EFAULT;
}
} else
IPAERR("uc-loaded %d, ring-valid %d\n",
ipa3_ctx->uc_ctx.uc_loaded,
ipa3_ctx->uc_ctx.uc_event_ring_valid);
}
/* enable data path */
result = ipa3_enable_data_path(ipa_ep_idx_rx);
if (result) {

View file

@ -225,7 +225,7 @@ static struct ipahal_stats_init_pyld *ipahal_generate_init_pyld_flt_rt_v4_5(
void *params, bool is_atomic_ctx)
{
struct ipahal_stats_init_pyld *pyld;
int num = (int)(params);
int num = (uintptr_t)(params);
if (num > IPA_MAX_FLT_RT_CNT_INDEX ||
num <= 0) {

View file

@ -1571,13 +1571,14 @@ static int handle3_ingress_format(struct net_device *dev,
}
IPAWANDBG("ingress WAN pipe setup successfully\n");
ret = ipa3_setup_apps_low_lat_cons_pipe();
if (ret)
goto low_lat_fail;
if (ipa3_ctx->rmnet_ctl_enable) {
ret = ipa3_setup_apps_low_lat_cons_pipe();
if (ret)
goto low_lat_fail;
ingress_eps_mask |= IPA_AP_INGRESS_EP_LOW_LAT;
IPAWANDBG("ingress low latency pipe setup successfully\n");
ingress_eps_mask |= IPA_AP_INGRESS_EP_LOW_LAT;
IPAWANDBG("ingress low latency pipe setup successfully\n");
}
low_lat_fail:
mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard);
@ -1698,13 +1699,15 @@ static int handle3_egress_format(struct net_device *dev,
return rc;
}
IPAWANDBG("engress WAN pipe setup successfully\n");
rc = ipa3_setup_apps_low_lat_prod_pipe();
if (rc) {
IPAWANERR("failed to setup egress low lat endpoint\n");
mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard);
goto low_lat_fail;
if (ipa3_ctx->rmnet_ctl_enable) {
rc = ipa3_setup_apps_low_lat_prod_pipe();
if (rc) {
IPAWANERR("failed to setup egress low lat endpoint\n");
mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard);
goto low_lat_fail;
}
IPAWANDBG("engress low lat pipe setup successfully\n");
}
IPAWANDBG("engress low lat pipe setup successfully\n");
mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard);
low_lat_fail:
@ -2755,9 +2758,11 @@ static int ipa3_wwan_remove(struct platform_device *pdev)
IPAWANINFO("rmnet_ipa started deinitialization\n");
mutex_lock(&rmnet_ipa3_ctx->pipe_handle_guard);
ret = ipa3_teardown_apps_low_lat_pipes();
if (ret < 0)
IPAWANERR("Failed to teardown IPA->APPS qmap pipe\n");
if (ipa3_ctx->rmnet_ctl_enable) {
ret = ipa3_teardown_apps_low_lat_pipes();
if (ret < 0)
IPAWANERR("Failed to teardown IPA->APPS qmap pipe\n");
}
ret = ipa3_teardown_sys_pipe(rmnet_ipa3_ctx->ipa3_to_apps_hdl);
if (ret < 0)
IPAWANERR("Failed to teardown IPA->APPS pipe\n");
@ -4277,6 +4282,10 @@ void ipa3_broadcast_quota_reach_ind(u32 mux_id,
if (upstream_type == IPA_UPSTEAM_MAX) {
IPAWANERR(" Wrong upstreamIface type %d\n", upstream_type);
return;
} else if (upstream_type == IPA_UPSTEAM_WLAN) {
/* TODO: Fix this case when adding quota on WLAN Backhaul*/
IPAWANERR_RL("Quota indication is not supported for WLAN\n");
return;
} else if (upstream_type == IPA_UPSTEAM_MODEM) {
index = ipa3_find_mux_channel_index(mux_id);
if (index == MAX_NUM_OF_MUX_CHANNEL) {