Registering handler/ISR for MSI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Registering handler/ISR for MSI

3,680件の閲覧回数
gauthamkrishnan_r
Contributor II

I'm generating an MSI from Endpoint to Root Complex on T2080. How to register handler and route the MSI to appropriate ISR for an MSI received on Root Complex? I don't use linux or other OS. It's a baremetal driver. @ufedor 

ラベル(1)
タグ(1)
0 件の賞賛
返信
8 返答(返信)

3,650件の閲覧回数
gauthamkrishnan_r
Contributor II

How can we do this without using linux function calls? @ufedor @yipingwang 

0 件の賞賛
返信

3,633件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

You may have to monitor MSI capability registers for possible arrival of MSI write data, which would then invoke the handler you wish to call.

0 件の賞賛
返信

3,628件の閲覧回数
gauthamkrishnan_r
Contributor II

I'm currently polling MSI Status registers periodically to figure out any active interrupts. But reading MSI capability registers makes no sense to me with regard to active interrupts.

0 件の賞賛
返信

3,623件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Could you poll the registers succesfully?
I meant something similar, the sequence is as below:

write memory address in memory address register.
write # messages requested in message control register
write basic data pattern in message data register
Set MSI enable in control register.


Now poll the interrupt status register on the RC side.

0 件の賞賛
返信

3,621件の閲覧回数
gauthamkrishnan_r
Contributor II

Yes, I'm able to poll it successfully but looking for a solution replicating generation of virtual interrupt numbers when using linux.

0 件の賞賛
返信

3,600件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

I think that will be possible only through linux system call interface.

0 件の賞賛
返信

3,430件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Virtual interrupt numbers and its generation/handling are part of linux interrupt framework.
Why do you want to replicate it.

I think we have two clean options:

1. use linux system calls for interrupt framework and routing to interrupt handler through request_irq()

2. use manual polling of MSI interrupt and call a custom handler to handle the interrupt without involving linux interrupt framework.

This would make things simple.

0 件の賞賛
返信

3,654件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

To register handler, pci_enable_msi should be called it will reserve a MSI vector.
After that call request_irq function.

err = pci_enable_msi(my_pci_dev);
err = request_irq(my_pci_dev->irq, irq_handler, 0, "PCI_CARD", NULL);

to reserve multiple vectors, use this:

err = pci_enable_msi_block(my_pci_dev,3);
request_irq(my_pci_dev->irq, irq_handler_0, ...); request_irq(my_pci_dev->irq + 1, irq_handler_1, ...); request_irq(my_pci_dev->irq + 2, irq_handler_2, ...);

0 件の賞賛
返信