Re: [PATCH V3 08/10] irqchip: Add LoongArch CPU interrupt controller support

From: Huacai Chen
Date: Sun Aug 29 2021 - 23:20:49 EST


Hi, Marc,

On Sun, Aug 29, 2021 at 7:01 PM Marc Zyngier <maz@xxxxxxxxxx> wrote:
>
> On Sun, 29 Aug 2021 11:34:21 +0100,
> Huacai Chen <chenhuacai@xxxxxxxxx> wrote:
> >
> > Hi, Marc,
> >
> > On Sun, Aug 29, 2021 at 6:10 PM Marc Zyngier <maz@xxxxxxxxxx> wrote:
> > >
> > > On Sun, 29 Aug 2021 10:37:48 +0100,
> > > Huacai Chen <chenhuacai@xxxxxxxxx> wrote:
> > >
> > > > > Are you saying that there is no way for the interrupt controller
> > > > > driver to figure out the hwirq number on its own? That would seem
> > > > > pretty odd (even the MIPS GIC has that). Worse case, you can provide
> > > > > an arch-specific helper that exposes the current hwirq based on the
> > > > > vector that triggered.
> > > > We can get the hwirq number by reading CSR.ESTAT register, but in this
> > > > way "vectored interrupts" is meaningless.
> > >
> > > Let's face it, the way you use vectored interrupts makes zero sense
> > > already. The whole point of vectored interrupts is that the CPU can
> > > branch to the handler directly, making the interrupt handling cheaper
> > > as there should be no additional decoding and you can run the final
> > > handler immediately. Here, all your interrupts point to the same
> > > "default handler"...
> > The default handler can be overridden by arch code.
>
> How? Do you plan to bypass the whole of the Linux interrupt stack and
> jump straight to the function provided by a driver via request_irq()?
>
> Because that's the *only* way for vectored interrupts to make any
> difference. They otherwise are an antiquated leftover from a time when
> shaving every single instructions was an absolute requirement.
> Vectored interrupts also tend to confuse vectors and priorities (yet
> another bad move).
>
> So let's be serious, the whole vectored interrupts is utter rubbish,
> and you haven't given *any* argument as to why you can't make your
> interrupt handling behave sanely and be maintainable.
>
> Anyhow, we have both wasted enough time on this. I have suggested a
> number of ways you can rework your interrupt handling to be more
> acceptable. You can take or leave my suggestions, but I have no
> intention to give my blessing to patches that have the current level
> of quality.
OK, now I know that vectored interrupts make no sense in the current
linux kernel irq framework. I will take all your suggestions, thanks
for your patience in teaching me so much!

Huacai
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.