• Rajendra Nayak's avatar
    clk: qcom: gdsc: Fix the handling of PWRSTS_RET support · d3997239
    Rajendra Nayak authored
    GDSCs cannot be transitioned into a Retention state in SW.
    When either the RETAIN_MEM bit, or both the RETAIN_MEM and
    RETAIN_PERIPH bits are set, and the GDSC is left ON, the HW
    takes care of retaining the memory/logic for the domain when
    the parent domain transitions to power collapse/power off state.
    
    On some platforms where the parent domains lowest power state
    itself is Retention, just leaving the GDSC in ON (without any
    RETAIN_MEM/RETAIN_PERIPH bits being set) will also transition
    it to Retention.
    
    The existing logic handling the PWRSTS_RET seems to set the
    RETAIN_MEM/RETAIN_PERIPH bits if the cxcs offsets are specified
    but then explicitly turns the GDSC OFF as part of _gdsc_disable().
    Fix that by leaving the GDSC in ON state.
    Signed-off-by: default avatarRajendra Nayak <quic_rjendra@quicinc.com>
    Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
    Link: https://lore.kernel.org/r/20220920111517.10407-1-quic_rjendra@quicinc.com
    d3997239
gdsc.h 2.85 KB