diff --git a/drivers/gpu/nvgpu/common/falcon/falcon.c b/drivers/gpu/nvgpu/common/falcon/falcon.c index 4d91f8f01..ef4e7b067 100644 --- a/drivers/gpu/nvgpu/common/falcon/falcon.c +++ b/drivers/gpu/nvgpu/common/falcon/falcon.c @@ -140,19 +140,28 @@ void nvgpu_falcon_set_irq(struct nvgpu_falcon *flcn, bool enable, u32 intr_mask, u32 intr_dest) { struct nvgpu_falcon_ops *flcn_ops; + struct gk20a *g; if (flcn == NULL) { return; } + g = flcn->g; flcn_ops = &flcn->flcn_ops; - if (flcn_ops->set_irq != NULL) { - flcn_ops->set_irq(flcn, enable, intr_mask, intr_dest); - } else { - nvgpu_warn(flcn->g, "Invalid op on falcon 0x%x ", - flcn->flcn_id); + if (flcn_ops->set_irq == NULL) { + nvgpu_warn(g, "Invalid op on falcon 0x%x ", flcn->flcn_id); + return; } + + if (!flcn->is_interrupt_enabled) { + nvgpu_warn(g, "Interrupt not supported on flcn 0x%x ", + flcn->flcn_id); + /* Keep interrupt disabled */ + enable = false; + } + + flcn_ops->set_irq(flcn, enable, intr_mask, intr_dest); } int nvgpu_falcon_wait_for_halt(struct nvgpu_falcon *flcn, unsigned int timeout) diff --git a/drivers/gpu/nvgpu/common/falcon/falcon_gk20a.c b/drivers/gpu/nvgpu/common/falcon/falcon_gk20a.c index 0657fd896..4ff706823 100644 --- a/drivers/gpu/nvgpu/common/falcon/falcon_gk20a.c +++ b/drivers/gpu/nvgpu/common/falcon/falcon_gk20a.c @@ -68,13 +68,6 @@ static void gk20a_falcon_set_irq(struct nvgpu_falcon *flcn, bool enable, struct gk20a *g = flcn->g; u32 base_addr = flcn->flcn_base; - if (!flcn->is_interrupt_enabled) { - nvgpu_warn(g, "Interrupt not supported on flcn 0x%x ", - flcn->flcn_id); - /* Keep interrupt disabled */ - enable = false; - } - if (enable) { gk20a_writel(g, base_addr + falcon_falcon_irqmset_r(), intr_mask);