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

Commit 074495c5 authored by Sean Tranchetti's avatar Sean Tranchetti Committed by Gerrit - the friendly Code Review server
Browse files

drivers: rmnet_perf: Avoid recursive spinlock in legacy mode



Commit 56901a4a6639 ("drivers: rmnet_perf: Take lock during DL marker
handling") locks the DL marker handling to ensure synchronization. When
rmnet_perf handles deaggregation of QMAP frames, this will result in
attempting to take the lock recursively, as the lock will already be held
by the deaggregation logic.

Change-Id: I731574ed56e770193c9b094758d7f4119ef91781
Signed-off-by: default avatarSean Tranchetti <stranche@codeaurora.org>
parent b9ca96bd
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -498,7 +498,10 @@ rmnet_perf_core_handle_map_control_start(struct rmnet_map_dl_ind_hdr *dlhdr)
	struct rmnet_perf *perf = rmnet_perf_config_get_perf();
	struct rmnet_perf_core_burst_marker_state *bm_state;

	/* If handling deaggregation, we're already locked */
	if (!rmnet_perf_core_is_deag_mode())
		rmnet_perf_core_grab_lock();

	bm_state = perf->core_meta->bm_state;
	/* if we get two starts in a row, without an end, then we flush
	 * and carry on
@@ -517,6 +520,8 @@ rmnet_perf_core_handle_map_control_start(struct rmnet_map_dl_ind_hdr *dlhdr)
	trace_rmnet_perf_low(RMNET_PERF_MODULE, RMNET_PERF_START_DL_MRK,
			     bm_state->expect_packets, 0xDEF, 0xDEF, 0xDEF,
			     NULL, NULL);

	if (!rmnet_perf_core_is_deag_mode())
		rmnet_perf_core_release_lock();
}

@@ -531,7 +536,10 @@ void rmnet_perf_core_handle_map_control_end(struct rmnet_map_dl_ind_trl *dltrl)
	struct rmnet_perf *perf = rmnet_perf_config_get_perf();
	struct rmnet_perf_core_burst_marker_state *bm_state;

	/* If handling deaggregation, we're already locked */
	if (!rmnet_perf_core_is_deag_mode())
		rmnet_perf_core_grab_lock();

	bm_state = perf->core_meta->bm_state;
	rmnet_perf_opt_flush_all_flow_nodes();
	rmnet_perf_core_flush_reason_cnt[RMNET_PERF_CORE_DL_MARKER_FLUSHES]++;
@@ -540,6 +548,8 @@ void rmnet_perf_core_handle_map_control_end(struct rmnet_map_dl_ind_trl *dltrl)
	bm_state->expect_packets = 0;
	trace_rmnet_perf_low(RMNET_PERF_MODULE, RMNET_PERF_END_DL_MRK, 0xDEF,
			     0xDEF, 0xDEF, 0xDEF, NULL, NULL);

	if (!rmnet_perf_core_is_deag_mode())
		rmnet_perf_core_release_lock();
}