Re: [RFC PATCH 1/4] drm/etnaviv: Prevent IRQ triggering at probe time on i.MX8MM
From: Schrempf Frieder
Date: Thu Apr 30 2020 - 11:30:11 EST
On 30.04.20 16:23, Daniel Baluta wrote:
> On 4/30/20 3:46 PM, Schrempf Frieder wrote:
>> +ÂÂÂ /*
>> +ÂÂÂÂ * On i.MX8MM there is an interrupt getting triggered immediately
>> +ÂÂÂÂ * after requesting the IRQ, which leads to a stall as the handler
>> +ÂÂÂÂ * accesses the GPU registers whithout the clock being enabled.
>> +ÂÂÂÂ * Enabling the clocks briefly seems to clear the IRQ state, so
>> we do
>> +ÂÂÂÂ * this here before requesting the IRQ.
>> +ÂÂÂÂ */
>> +ÂÂÂ err = etnaviv_gpu_clk_enable(gpu);
>> +ÂÂÂ if (err)
>> +ÂÂÂÂÂÂÂ return err;
>> +
>> +ÂÂÂ err = etnaviv_gpu_clk_disable(gpu);
>> +ÂÂÂ if (err)
>> +ÂÂÂÂÂÂÂ return err;
>> +
>> +ÂÂÂ err = devm_request_irq(&pdev->dev, gpu->irq, irq_handler, 0,
>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ dev_name(gpu->dev), gpu);
>> +ÂÂÂ if (err) {
>> +ÂÂÂÂÂÂÂ dev_err(dev, "failed to request IRQ%u: %d\n", gpu->irq, err);
>> +ÂÂÂÂÂÂÂ return err;
>> +ÂÂÂ }
>
> Shouldn't you disable the clk after devm_request_irq is called?
That's what I first thought, too. But then I found out, that merely
enabling the clocks will clear the sparse interrupt and cause the
handler not to be called during probe anymore.