From db842a7f7d33018bdeefd54c5dabdb8f80c42752 Mon Sep 17 00:00:00 2001 From: Praveen Kurapati Date: Wed, 2 Dec 2020 23:06:43 +0530 Subject: [PATCH 1/3] msm: ipa3: Add change to increase timeout value Add change to increase the stop channel retry timeout value to avoid race condition cause by AP retrying to stop channel and GSI trying to send stop channel command. Change-Id: I405f923d9bc87f7b8612ded9137d7b8d23eb37e8 Signed-off-by: Praveen Kurapati --- drivers/platform/msm/ipa/ipa_common_i.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_common_i.h b/drivers/platform/msm/ipa/ipa_common_i.h index 24b5260b4efc..ea75edf28dd8 100644 --- a/drivers/platform/msm/ipa/ipa_common_i.h +++ b/drivers/platform/msm/ipa/ipa_common_i.h @@ -145,8 +145,8 @@ do {\ #define IPA_CLIENT_IS_CONS(x) \ (x < IPA_CLIENT_MAX && (x & 0x1) == 1) -#define IPA_GSI_CHANNEL_STOP_SLEEP_MIN_USEC (1000) -#define IPA_GSI_CHANNEL_STOP_SLEEP_MAX_USEC (2000) +#define IPA_GSI_CHANNEL_STOP_SLEEP_MIN_USEC (3000) +#define IPA_GSI_CHANNEL_STOP_SLEEP_MAX_USEC (5000) enum ipa_active_client_log_type { EP, From cea86232b83f245ba2a3fb4e570a1241790d08fe Mon Sep 17 00:00:00 2001 From: Ashok Vuyyuru Date: Wed, 23 Dec 2020 00:27:15 +0530 Subject: [PATCH 2/3] msm: ipa3: Send enable force clear only for producer pipe Enable forceclear only supported for producer pipe so avoid sending the force clear command to consumer pipes. Change-Id: I6c63abe68e737463b0a189bf85a92c79648ea767 Signed-off-by: Ashok Vuyyuru --- drivers/platform/msm/ipa/ipa_v3/ipa_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c index 4d86f9795948..86864c2647f3 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c @@ -1248,7 +1248,7 @@ static int ipa3_stop_ul_chan_with_data_drain(u32 qmi_req_id, goto exit; } /* if still stop_in_proc or not empty, activate force clear */ - if (should_force_clear) { + if (should_force_clear && IPA_CLIENT_IS_PROD(ep->client)) { result = ipa3_enable_force_clear(qmi_req_id, false, source_pipe_bitmask); if (result) { From 758cc8b5348ca5eed1929be4cb71b94c76a84a53 Mon Sep 17 00:00:00 2001 From: Akshay Pandit Date: Wed, 2 Dec 2020 20:58:23 +0530 Subject: [PATCH 3/3] msm: ipa: Use read memory barrier before reading events Use read memory barrier before reading event from event ring. Since ring is shared resource between IPA h/w and IPA driver dma_rmb is used to ensure memory write is complete before reading from driver. Change-Id: I295a701b16362f26d47d4efe5a54364a7ee4d5a6 Signed-off-by: Akshay Pandit --- drivers/platform/msm/gsi/gsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/platform/msm/gsi/gsi.c b/drivers/platform/msm/gsi/gsi.c index 74075038f708..d831379ea229 100644 --- a/drivers/platform/msm/gsi/gsi.c +++ b/drivers/platform/msm/gsi/gsi.c @@ -595,6 +595,11 @@ static void gsi_process_evt_re(struct gsi_evt_ctx *ctx, struct gsi_xfer_compl_evt *evt; struct gsi_chan_ctx *ch_ctx; + /* RMB before reading event ring shared b/w IPA h/w & driver + * ordering between IPA h/w store and CPU load + */ + if (callback) + dma_rmb(); evt = (struct gsi_xfer_compl_evt *)(ctx->ring.base_va + ctx->ring.rp_local - ctx->ring.base); gsi_process_chan(evt, notify, callback);