Re: [PATCH v2 21/22] irqchip/gic-v5: Add GICv5 IWB support

From: Marc Zyngier
Date: Thu May 01 2025 - 10:15:58 EST


On Wed, 30 Apr 2025 17:25:24 +0100,
Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx> wrote:
>
> I wrote a diff against the heavily reworked series in progress I have,
> (so it does not apply on v2 - headers moved) with what I came up with
> for the IWB MBIgen like. It works - it removes lots of boilerplate code
> but there is a hack we never really liked in:
>
> gicv5_its_msi_prepare()
>
> that is, using the OF compatible string to detect if we are an IWB or not.

You shouldn't need that. The MSI_FLAG_USE_DEV_FWNODE should be a good
enough indication that this is something of interest, and that ends-up
in the .init_dev_msi_info() callback.

> If we are, we use the msi_alloc_info_t->hwirq to define the LPI eventid,
> basically the IWB wire, if not we just allocate an eventid available from
> the device bitmap.
>
> Other than that (and being forced to provide an IWB irqchip.irq_write_msi_msg()
> pointer even if the IWB can't write anything otherwise we dereference
> NULL) this works.

Not even MBIGEN allows you to change the event. If you really want to
ensure things are even tighter, invent a MSI_FLAG_HARDCODED_MSG flag,
and pass that down the prepare path.

> Is there a better way to implement this ? I would post this code with
> v3 but instead of waiting I thought I could inline it here, feel free
> to ignore it (or flame me if it is a solved problem I failed to spot,
> we need to find a way for the IWB driver to pass the "fixed event" info
> to the ITS - IWB eventIDs are hardwired it is not like the MBIgen where
> the irq_write_msi_msg() callback programs the wire-to-eventid
> translation in HW).

It's *exactly* the same. And see above for a potential explicit
solution. The empty irq_write_msi_msg() is not a problem. It's
actually pretty clean, given how the whole thing works.

Please fold this into your v3, and we'll take it from there.

M.

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