diff options
author | Peng Fan <[email protected]> | 2020-09-08 18:07:01 +0800 |
---|---|---|
committer | Shawn Guo <[email protected]> | 2020-09-13 09:45:53 +0800 |
commit | e2314cf5af30d5e87cbf89fdef1a0fe4efee4552 (patch) | |
tree | 849e3d88e3e6978dbf0eaee901bb64dc87a70f95 | |
parent | b663b798d04fb73f1ad4d54c46582d2fde7a76d6 (diff) |
firmware: imx: scu-pd: ignore power domain not owned
Should not register power domain that not owned by current
partition.
Alought power domains will not be registered when power on failure,
we have to let CPU waste more cycles.
Whether power on or owned check, both need communicate with SCU,
but with owned check, we no need to run more code path to save CPU
cycles.
Signed-off-by: Peng Fan <[email protected]>
Reviewed-by: Leonard Crestez <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
-rw-r--r-- | drivers/firmware/imx/scu-pd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c index af3d6d9ead28..946eea292b52 100644 --- a/drivers/firmware/imx/scu-pd.c +++ b/drivers/firmware/imx/scu-pd.c @@ -46,6 +46,7 @@ #include <dt-bindings/firmware/imx/rsrc.h> #include <linux/firmware/imx/sci.h> +#include <linux/firmware/imx/svc/rm.h> #include <linux/io.h> #include <linux/module.h> #include <linux/of.h> @@ -256,6 +257,9 @@ imx_scu_add_pm_domain(struct device *dev, int idx, struct imx_sc_pm_domain *sc_pd; int ret; + if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx)) + return NULL; + sc_pd = devm_kzalloc(dev, sizeof(*sc_pd), GFP_KERNEL); if (!sc_pd) return ERR_PTR(-ENOMEM); |