[RESEND PATCH v3 1/2] PM / Domains: Allow genpd to power on during the system PM phases

Kevin Hilman khilman at baylibre.com
Wed Jun 15 21:00:29 UTC 2016


Ulf Hansson <ulf.hansson at linaro.org> writes:

> If the PM domain is powered off when the first device starts its system PM
> prepare phase, genpd prevents any further attempts to power on the PM
> domain during the following system PM phases. Not until the system PM
> complete phase is finalized for all devices in the PM domain, genpd again
> allows it to be powered on.
>
> This behaviour needs to be changed, as a subsystem/driver for a device in
> the same PM domain may still need to be able to serve requests in some of
> the system PM phases. Accordingly, it may need to runtime resume its
> device and thus also request the corresponding PM domain to be powered on.
>
> To deal with these scenarios, let's make the device operational in the
> system PM prepare phase by runtime resuming it, no matter if the PM domain
> is powered on or off. Changing this also enables us to remove genpd's
> suspend_power_off flag, as it's being used to track this condition.
> Additionally, we must allow the PM domain to be powered on via runtime PM
> during the system PM phases.
>
> This change also requires a fix in the AMD ACP (Audio CoProcessor) drm
> driver. It registers a genpd to model the ACP as a PM domain, but
> unfortunately it's also abuses genpd's "internal" suspend_power_off flag
> to deal with a corner case at system PM resume.
>
> More precisely, the so called SMU block powers on the ACP at system PM
> resume, unconditionally if it's being used or not. This may lead to that
> genpd's internal status of the power state, may not correctly reflect the
> power state of the HW after a system PM resume.
>
> Because of changing the behaviour of genpd, by runtime resuming devices in
> the prepare phase, the AMD ACP drm driver no longer have to deal with this
> corner case. So let's just drop the related code in this driver.
>
> Cc: David Airlie <airlied at linux.ie>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Maruthi Srinivas Bayyavarapu <Maruthi.Bayyavarapu at amd.com>
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
> ---
>
> Changes in v3:
> 	- Updated changelog.
>
> Changes in v2:
> 	- Updated changelog.
> 	- Added a fix in the AMD ACP (Audio CoProcessor) drm driver, which
> 	registers a genpd. The fix removes the usage of genpd's internal
> 	suspend_power_off flag as it's not needed after this change. Because of
> 	this change I am also requesting an ack from the drm driver maintainer.
>
>
> ---
>  drivers/base/power/domain.c             | 84 ++++++++++++---------------------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 23 ---------
>  include/linux/pm_domain.h               |  1 -


For the PM core part:

Reviewed-by: Kevin Hilman <khilman at baylibre.com>
Acked-by: Kevin Hilman <khilman at baylibre.com>

For the AMD DRM driver, the changes look right too, but I'm not
confident enough about the intent of that to be sure.

Kevin


More information about the dri-devel mailing list