OSDN Git Service

msm: ipa: fix the ipa-hw rules not clean
authorSkylar Chang <chiaweic@codeaurora.org>
Thu, 3 May 2018 09:18:34 +0000 (02:18 -0700)
committerMohammed Javid <mjavid@codeaurora.org>
Sat, 11 Aug 2018 10:19:02 +0000 (15:49 +0530)
After getting reset ioctl from user-space
module, the caches in ipa-driver are clean
however ipa-hw still has it. The fix is
to commit those caches in ipa-hw.

Change-Id: Iee0009b2bf3cdff2979d1fdba629c86a7c5afe21
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
drivers/platform/msm/ipa/ipa_v2/ipa_flt.c
drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c
drivers/platform/msm/ipa/ipa_v2/ipa_rt.c
drivers/platform/msm/ipa/ipa_v3/ipa_flt.c
drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c
drivers/platform/msm/ipa/ipa_v3/ipa_rt.c

index 6392c37..c29cbdf 100644 (file)
@@ -1495,8 +1495,16 @@ int ipa2_reset_flt(enum ipa_ip_type ip, bool user_only)
                        }
                }
        }
-       mutex_unlock(&ipa_ctx->lock);
 
+       /* commit the change to IPA-HW */
+       if (ipa_ctx->ctrl->ipa_commit_flt(IPA_IP_v4) ||
+               ipa_ctx->ctrl->ipa_commit_flt(IPA_IP_v6)) {
+               IPAERR_RL("fail to commit flt-rule\n");
+               WARN_ON_RATELIMIT_IPA(1);
+               mutex_unlock(&ipa_ctx->lock);
+               return -EPERM;
+       }
+       mutex_unlock(&ipa_ctx->lock);
        return 0;
 }
 
index e0868ad..38da066 100644 (file)
@@ -1426,6 +1426,15 @@ int ipa2_reset_hdr(bool user_only)
        }
        mutex_unlock(&ipa_ctx->lock);
 
+       /* commit the change to IPA-HW */
+       if (ipa_ctx->ctrl->ipa_commit_hdr()) {
+               IPAERR_RL("fail to commit hdr\n");
+               WARN_ON_RATELIMIT_IPA(1);
+               mutex_unlock(&ipa_ctx->lock);
+               return -EFAULT;
+       }
+
+       mutex_unlock(&ipa_ctx->lock);
        return 0;
 }
 
index e4a3a72..5bab6d0 100644 (file)
@@ -1443,6 +1443,15 @@ int ipa2_reset_rt(enum ipa_ip_type ip, bool user_only)
                        }
                }
        }
+
+       /* commit the change to IPA-HW */
+       if (ipa_ctx->ctrl->ipa_commit_rt(IPA_IP_v4) ||
+               ipa_ctx->ctrl->ipa_commit_rt(IPA_IP_v6)) {
+               IPAERR("fail to commit rt-rule\n");
+               WARN_ON_RATELIMIT_IPA(1);
+               mutex_unlock(&ipa_ctx->lock);
+               return -EPERM;
+       }
        mutex_unlock(&ipa_ctx->lock);
 
        return 0;
index f7d314a..9afdfdb 100644 (file)
@@ -1420,8 +1420,16 @@ int ipa3_reset_flt(enum ipa_ip_type ip, bool user_only)
                        }
                }
        }
-       mutex_unlock(&ipa3_ctx->lock);
 
+       /* commit the change to IPA-HW */
+       if (ipa3_ctx->ctrl->ipa3_commit_flt(IPA_IP_v4) ||
+               ipa3_ctx->ctrl->ipa3_commit_flt(IPA_IP_v6)) {
+               IPAERR("fail to commit flt-rule\n");
+               WARN_ON_RATELIMIT_IPA(1);
+               mutex_unlock(&ipa3_ctx->lock);
+               return -EPERM;
+       }
+       mutex_unlock(&ipa3_ctx->lock);
        return 0;
 }
 
index 63e3f85..4e7176a 100644 (file)
@@ -1168,8 +1168,16 @@ int ipa3_reset_hdr(bool user_only)
                ipa3_ctx->hdr_proc_ctx_tbl.end = end;
                IPADBG("hdr_proc_tbl.end = %d\n", end);
        }
-       mutex_unlock(&ipa3_ctx->lock);
 
+       /* commit the change to IPA-HW */
+       if (ipa3_ctx->ctrl->ipa3_commit_hdr()) {
+               IPAERR("fail to commit hdr\n");
+               WARN_ON_RATELIMIT_IPA(1);
+               mutex_unlock(&ipa3_ctx->lock);
+               return -EFAULT;
+       }
+
+       mutex_unlock(&ipa3_ctx->lock);
        return 0;
 }
 
index 203fd14..0e75d10 100644 (file)
@@ -1576,6 +1576,15 @@ int ipa3_reset_rt(enum ipa_ip_type ip, bool user_only)
                        }
                }
        }
+
+       /* commit the change to IPA-HW */
+       if (ipa3_ctx->ctrl->ipa3_commit_rt(IPA_IP_v4) ||
+               ipa3_ctx->ctrl->ipa3_commit_rt(IPA_IP_v6)) {
+               IPAERR("fail to commit rt-rule\n");
+               WARN_ON_RATELIMIT_IPA(1);
+               mutex_unlock(&ipa3_ctx->lock);
+               return -EPERM;
+       }
        mutex_unlock(&ipa3_ctx->lock);
 
        return 0;