瀏覽代碼

msm: ipa3: Changes to check disconnect in progress while sending data

In SSR scenario while teardown the pipe there could be possibility to
receive the UL data to avoid queuing the data checking for disconnect
InProgress flag.

Signed-off-by: Ashok Vuyyuru <[email protected]>
Change-Id: I73397e51e6e7affae71313d08356f809788db484
Ashok Vuyyuru 3 年之前
父節點
當前提交
d5c796665b
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

+ 7 - 0
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -492,6 +492,12 @@ int ipa3_send(struct ipa3_sys_context *sys,
 
 	spin_lock_bh(&sys->spinlock);
 
+	if (unlikely(atomic_read(&sys->ep->disconnect_in_progress))) {
+		IPAERR("Pipe disconnect in progress dropping the packet\n");
+		spin_unlock_bh(&sys->spinlock);
+		return -EFAULT;
+	}
+
 	for (i = 0; i < num_desc; i++) {
 		if (!list_empty(&sys->avail_tx_wrapper_list)) {
 			tx_pkt = list_first_entry(&sys->avail_tx_wrapper_list,
@@ -1560,6 +1566,7 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)
 	if (IPA_CLIENT_IS_PROD(ep->client)) {
 		do {
 			spin_lock_bh(&ep->sys->spinlock);
+			atomic_set(&ep->disconnect_in_progress, 1);
 			empty = list_empty(&ep->sys->head_desc_list);
 			spin_unlock_bh(&ep->sys->spinlock);
 			if (!empty)