Re: [PATCH v6 05/10] arm64: hyperv: Add interrupt handlers for VMbus and stimer

From: Arnd Bergmann
Date: Wed Mar 18 2020 - 05:52:51 EST


On Wed, Mar 18, 2020 at 1:16 AM Michael Kelley <mikelley@xxxxxxxxxxxxx> wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
> > On Sat, Mar 14, 2020 at 4:36 PM Michael Kelley <mikelley@xxxxxxxxxxxxx> wrote:
> > >
> > > Add ARM64-specific code to set up and handle the interrupts
> > > generated by Hyper-V for VMbus messages and for stimer expiration.
> > >
> > > This code is architecture dependent and is mostly driven by
> > > architecture independent code in the VMbus driver and the
> > > Hyper-V timer clocksource driver.
> > >
> > > This code is built only when CONFIG_HYPERV is enabled.
> > >
> > > Signed-off-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>
> >
> > This looks like it should be a nested irqchip driver instead, so your
> > device drivers can use the normal request_irq() functions etc.
> >
> > Is anything preventing you from doing that? If so, please describe
> > that in the changelog and in a comment in the driver.
> >
>
> As mentioned in my reply on Patch 1, Hyper-V offers a limited synthetic
> interrupt controller managed by Linux code that's been around the last
> 10 years on the x86 side. For reasons that pre-date me, it was not written
> as an irqchip driver.

I think the reason is just that 10 years ago, we did not have the concept
of irqchips as device drivers.

> Modulo the small routines you see in this patch, the code is architecture
> independent, and it seems we ought to keep the high degree of commonality.
> Re-architecting the arch independent code to model as an irqchip driver seems
> to carry some risk to the x86 side that has a lot of real-world usage today, but
> I'll take a look and see what the risks look like and if it adds any clarity.

How many drivers link against the custom interface? If it's less than 10,
making it a real driver is probably not too hard to do.

Arnd