This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

multiple MSI for PCIe in K2H?

Is it possible to enable multiple MSI in an EP driver for PCIe in linux? I have read these 2 posts that indicate issue for multiple MSI

e2e.ti.com/.../1516972

https://e2e.ti.com/support/embedded/linux/f/354/t/350070

Do we have to call pci_enable_msi_block(pdev,1) for 4 times to get  4 MSI's or it is not possible to get multiple MSI in keystone II architecture?

Regards

  • Hi, Shehzad,

    In the first thread, the comment was "In keystone-II implementation, only 1 interrupt per device is supported. Please see drivers/pci/host/pcie-keystone.c in which arch_setup_msi_irq() calls get_free_msi(). get_free_msi() finds the first zero bit and returns it as the interrupt to be used. To allocate multiple interrupts for the device, the application can try to make multiple calls into pci_enable_msi_block() to get multiple interrupts."

    Yes, you want to make multiple calls.

    Rex

  • Thanks Rex,

    But when I try to make multiple calls to pci_enable_msi_block() , driver crashes. I checked with printk's , second call to pci_enable_msi_block() causes driver to crash. My code is as:

    
    

     

     

    for (i = 0; i < 4 ; i++)
    
       {
    
         printk(KERN_DEBUG "enabling MSI %d\n", i+1);
    
         ret = pci_enable_msi_block(pdev,1);
    
         printk(KERN_DEBUG "enabed MSI %d\n", i+1);
    
         irq_num[i] =pdev->irq;
    
         printk(KERN_DEBUG "irq%d has line number = %d\n", i+1, pdev->irq);
    
         if(ret != 0)
    
         {
    
           printk(KERN_DEBUG "Unable to allocate MSI 1-16 return value is %d\n", ret);
    
           return ret;
    
         }
    
         else
    
         {
    
          printk(KERN_DEBUG "Successfully allocated MSI %d \n",i+1);
    
         }
    
    
    
    Output:
    
    enabling MSI 1
    
    enabed MSI 1
    
    irq1 has line number = 576
    
    Successfully allocated MSI 1
    
    enabling MSI 2
    
    [ Crash].

  • Has anyone tried with 4 MSI on Linux with Keystone II?