Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09ea8960 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

soc: qcom: dfc: Change workqueue type to single thread



The max_active flag is not sufficient to guarantee that only one
instance of the work for dfc_do_burst_flow_control is running
across all cores. Change the allocation API to guarantee this behavior.

Additionally, remove all references to disabling bottom half processing
as SOFTIRQ NET_TX cannot invoke this thread as the transmit path no
longer calls the rtnl lock.

CRs-Fixed: 2303876
Change-Id: I5ecd7edc4c7d75b6b8df98a42d011b19e1fa75c0
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent b79ef96c
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -699,14 +699,12 @@ static void dfc_do_burst_flow_control(struct work_struct *work)
		return;
	}

	local_bh_disable();
	while (!rtnl_trylock()) {
		if (!svc_ind->data->restart_state) {
			cond_resched_softirq();
			cond_resched();
		} else {
			kfree(ind);
			kfree(svc_ind);
			local_bh_enable();
			return;
		}
	}
@@ -742,7 +740,6 @@ static void dfc_do_burst_flow_control(struct work_struct *work)
	kfree(ind);
	kfree(svc_ind);
	rtnl_unlock();
	local_bh_enable();
}

static void dfc_bearer_limit_work(struct work_struct *work)
@@ -752,21 +749,16 @@ static void dfc_bearer_limit_work(struct work_struct *work)
	struct list_head *p;
	int qlen, fc;

	local_bh_disable();

	/* enable transmit on device so that the other
	 * flows which transmit proceed normally.
	 * do it here under bh disabled so that the TX softirq
	 * may not run here
	 */
	netif_start_queue(dfc_ind->dev);

	while (!rtnl_trylock()) {
		if (!dfc_ind->data->restart_state) {
			cond_resched_softirq();
			cond_resched();
		} else {
			kfree(dfc_ind);
			local_bh_enable();
			return;
		}
	}
@@ -798,7 +790,6 @@ static void dfc_bearer_limit_work(struct work_struct *work)
done:
	kfree(dfc_ind);
	rtnl_unlock();
	local_bh_enable();
}

static void dfc_clnt_ind_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
@@ -921,7 +912,7 @@ int dfc_qmi_client_init(void *port, int index, struct qmi_info *qmi)
	data->index = index;
	data->restart_state = 0;

	data->dfc_wq = alloc_workqueue("dfc_wq", WQ_HIGHPRI, 1);
	data->dfc_wq = create_singlethread_workqueue("dfc_wq");
	if (!data->dfc_wq) {
		pr_err("%s Could not create workqueue\n", __func__);
		goto err0;