<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body ><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; "><div class="">I am currently developing a PCI block driver and can use only MSI interrupt. &nbsp;During interrupt initialization, I called the pci_enable_msi and request_irq with following sample irq initialization function -</div><div class="" style=""><br class="" style=""></div><div class="" style=""><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; "><div class="">static int mydev_init_irq(struct mydevice *dev_ptr)</div><div class="" style="">{</div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; int error;</div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; struct pci_dev *pdev = dev_ptr-&gt;pdev;</div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; const char *mydev_irq = "mydev_irq";</div><div class="" style=""><br class="" style=""></div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; error = pci_enable_msi(pdev);</div><div class="" style=""><br class="" style=""></div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; if (error) {</div><div class="" style=""><br class="" style=""></div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printk(KERN_WARNING "Failed to enable MSI.");</div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return error;</div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style=""><br class="" style=""></div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="font-size: 10pt;">error = request_irq(pdev-&gt;irq, mydev_irq_handler, IRQF_SHARED,</span></div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mydev_irq, dev_ptr);</div><div class="" style=""><br class="" style=""></div><div class="" style="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="font-size: 10pt;">return error;</span></div><div class="" style="">}</div><div><br></div></div></div><div class="" style="">After the request_irq executes, I always see from my debug trace that my driver is interrupted i.e. mydev_irq_handler got called. &nbsp;I don't think it's proper behavior, because I'm sure at this point of the initialization the device is not fully initialized as well and hasn't sent me an interrupt yet (didn't see this behavior in our Windows driver). &nbsp;At this point in initialization, since the device is not yet fully initialized and can't provide other info to the spurious interrupt I received, the IRQ handler will skip most of the handler function body and go straight to return IRQ_HANDLED, but I'm concerned with this bug.</div><div class="" style=""><br class="" style=""></div><div class="" style="">What could be causing that, and did I miss anything during interrupt initialization that caused it? &nbsp;Right now it's harmless, but I'm worried that it may cause problems in the future, like if I ported it to another Linux distro, and so I want to be able to prevent this.</div><div><br></div></div></div><div><br></div><div><br></div><div><div style="font-size:75%;color:#575757">Sent from Samsung Mobile</div></div></body></html>