[PATCH v3 2/2] drm/rockchip: vop: fix irq disabled after vop driver probed

Heiko Stuebner heiko at sntech.de
Mon Jun 18 09:38:32 UTC 2018


Am Montag, 18. Juni 2018, 10:44:58 CEST schrieb Tomasz Figa:
> Hi Heiko,
> 
> On Tue, Jun 12, 2018 at 9:15 PM Heiko Stuebner <heiko at sntech.de> wrote:
> >
> > From: Sandy Huang <hjc at rock-chips.com>
> >
> > The vop irq is shared between vop and iommu and irq probing in the
> > iommu driver moved to the probe function recently. This can in some
> > cases lead to a stall if the irq is triggered while the vop driver
> > still has it disabled, but the vop irq handler gets called.
> >
> > But there is no real need to disable the irq, as the vop can simply
> > also track its enabled state and ignore irqs in that case.
> > For this we can simply check the power-domain state of the vop,
> > similar to how the iommu driver does it.
> >
> > So remove the enable/disable handling and add appropriate condition
> > to the irq handler.
> >
> > changes in v2:
> > - move to just check the power-domain state
> > - add clock handling
> > changes in v3:
> > - clarify comment to speak of runtime-pm not power-domain
> [snip]
> > @@ -1209,8 +1215,11 @@ static irqreturn_t vop_isr(int irq, void *data)
> >         spin_unlock(&vop->irq_lock);
> >
> >         /* This is expected for vop iommu irqs, since the irq is shared */
> > -       if (!active_irqs)
> > -               return IRQ_NONE;
> > +       if (!active_irqs) {
> > +               ret = IRQ_NONE;
> > +               vop_core_clks_disable(vop);
> 
> nit: If we're adding "out:", couldn't we also add "out_clks:" and move
> the call to vop_core_clks_disable() there?
> 
> > +               goto out;
> > +       }
> >
> >         if (active_irqs & DSP_HOLD_VALID_INTR) {
> >                 complete(&vop->dsp_hold_completion);
> > @@ -1236,6 +1245,10 @@ static irqreturn_t vop_isr(int irq, void *data)
> >                 DRM_DEV_ERROR(vop->dev, "Unknown VOP IRQs: %#02x\n",
> >                               active_irqs);
> >
> > +       vop_core_clks_disable(vop);
> > +
> > +out:
> > +       pm_runtime_put(vop->dev);
> >         return ret;
> >  }
> 
> Other than that:
> 
> Reviewed-by: Tomasz Figa <tfiga at chromium.org>

That's similar to what Marc suggested and thus already part of v4
posted last tuesday, so I'll just carry over your Reviewed-by.

Could you possibly also give patch1 a nod of approval? So I can honor
the strong suggestion in the drm-misc documentation? ;-)

Thanks
Heiko




More information about the dri-devel mailing list