>> When switching in MSI mode, we've noticed that once CAN0 is closed (i.e., once its own interrupt is freed), all other CANs on the same card no longer receive interrupts (i.e., the handler is never called again). > Is it the free_irq() or the other code called on ifdown? Comment out the free_irq() and check what happens. This issue does exist for peak_pci (SJA1000 PC/PCIe driver) as well as for peak_pciefd (CAN FD PC interfaces driver) when MSI mode is requested. At the moment, free_irq() is called on ifdown in both drivers. That's the core of the issue. When commented out, the interrupt handler is always called for the other CANs. But, obvioulsy, ifup(CAN0) now says "RTNETLINK answers: Device or resource busy". --- Stéphane Grosjean PEAK-System France 132, rue André Bisiaux F-54320 MAXEVILLE Tél : +(33) 9.72.54.51.97 De : Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> Envoyé : lundi 23 mars 2020 10:35 À : Stéphane Grosjean <s.grosjean@xxxxxxxxxxxxxxx>; Kurt Van Dijck <dev.kurt@xxxxxxxxxxxxxxxxxxxxxx> Cc : linux-can@xxxxxxxxxxxxxxx <linux-can@xxxxxxxxxxxxxxx> Objet : Re: PCI/PCIe cards and MSI support On 3/23/20 10:25 AM, Stéphane Grosjean wrote: > When switching in MSI mode, we've noticed that once CAN0 is closed > (i.e., once its own interrupt is freed), all other CANs on the same card no longer receive interrupts (i.e., the handler is never called again). Is it the free_irq() or the other code called on ifdown? Comment out the free_irq() and check what happens. > This issue doesn't exist when any other CANx then CAN0 is closed. > > The reason of this is not clear. What we know is that this issue doesn't > exist under Windows for any of our (CAN 2.0 as well as CAN FD) cards. On the contrary, the issue is the same for all of our CAN 2.0 / CAN FD cards under Linux. > > Up to now, the only workaround we have to run in MSI mode is to > request_irq() when probing the devices (starting from CAN0) *AND* > free_irq() in the opposite order (ending with CAN0) when removing the module. > > Obvioulsy, enabling/disabling hw interrupts is always done when the can interface is put to up/down. > > The "only" side effect is that all MSI interupt levels allocated by the > driver are requested, even if their corresponding interfaces are not UP. Which drivers have this problem? Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- PEAK-System Technik GmbH Sitz der Gesellschaft Darmstadt - HRB 9183 Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm Unsere Datenschutzerklaerung mit wichtigen Hinweisen zur Behandlung personenbezogener Daten finden Sie unter www.peak-system.com/Datenschutz.483.0.html