Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <peng.fan@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Peng Fan and committed by
Shawn Guo
e2314cf5 b663b798

+4
+4
drivers/firmware/imx/scu-pd.c
··· 46 46 47 47 #include <dt-bindings/firmware/imx/rsrc.h> 48 48 #include <linux/firmware/imx/sci.h> 49 + #include <linux/firmware/imx/svc/rm.h> 49 50 #include <linux/io.h> 50 51 #include <linux/module.h> 51 52 #include <linux/of.h> ··· 256 255 { 257 256 struct imx_sc_pm_domain *sc_pd; 258 257 int ret; 258 + 259 + if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx)) 260 + return NULL; 259 261 260 262 sc_pd = devm_kzalloc(dev, sizeof(*sc_pd), GFP_KERNEL); 261 263 if (!sc_pd)