• Maulik Shah's avatar
    cpuidle: psci: Move enabling OSI mode after power domains creation · 12acb348
    Maulik Shah authored
    A switch from OSI to PC mode is only possible if all CPUs other than the
    calling one are OFF, either through a call to CPU_OFF or not yet booted.
    
    Currently OSI mode is enabled before power domains are created. In cases
    where CPUidle states are not using hierarchical CPU topology the bail out
    path tries to switch back to PC mode which gets denied by firmware since
    other CPUs are online at this point and creates inconsistent state as
    firmware is in OSI mode and Linux in PC mode.
    
    This change moves enabling OSI mode after power domains are created,
    this would makes sure that hierarchical CPU topology is used before
    switching firmware to OSI mode.
    
    Cc: stable@vger.kernel.org
    Fixes: 70c179b4 ("cpuidle: psci: Allow PM domain to be initialized even if no OSI mode")
    Signed-off-by: default avatarMaulik Shah <quic_mkshah@quicinc.com>
    Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    12acb348
cpuidle-psci-domain.c 4.51 KB