소스 검색

qcacmn: Fix napi_complete function call limitation

napi_completion could stop NAPI re-queue only if
returned budget is small than limit budget. WLAN
driver IRQ affinity change would force NAPI complete.
In some cases, RX is in busy loop, RX NAPI could be
queued to more than one CPU NAPI polling list, which
will lead system crash. This change is aimed to make
sure that returned budget is smaller than the limit.

Change-Id: I1b93596b8afc3ee09c4caeceb7a7ba98c4bed4d1
CRs-Fixed: 3420953
Yu Tian 2 년 전
부모
커밋
3cbef591fb
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      hif/src/hif_exec.c

+ 8 - 1
hif/src/hif_exec.c

@@ -649,6 +649,7 @@ static int hif_exec_poll(struct napi_struct *napi, int budget)
 	int actual_dones;
 	int shift = hif_ext_group->scale_bin_shift;
 	int cpu = smp_processor_id();
+	bool force_complete = false;
 
 	hif_record_event(hif_ext_group->hif, hif_ext_group->grp_id,
 			 0, 0, 0, HIF_EVENT_BH_SCHED);
@@ -666,7 +667,13 @@ static int hif_exec_poll(struct napi_struct *napi, int budget)
 
 	actual_dones = work_done;
 
-	if (hif_is_force_napi_complete_required(hif_ext_group) ||
+	if (hif_is_force_napi_complete_required(hif_ext_group)) {
+		force_complete = true;
+		if (work_done >= normalized_budget)
+			work_done = normalized_budget - 1;
+	}
+
+	if (qdf_unlikely(force_complete) ||
 	    (!hif_ext_group->force_break && work_done < normalized_budget) ||
 	    ((pld_is_one_msi(scn->qdf_dev->dev) &&
 	    hif_irq_disabled_time_limit_reached(hif_ext_group)))) {