Skip to content

Commit 0500d50

Browse files
shilpasristewartsmith
authored andcommitted
slw: Fix parsing of supported STOP states
Bits[0-15] are used to indicate the supported STOP states in "ibm,enabled-stop-levels" DT property and STOP0 is starting from Bit0. This patch fixes the parsing to read the appropriate bits. Fixes: c3ea33f ("hw/slw: only enable supported STOP states") Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Reviewed-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent 2bec353 commit 0500d50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hw/slw.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,10 @@ void add_cpu_idle_state_properties(void)
763763

764764
/* We can only use the stop levels that HB has made available */
765765
if (has_stop_inst) {
766-
u32 level = 1ul << states[i].pm_ctrl_reg_val;
767-
if (!(stop_levels & level))
766+
u32 level = 31 - (states[i].pm_ctrl_reg_val &
767+
OPAL_PM_PSSCR_RL_MASK);
768+
769+
if (!(stop_levels & (1ul << level)))
768770
continue;
769771
}
770772

0 commit comments

Comments
 (0)