On Thu, Jan 23, 2014 at 01:52:19PM +0800, Jingoo Han wrote: > On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote: > > > > I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*]. > > > > Are there any technical reasons why dw_pcie_msi_init cannot be called from dw_msi_setup_irq? Or rather, > > why it should not? > > No, there is no special reason. > The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be > good. Thank you for your effort. > > Mohit, Pratyush, > If you have different opinions, please let us know. :-) dw_msi_setup_irq will be called for each function which needs msi assignment. However, dw_pcie_msi_init should be called only once. So, in my opinion calling dw_pcie_msi_init from dw_msi_setup_irq would not be the best option. @Bjørn, can you help us with tracing calling sequence of dw_pcie_setup & dw_pcie_scan_bus. I think when you do "reset bridge", it will call dw_pcie_setup and when you do "rescan bus", it will call dw_pcie_scan_bus. If yes, then you can move dw_pcie_msi_init to dw_pcie_setup. Regards Pratyush > > Best regards, > Jingoo Han > > > > > I’m asking because I have a hotplug scenario where this little hack (call dw_pcie_msi_init from > > dw_msi_setup_irq) fixes a problem with MSI. I therefore need to understand whether it is a sensible > > hack or just crap, and more importantly; how it can be fixed properly. > > > > Scenario: > > > > (remove endpoints) > > # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove > > # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove > > > > # take fpga in and out of reset (this will mess up the configuration space of the bridge) > > > > (reset bridge) > > # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset > > > > (rescan bus) > > # echo 1 > /sys/bus/pci/rescan > > > > At this point everything works fine except MSI. With above mention hack it works like a charm. > > > > I would be grateful if someone could shed light on this. I might have missed some important details. > > > > > > Best regards, > > Bjørn Erik Nilsen > > > > [*] > > > > From: Harro Haan <hrhaan@xxxxxxxxx> > > Date: Thu, 5 Dec 2013 14:06:37 +0100 > > Subject: [PATCH 2/2] PCI: imx6: add support for MSI -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html