Re: [patch V2 08/21] genirq/msi: Add pointers for per device irq domains

From: Thomas Gleixner
Date: Thu Nov 24 2022 - 10:02:54 EST


On Thu, Nov 24 2022 at 14:56, Marc Zyngier wrote:
> On Mon, 21 Nov 2022 14:36:28 +0000,
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>> static inline int msi_sysfs_create_group(struct device *dev);
>>
>> +static inline void msi_setup_default_irqdomain(struct device *dev, struct msi_device_data *md)
>
> Do we really need this to be inline? I'm sure the compiler can figure
> it out.

No. I'll fix that up.

>> +{
>> + if (!dev->msi.domain)
>> + return;
>> + /*
>> + * If @dev::msi::domain is a global MSI domain, copy the pointer
>> + * into the domain array to avoid conditionals all over the place.
>> + */
>> + if (!irq_domain_is_msi_parent(dev->msi.domain))
>> + md->__irqdomains[MSI_DEFAULT_DOMAIN] = dev->msi.domain;
>> +}
>> +
>> /**
>> * msi_alloc_desc - Allocate an initialized msi_desc
>> * @dev: Pointer to the device for which this is allocated
>> @@ -213,6 +225,8 @@ int msi_setup_device_data(struct device
>> return ret;
>> }
>>
>> + msi_setup_default_irqdomain(dev, md);
>> +
>
> nit: if you move the setup below the msi.data assignment, you could
> only pass dev as a parameter. Or pass both and move the assignment in
> the function?

In which order we do that it all looks wrong :)

>> xa_init(&md->__store);
>> mutex_init(&md->mutex);
>> dev->msi.data = md;
>>
>>
>
> Irrespective of the above,
>
> Reviewed-by: Marc Zyngier <maz@xxxxxxxxxx>
>
> M.