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

Commit aec734dc authored by Vikram Mulukutla's avatar Vikram Mulukutla Committed by Smita Ghosh
Browse files

clk: msm: clock-rpm: Allocate memory for the last-vote optimization



A recent commit d7830d36 ("clk: msm: clock-rpm: Don't send unnecessary
RPM requests") introduced a regression on targets that use the new
dt-based clock controller, specifically MDM9640. The memory for the
last-vote is not allocated currently since the dt-based controller clock
structures are allocated at runtime. Fix this by also allocating memory
for the last-vote.

Change-Id: Ia8f08dc3bbf8d92dc0f56ee5d31c212ac9eb7ad0
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: default avatarSmita Ghosh <smitag@codeaurora.org>
parent 77813844
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -391,9 +391,21 @@ static struct rpm_clk *rpm_clk_dt_parser_common(struct device *dev,
	/* Rely on whoever's called last to setup the circular ref */
	c = msmclk_lookup_phandle(dev, p);
	if (!IS_ERR(c)) {
		uint32_t *sleep = devm_kzalloc(dev, sizeof(uint32_t),
					       GFP_KERNEL);
		uint32_t *active =
			devm_kzalloc(dev, sizeof(uint32_t),
				     GFP_KERNEL);

		if (!sleep || !active)
			return ERR_PTR(-ENOMEM);
		peer = to_rpm_clk(c);
		peer->peer = rpm;
		rpm->peer = peer;
		rpm->last_active_set_vote = active;
		peer->last_active_set_vote = active;
		rpm->last_sleep_set_vote = sleep;
		peer->last_sleep_set_vote = sleep;
	}

	rpm->rpmrs_data = &clk_rpmrs_data_smd;