tech-kern archive

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

Re: Musings on MSI



On Aug 17, 2011, at 2:23 PM, David Young wrote:

> On Wed, Aug 17, 2011 at 02:01:53PM -0700, Matt Thomas wrote:
>> 
>> On Aug 17, 2011, at 12:11 PM, David Young wrote:
>> 
>>> On Wed, Aug 17, 2011 at 11:52:18AM -0700, Matt Thomas wrote:
>>>> On Aug 17, 2011, at 9:35 AM, David Young wrote:
>>>>>> int pci_msi_type(pci_chipset_tag_t pc, pci_msi_handle_t msih);
>>>>>> 
>>>>>> return the type of msi allocated (PCI_CAP_MSI or PCI_CAP_MSIX).  In the 
>>>>>> latter case MSI vectors may not be contiguous.
>>>>> 
>>>>> Does it matter to the driver whether or not the vectors are contiguous?
>>>>> Presumably there are no gaps in the available msirq?
>>>> 
>>>> MSIX doesn't matter, MSI it does.
>>> 
>>> Can you give an example where a user of this API has to care whether the
>>> vectors are contiguous or not?
>> 
>> MSI requires contiguous vectors.  Period.  
>> MSIX doesn't since each vector has a separate MSIX table entry.
> 
> Right, but the user of this API does not need to care, do they?

No.  But it's the reason for the specifying PCI_CAP_MSI or MSIX.

>>>>>> void pci_msi_disestablish(pci_chipset_tag_t pc, void *ih);
>>>>>> 
>>>>>> Disestablishes but does not free the MSI.
>>>>> 
>>>>> You mean, pci_msi_disestablish() does not free to the MSI handle's pool?
>>>>> Why not?
>>>> 
>>>> It does.  But not to the system pool.   pci_msi_free does that.
>>> 
>>> Does pci_msi_free() give back "excess" msirqs to the system pool?  Can
>>> you give an example of how/why it is used?
>> 
>> It gives all back.  You can't release a portion, it's all or nothing.
> 
> I don't think I understand why pci_msi_free() is needed.  It seems like
> it is redundant?

No it's not.

disestablish gets rid of the interrupt but it's still allocated to the msi 
handle.
If the owner of the msi handle was to reestablish it differently he can.

But it's only returned to the system (for allocation by another msi handle)
after msi_free is done.


Home | Main Index | Thread Index | Old Index