Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Legacy MSI without Per Vector Masking (PVM) support: (4 Items)
   
Legacy MSI without Per Vector Masking (PVM) support  
I have a public open-source project that aims to porting of Linux CAN-bus drivers to QNX.
Repository: https://github.com/Deniz-Eren/dev-can-linux

I have a question regarding PCI capability 0x05 (MSI) usage when Per Vector Masking (PVM) isn't supported by legacy 
devices.

Calling function cap_msi_get_irq_mask() returns PCI_ERR_ENOTSUP as per the MSI API documentation: https://www.qnx.com/
developers/docs/7.1/#com.qnx.doc.pci_server/topic/module_msi.html

Quote: "The following APIs retrieve the interrupt pending/mask values, respectively, if Per Vector Masking (PVM) is 
supported"

This fine, however the question that comes next, if I'm dealing with a legacy PCI device, which has MSI support, however
 does NOT support Per Vector Masking (PVM), then how do I mask and unmask MSI vectors? Is it OK to just not mask at all?


I haven't tested with real hardware yet, this pending, however, I have tested with QEmu, by implementing support for 
such a device (https://github.com/Deniz-Eren/qemu/tree/feature/can-sja100-pci-msi-support). This test is effectively 
done without masking and unmasking; the driver seems to work correctly. Well to elaborate more, the driver is still 
calling the masking API functions and printing error messages "error: Requested Operation Is Not Supported 
[(PCI_ERR_ENOTSUP)]" from pci_strerror().

So summarize, do you recommend doing any other type of masking than the MSI API functions when using this type of legacy
 device that has MSI but does NOT support Per Vector Masking (PVM)?
Re: Legacy MSI without Per Vector Masking (PVM) support  
For clarrity, to test MSI even though error PCI_ERR_ENOTSUP is reported, I have commented out our check for PVM support.
 As said, from a send/receive perspective, in QEmu VM, it seems to be working. I just need validation this is a valid 
way forwards, or do we need an alternative mask/unmask besides the MSI API?

if (capid == CAPID_MSI) {                                                    
    cap_msi_mask_t mask;                                                     
                                                                             
    r = cap_msi_get_irq_mask(dev->hdl, dev->msi_cap, &mask);                 
                                                                             
    if (r == PCI_ERR_ENOTSUP) {                                              
        log_err("capability 0x%02x (MSI) Per Vector Masking (PVM) not "      
                "supported\n", capid);                                       
                                                                             
        //msix_uninit(dev);                                                  
        //return r;                                                          
    }                                                                        
    else if (r != PCI_ERR_OK) {                                              
        log_err("cap_msi_get_irq_mask error; %s\n", pci_strerror(r));        
                                                                             
        msix_uninit(dev);                                                    
        return r;                                                            
    }                                                                        
}
 
Re: Legacy MSI without Per Vector Masking (PVM) support  
Re: Legacy MSI without Per Vector Masking (PVM) support  
Tried on real hardware PCM-26D2CA PCIe CAN device, Advantech iDoor Module: 2-Ports Isolated CANBus mPCIe, DB9

Same result, the PCI 0x05 capability functions report Per Vector Masking (PVM) is not supported.

With such hardware, what is the usual practice? Do you just ignore masking/unmasking the MSI interrupts? Or is there 
some other way to mask/unmask?