Skip to content

Commit e2314cf

Browse files
MrVanShawn Guo
authored andcommitted
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>
1 parent b663b79 commit e2314cf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/firmware/imx/scu-pd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
#include <dt-bindings/firmware/imx/rsrc.h>
4848
#include <linux/firmware/imx/sci.h>
49+
#include <linux/firmware/imx/svc/rm.h>
4950
#include <linux/io.h>
5051
#include <linux/module.h>
5152
#include <linux/of.h>
@@ -256,6 +257,9 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
256257
struct imx_sc_pm_domain *sc_pd;
257258
int ret;
258259

260+
if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx))
261+
return NULL;
262+
259263
sc_pd = devm_kzalloc(dev, sizeof(*sc_pd), GFP_KERNEL);
260264
if (!sc_pd)
261265
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)