Re: [PATCH v2 4/9] perf/cxl: Accept an overflow interrupt on MSI message number 0

Dave Jiang <[email protected]> Thu, 30 Jul 2026 14:32:45 -0700
Newsgroups org.kernel.vger.linux-cxl,org.kernel.vger.linux-perf-users
Message-ID <[email protected]>

On 7/30/26 11:57 AM, Jonathan Cameron wrote:
> On Thu, 30 Jul 2026 13:18:42 +0100
> Robin Murphy <[email protected]> wrote:
> 
>> On 29/07/2026 3:55 pm, Dave Jiang wrote:
>>> cxl_pmu_probe() rejects the PMU with -EINVAL when info->irq <= 0, but
>>> info->irq holds the MSI/MSI-X message number the device signals overflow
>>> on (CXL_PMU_CAP_MSI_N_MSK, a 0-based 4-bit field), with -1 meaning "no
>>> interrupt support". Message number 0 is valid and pci_irq_vector() takes
>>> a 0-based index, so a compliant device signalling on the first vector is
>>> wrongly refused and fails to probe.  
>>
>> If info->irq is a PCI MSI vector index, not the Linux vIRQ number, then 
>> surely that means the irq_set_affinity() calls are wrong as well?
> 
> yup.  I really messed this driver up :(
> 
> should rename this one and then have irq mean irq.

I have a patch for v3 :) > 
> 
>>
>> Thanks,
>> Robin.
>>
>>> Reject only the no-interrupt case (info->irq < 0), matching the sibling
>>> CXL mailbox and event IRQ handling.
>>>
>>> Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
>>> Reported-by: [email protected]
>>> Closes: https://sashiko.dev/#/patchset/[email protected]?part=1
>>> Assisted-by: Claude:claude-opus-4-8
>>> Signed-off-by: Dave Jiang <[email protected]>
>>> ---
>>>   drivers/perf/cxl_pmu.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
>>> index 956da8202551..d1e810601e36 100644
>>> --- a/drivers/perf/cxl_pmu.c
>>> +++ b/drivers/perf/cxl_pmu.c
>>> @@ -876,7 +876,7 @@ static int cxl_pmu_probe(struct device *dev)
>>>   		.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
>>>   	};
>>>   
>>> -	if (info->irq <= 0)
>>> +	if (info->irq < 0)
>>>   		return -EINVAL;
>>>   
>>>   	rc = pci_irq_vector(pdev, info->irq);  
>>
>