Skip to content

Commit e433110

Browse files
inochisabjorn-helgaas
authored andcommitted
PCI: vmd: Override irq_startup()/irq_shutdown() in vmd_init_dev_msi_info()
Since commit 54f45a3 ("PCI/MSI: Add startup/shutdown for per device domains") set callback irq_startup() and irq_shutdown() of the struct pci_msi[x]_template, __irq_startup() will always invokes irq_startup() callback instead of irq_enable() callback overridden in vmd_init_dev_msi_info(). This will not start the IRQ correctly. Also override irq_startup()/irq_shutdown() in vmd_init_dev_msi_info(), so the irq_startup() can invoke the real logic. Fixes: 54f45a3 ("PCI/MSI: Add startup/shutdown for per device domains") Reported-by: Kenneth Crudup <kenny@panix.com> Closes: https://lore.kernel.org/r/8a923590-5b3a-406f-a324-7bd1cf894d8f@panix.com/ Reported-by: Genes Lists <lists@sapience.com> Closes: https://lore.kernel.org/r/4b392af8847cc19720ffcd53865f60ab3edc56b3.camel@sapience.com Reported-by: Todd Brandt <todd.e.brandt@intel.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220658 Reported-by: Oliver Hartkopp <socketcan@hartkopp.net> Closes: https://lore.kernel.org/r/8d6887a5-60bc-423c-8f7a-87b4ab739f6a@hartkopp.net Reported-by: Hervé <herve@dxcv.net> Signed-off-by: Inochi Amaoto <inochiama@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Kenneth R. Crudup <kenny@panix.com> Tested-by: Genes Lists <lists@sapience.com> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com> Tested-by: Hervé <herve@dxcv.net> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20251014014607.612586-1-inochiama@gmail.com
1 parent 469276c commit e433110

File tree

1 file changed

+13
-0
lines changed
  • drivers/pci/controller

1 file changed

+13
-0
lines changed

drivers/pci/controller/vmd.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ static void vmd_pci_msi_enable(struct irq_data *data)
192192
data->chip->irq_unmask(data);
193193
}
194194

195+
static unsigned int vmd_pci_msi_startup(struct irq_data *data)
196+
{
197+
vmd_pci_msi_enable(data);
198+
return 0;
199+
}
200+
195201
static void vmd_irq_disable(struct irq_data *data)
196202
{
197203
struct vmd_irq *vmdirq = data->chip_data;
@@ -210,6 +216,11 @@ static void vmd_pci_msi_disable(struct irq_data *data)
210216
vmd_irq_disable(data->parent_data);
211217
}
212218

219+
static void vmd_pci_msi_shutdown(struct irq_data *data)
220+
{
221+
vmd_pci_msi_disable(data);
222+
}
223+
213224
static struct irq_chip vmd_msi_controller = {
214225
.name = "VMD-MSI",
215226
.irq_compose_msi_msg = vmd_compose_msi_msg,
@@ -309,6 +320,8 @@ static bool vmd_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
309320
if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
310321
return false;
311322

323+
info->chip->irq_startup = vmd_pci_msi_startup;
324+
info->chip->irq_shutdown = vmd_pci_msi_shutdown;
312325
info->chip->irq_enable = vmd_pci_msi_enable;
313326
info->chip->irq_disable = vmd_pci_msi_disable;
314327
return true;

0 commit comments

Comments
 (0)