drm/verisilicon: vs_dc: Fix to disable interrupt on probe 54/296554/1 accepted/tizen/unified/riscv/20230802.014257
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Tue, 1 Aug 2023 02:30:40 +0000 (11:30 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Tue, 1 Aug 2023 02:30:40 +0000 (11:30 +0900)
There is a case where interrupt enable is set in decon req before
decon probe is completed. There is a problem that a kernel panic
occurs if an interrupt is executed before the decon is bound. Disable
interrupts before registering interrupts. Also, irq generated when the
interrupt state is disabled is ignored.

Change-Id: I8b3571b006031c28349e1647f2d9a5c508ca6235
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/gpu/drm/verisilicon/vs_dc.c

index 7c7b72cc5f77611d7530e2734d4af15217c41302..092884645d711ffe465629813727d21310f3bc3a 100644 (file)
@@ -810,6 +810,8 @@ static irqreturn_t dc_isr(int irq, void *data)
                return IRQ_HANDLED;
 
        ret = dc_hw_get_interrupt(&dc->hw);
+       if (!ret)
+               return IRQ_HANDLED;
 
        for (i = 0; i < dc_info->panel_num; i++)
                vs_crtc_handle_vblank(&dc->crtc[i]->base, dc_hw_check_underflow(&dc->hw));
@@ -1017,6 +1019,8 @@ static int dc_probe(struct platform_device *pdev)
                return ret;
        }
 
+       dc_hw_enable_interrupt(&dc->hw, 0);
+
        irq = platform_get_irq(pdev, 0);
 
        ret = devm_request_irq(dev, irq, dc_isr, 0, dev_name(dev), dc);