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

Commit d6f87ac7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: glink: Properly manage auxiliary pointer in tx() error handling"

parents bc91401c 0dccd6ce
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -5007,19 +5007,14 @@ static void tx_work_func(struct work_struct *work)
	struct glink_core_xprt_ctx *xprt_ptr =
			container_of(work, struct glink_core_xprt_ctx, tx_work);
	struct channel_ctx *ch_ptr;
	struct channel_ctx *tx_ready_head;
	uint32_t prio;
	uint32_t tx_ready_head_prio;
	int ret;
	struct channel_ctx *tx_ready_head = NULL;
	bool transmitted_successfully = true;

	GLINK_PERF("%s: worker starting\n", __func__);

	prio = xprt_ptr->num_priority - 1;
	mutex_lock(&xprt_ptr->tx_ready_mutex_lhb2);
	tx_ready_head = list_first_entry(&xprt_ptr->prio_bin[prio].tx_ready,
				struct channel_ctx, tx_ready_list_node);
	mutex_unlock(&xprt_ptr->tx_ready_mutex_lhb2);

	while (1) {
		prio = xprt_ptr->num_priority - 1;
		mutex_lock(&xprt_ptr->tx_ready_mutex_lhb2);
@@ -5035,6 +5030,11 @@ static void tx_work_func(struct work_struct *work)
				struct channel_ctx, tx_ready_list_node);
		mutex_unlock(&xprt_ptr->tx_ready_mutex_lhb2);

		if (tx_ready_head == NULL || tx_ready_head_prio < prio) {
			tx_ready_head = ch_ptr;
			tx_ready_head_prio = prio;
		}

		if (ch_ptr == tx_ready_head && !transmitted_successfully) {
			GLINK_ERR_XPRT(xprt_ptr,
				"%s: Unable to send data on this transport.\n",
@@ -5081,15 +5081,12 @@ static void tx_work_func(struct work_struct *work)
		if (list_empty(&ch_ptr->tx_active)) {
			list_del_init(&ch_ptr->tx_ready_list_node);
			glink_qos_done_ch_tx(ch_ptr);

			tx_ready_head = list_first_entry(
				&xprt_ptr->prio_bin[prio].tx_ready,
				struct channel_ctx, tx_ready_list_node);
		}

		mutex_unlock(&ch_ptr->tx_lists_mutex_lhc3);
		mutex_unlock(&xprt_ptr->tx_ready_mutex_lhb2);

		tx_ready_head = NULL;
		transmitted_successfully = true;
	}
	glink_pm_qos_unvote(xprt_ptr);