summaryrefslogtreecommitdiff
path: root/drivers/soc/imx
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2018-01-03 18:22:03 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit92332a3d08d94392fbc01797e6b7a5f12bc0ab5d (patch)
tree108fd3e6b9a66df15cf5ae08b2938b56b52d1c54 /drivers/soc/imx
parent9bf7d43a0ad30779ebb5b43d2e82a6e326505bc8 (diff)
MLK-17334: imx8: pm-domains: fix array overflow issue
When the resource id is larger than 512, the wakeup_rsrc_id array will overflow, then the resource may always power on. So align the IRQ with resource number to fix the issue. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Diffstat (limited to 'drivers/soc/imx')
-rw-r--r--drivers/soc/imx/pm-domains.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/imx/pm-domains.c b/drivers/soc/imx/pm-domains.c
index d65c3de61740..4b51c99303e9 100644
--- a/drivers/soc/imx/pm-domains.c
+++ b/drivers/soc/imx/pm-domains.c
@@ -42,7 +42,7 @@ static sc_rsrc_t early_power_on_rsrc[] = {
};
static sc_rsrc_t rsrc_debug_console;
-#define IMX8_WU_MAX_IRQS 512
+#define IMX8_WU_MAX_IRQS (((SC_R_LAST + 31) / 32 ) * 32 )
static sc_rsrc_t irq2rsrc[IMX8_WU_MAX_IRQS];
static sc_rsrc_t wakeup_rsrc_id[IMX8_WU_MAX_IRQS / 32];
static DEFINE_SPINLOCK(imx8_wu_lock);