Re: [PATCH] incremental fix for NIU MSI-X problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Ellerman wrote:
>>  		entry = alloc_msi_entry(dev);
>> -		if (!entry)
>> -			break;
>> +		if (!entry) {
>> +			msi_free_irqs(dev);
>> +			return -ENOMEM;
> 
> Should be:
> 			 return i;

Genius!

>> +		}
>>  
>>  		j = entries[i].entry;
>>  		entry->msi_attrib.is_msix = 1;
>>
>> One concern is if we don't have enough memory to have number of entries
>> requested at first time, the driver will get -ENOMEM and will not do retry
>> even if we can have less number of entries.
> 
> That should be fixed by returning i, ie. the number of entries we had
> memory to allocate.

Yes, if number of allocatable vector is less than that of allocatable entry,
pci_enable_msix() will be return again with >0 but it will never be problem,
because "allocatable number" changes from time to time.  As you once said,
"you might not be able to get the number of interrupts that pci_enable_msix
reported."

I'll post this fix in a patch format soon.
I'd appreciate it if you can provide Acked-by for it.


Thanks,
H.Seto

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux