Преглед на файлове

ipa: Fix RT \ FLT local tables

Fix code related to RT \ FLT tables in SRAM

Change-Id: I3f550a19fd0d0b962800cd82b8e23e9af8d9b942
Acked-by: Nadav Levintov <[email protected]>
Signed-off-by: Sivan Reinstein <[email protected]>
Sivan Reinstein преди 4 години
родител
ревизия
289607eec1

+ 41 - 0
drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c

@@ -1191,6 +1191,26 @@ static ssize_t ipa3_read_flt(struct file *file, char __user *ubuf, size_t count,
 
 	mutex_lock(&ipa3_ctx->lock);
 
+	if (ip == IPA_IP_v6) {
+		if (ipa3_ctx->ip6_flt_tbl_hash_lcl)
+			pr_err("Hashable table resides on local memory\n");
+		else
+			pr_err("Hashable table resides on system (ddr) memory\n");
+		if (ipa3_ctx->ip6_flt_tbl_nhash_lcl)
+			pr_err("Non-Hashable table resides on local memory\n");
+		else
+			pr_err("Non-Hashable table resides on system (ddr) memory\n");
+	} else if (ip == IPA_IP_v4) {
+		if (ipa3_ctx->ip4_flt_tbl_hash_lcl)
+			pr_err("Hashable table resides on local memory\n");
+		else
+			pr_err("Hashable table resides on system (ddr) memory\n");
+		if (ipa3_ctx->ip4_flt_tbl_nhash_lcl)
+			pr_err("Non-Hashable table resides on local memory\n");
+		else
+			pr_err("Non-Hashable table resides on system (ddr) memory\n");
+	}
+
 	for (j = 0; j < ipa3_ctx->ipa_num_pipes; j++) {
 		if (!ipa_is_ep_support_flt(j))
 			continue;
@@ -1270,6 +1290,27 @@ static ssize_t ipa3_read_flt_hw(struct file *file, char __user *ubuf,
 
 	IPA_ACTIVE_CLIENTS_INC_SIMPLE();
 	mutex_lock(&ipa3_ctx->lock);
+
+	if (ip == IPA_IP_v6) {
+		if (ipa3_ctx->ip6_flt_tbl_hash_lcl)
+			pr_err("Hashable table resides on local memory\n");
+		else
+			pr_err("Hashable table resides on system (ddr) memory\n");
+		if (ipa3_ctx->ip6_flt_tbl_nhash_lcl)
+			pr_err("Non-Hashable table resides on local memory\n");
+		else
+			pr_err("Non-Hashable table resides on system (ddr) memory\n");
+	} else if (ip == IPA_IP_v4) {
+		if (ipa3_ctx->ip4_flt_tbl_hash_lcl)
+			pr_err("Hashable table resides on local memory\n");
+		else
+			pr_err("Hashable table resides on system (ddr) memory\n");
+		if (ipa3_ctx->ip4_flt_tbl_nhash_lcl)
+			pr_err("Non-Hashable table resides on local memory\n");
+		else
+			pr_err("Non-Hashable table resides on system (ddr) memory\n");
+	}
+
 	for (pipe = 0; pipe < ipa3_ctx->ipa_num_pipes; pipe++) {
 		if (!ipa_is_ep_support_flt(pipe))
 			continue;

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/ipa_flt.c

@@ -261,7 +261,7 @@ static int ipa_translate_flt_tbl_to_hw_fmt(enum ipa_ip_type ip,
 
 			/* update the hdr at the right index */
 			if (ipahal_fltrt_write_addr_to_hdr(offset, hdr,
-				hdr_idx, true)) {
+				hdr_idx, false)) {
 				IPAERR("fail to wrt lcl tbl ofst to hdr\n");
 				goto hdr_update_fail;
 			}

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/ipa_rt.c

@@ -207,7 +207,7 @@ static int ipa_translate_rt_tbl_to_hw_fmt(enum ipa_ip_type ip,
 
 			/* update the hdr at the right index */
 			if (ipahal_fltrt_write_addr_to_hdr(offset, hdr,
-				tbl->idx - apps_start_idx, true)) {
+				tbl->idx, false)) {
 				IPAERR_RL("fail to wrt lcl tbl ofst to hdr\n");
 				goto hdr_update_fail;
 			}

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c

@@ -4438,7 +4438,7 @@ static int ipa_fltrt_alloc_lcl_bdy(
 	/* Align the sizes to coop with termination word
 	 *  and H/W local table start offset alignment
 	 */
-	if (params->nhash_bdy.size) {
+	if (params->total_sz_lcl_nhash_tbls + params->num_lcl_nhash_tbls > 0) {
 		params->nhash_bdy.size = params->total_sz_lcl_nhash_tbls;
 		/* for table terminator */
 		params->nhash_bdy.size += obj->tbl_width *