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

Commit cf67ec7a authored by blong's avatar blong Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: initialize the spin_lock before cpu_pm_callback



There is a possible race condition that cpu_pm_callback get here
while lock is not initialized.

CRs-Fixed: 2300081
Change-Id: Iaa7974f5181ee0739f6f821fcb5c708b6b42b25e
Signed-off-by: default avatarBiao long <blong@codeaurora.org>
parent 1ea82c53
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -180,6 +180,11 @@ static int enable_big_min_freq_adjust(void)
	if (!p->min_freq_floor)
		p->min_freq_floor = POLICY_MIN;

	p->min_freq_state = RESET_MIN_FLOOR;
	p->min_freq_request = RESET_MIN_FLOOR;
	spin_lock_init(&p->lock);
	p->big_min_freq_on = true;

	ret = cpu_pm_register_notifier(&cpu_pm_nb);
	if (ret) {
		pr_err("Failed to register for PM notification\n");
@@ -193,11 +198,6 @@ static int enable_big_min_freq_adjust(void)
		return ret;
	}

	p->min_freq_state = RESET_MIN_FLOOR;
	p->min_freq_request = RESET_MIN_FLOOR;
	spin_lock_init(&p->lock);
	p->big_min_freq_on = true;

	/* If BIG cluster is active at this time and continue to be active
	 * forever, in that case min frequency of the cluster will never be
	 * set to floor value.  This is to trigger the state machine and set