• Ulf Hansson's avatar
    PM / Domains: Fix potential deadlock while adding/removing subdomains · cdb300a0
    Ulf Hansson authored
    We must preserve the same order of how we acquire and release the lock for
    genpd, as otherwise we may encounter deadlocks.
    
    The power on phase of a genpd starts by acquiring its lock. Then it walks
    the hierarchy of its parent domains to be able to power on these first, as
    per design of genpd.
    
    From a locking perspective this means the locks of the parents becomes
    acquired after the lock of the subdomain.
    
    Let's fix pm_genpd_add|remove_subdomain() to maintain the same order of
    acquiring/releasing the genpd lock as being applied in the power on/off
    sequence.
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    cdb300a0
domain.c 50.2 KB