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

Commit 93d26059 authored by Jeff Hugo's avatar Jeff Hugo Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: bam_dmux: Fix deinit/reinit race condition



The deinit and reinit functions are used by dynamically loadable test
modules to put the bam_dmux driver in a safe state before intercepting the
calls to SPS and SMSM.  Deinit leaves bam_dmux in a state which can only be
properly cleared with a process that is inherently racy.

Tweak deinit and reinit so that a race condition is not necessary to put
bam_dmux into the test mode.  Leave bam_dmux in normal state, and not SSR
state when leaving deinit, and change reinit to allow the normal init
sequence to be used instead of introducing a different one.

Change-Id: Ib8b517e888231cf271dbac3c6d8ddce061af973f
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 5fd9567d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2308,6 +2308,8 @@ void msm_bam_dmux_deinit(void)
{
	restart_notifier_cb(NULL, SUBSYS_BEFORE_SHUTDOWN, NULL);
	restart_notifier_cb(NULL, SUBSYS_AFTER_SHUTDOWN, NULL);
	in_global_reset = 0;
	in_ssr = 0;
}
EXPORT_SYMBOL(msm_bam_dmux_deinit);

@@ -2316,14 +2318,13 @@ EXPORT_SYMBOL(msm_bam_dmux_deinit);
 */
void msm_bam_dmux_reinit(void)
{
	bam_mux_initialized = 0;
	bam_ops->smsm_state_cb_register_ptr(SMSM_MODEM_STATE,
			SMSM_A2_POWER_CONTROL,
			bam_dmux_smsm_cb, NULL);
	bam_ops->smsm_state_cb_register_ptr(SMSM_MODEM_STATE,
			SMSM_A2_POWER_CONTROL_ACK,
			bam_dmux_smsm_ack_cb, NULL);
	bam_mux_initialized = 0;
	bam_init();
}
EXPORT_SYMBOL(msm_bam_dmux_reinit);