diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 12e3c4979e13..a623276fcf72 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -409,6 +409,9 @@ static void gic_hibernation_suspend(void) void __iomem *base = gic_data.dist_base; void __iomem *rdist_base = gic_data_rdist_sgi_base(); + if ((base == NULL) || (rdist_base == NULL)) + return; + gic_data.enabled_sgis = readl_relaxed(rdist_base + GICD_ISENABLER); gic_data.pending_sgis = readl_relaxed(rdist_base + GICD_ISPENDR); /* Store edge level for PPIs by reading GICR_ICFGR1 */ @@ -442,6 +445,9 @@ static void gic_show_resume_irq(struct gic_chip_data *gic) u32 pending[32]; void __iomem *base = gic_data.dist_base; + if (base == NULL) + return; + if (!msm_show_resume_irq_mask) return; diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 447e7b5cf13b..e4020bb8cd2d 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -249,6 +249,9 @@ static int gic_suspend_one(struct gic_chip_data *gic) unsigned int i; void __iomem *base = gic_data_dist_base(gic); + if (base == NULL) + return 0; + for (i = 0; i * 32 < gic->gic_irqs; i++) { gic->enabled_irqs[i] = readl_relaxed(base + GIC_DIST_ENABLE_SET + i * 4); @@ -280,6 +283,9 @@ static void gic_show_resume_irq(struct gic_chip_data *gic) u32 pending[32]; void __iomem *base = gic_data_dist_base(gic); + if (base == NULL) + return; + raw_spin_lock(&irq_controller_lock); for (i = 0; i * 32 < gic->gic_irqs; i++) { enabled = readl_relaxed(base + GIC_DIST_ENABLE_CLEAR + i * 4);