msm: clock-rpm: Set the sleep vote only for sleep set clocks in handoff

The RPM clock handoff is erroneously setting last_sleep_set_khz
for clocks that only vote in the active-set. This results in an
incorrect sleep set vote to the RPM that does not go away even
when the corresponding (peer) sleep-and-active-set RPM clock is
disabled.

Set the last_sleep_set_khz value only if the clock in question
is not an active-set-only clock.

An example failure occurs as follows:

The system fabric clock is running at 192MHz on bootup. The
handoff code for the sfab_a_clk (the active set only clock)
sets last_set_khz and last_sleep_set_khz to 192MHz. Now, in
late_init, when sfab_clk is disabled, the sfab_a_clk's
last_sleep_set_khz value is sent to the RPM. This is wrong -
we are disabling the sleep-and-active-set clock, but we just
sent a rate of 192MHz to the RPM as our sleep set vote.
When the apps procesor transitions to the sleep set, if there
have been no other votes for sfab_clk and sfab_a_clk, the RPM
will figure that the apps needs 192 MHz on the system fabric
in the sleep set, even though sfab_clk on the apps side is
"disabled".

With the fix in place, sfab_a_clk's last_sleep_set_khz is 0,
and therefore when sfab_clk is disabled, the correct vote of
0 goes to the RPM.

CRs-Fixed: 392302
Change-Id: Iee47a3c4e683e335454d2485c4c4c5b1bc0d772c
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
1 file changed