RE: [patch 15/20] genirq/msi: Provide new domain id allocation functions

From: Thomas Gleixner
Date: Fri Nov 18 2022 - 07:27:51 EST


On Fri, Nov 18 2022 at 08:43, Kevin Tian wrote:
>> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>> Sent: Friday, November 11, 2022 9:57 PM
>>
>> @@ -597,7 +598,7 @@ static struct irq_domain *msi_get_device
>> if (!domain)
>> return NULL;
>>
>> - if (WARN_ON_ONCE(irq_domain_is_msi_parent(domain)))
>> + if (irq_domain_is_msi_parent(domain))
>> return NULL;
>
> Is it intended to remove the warning here? If yes, what specific change
> in this patch leads to that removal?

Valid question

>> + xa_for_each_range(xa, idx, desc, ctrl->first + base, ctrl->last + base) {
>> + if (!msi_desc_match(desc, MSI_DESC_NOTASSOCIATED))
>> + continue;
>> +
>> + /* This should return -ECONFUSED... */
>> + if (WARN_ON_ONCE(allocated >= ctrl->nirqs))
>> + return -EINVAL;
>> +
>
> why is "==" an error?

because if you get here _after_ having allocated all interrupts already
then you have more descriptors than what you want to allocate, which
should never happen right?

Thanks,

tglx