clk: qcom: clk-aop-qmp: Do not send duplicate requests to AOP

Currently, duplicate enable requests are sent for the qdss_qmp_clk
during its registration. This is not ideal behavior and should be
corrected.

Change-Id: I1d66ad83fe9c109a88df527ef3fae5fc60e855e7
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
This commit is contained in:
Deepak Katragadda 2017-09-14 11:21:18 -07:00 • committed by David Collins
commit a473903674

View file

@ -129,6 +129,12 @@ static int clk_aop_qmp_prepare(struct clk_hw *hw)
struct clk_aop_qmp *clk = to_aop_qmp_clk(hw);
mutex_lock(&clk_aop_lock);
/*
* Return early if the clock has been enabled already. This
* is to avoid issues with sending duplicate enable requests.
*/
if (clk->enabled)
goto err;
if (clk->level)
rate = clk->level;
@ -167,6 +173,9 @@ static void clk_aop_qmp_unprepare(struct clk_hw *hw)
mutex_lock(&clk_aop_lock);
if (!clk->enabled)
goto err;
rate = clk->disable_state;
snprintf(mbox_msg, MAX_LEN, "{class: %s, res: %s, val: %ld}",