All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Dont call msi_unmap_pirq() if did not enabled msi
@ 2009-11-16 12:00 Joe Jin
  2009-11-16 15:15 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 16+ messages in thread
From: Joe Jin @ 2009-11-16 12:00 UTC (permalink / raw)
  To: Keir Fraser, Hackel,Kurt, Jerry Yuanjiang Ou, greg.marsden
  Cc: Xen-devel, joe.jin

Hi,

When device driver unload, it may call pci_disable_msi(), if msi did not 
enabled but do msi_unmap_pirq(), then later driver reload and without
msi, then will failed in request_irq() for irq_desc[irq]->chip valie is 
no_irq_chip. So when did not enable msi during driver initializing, then
unloaded driver will not try to disable it.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
---
 msi-xen.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/pci/msi-xen.c	2009-11-16 10:48:26.000000000 +0800
+++ b/drivers/pci/msi-xen.c	2009-11-16 19:27:17.000000000 +0800
@@ -670,6 +670,12 @@ void pci_disable_msi(struct pci_dev* dev
 	if (!pos)
 		return;
 
+	if (!(dev->msi_enabled)) {
+		printk(KERN_INFO "PCI: %s: Device did not eanble MSI.\n",
+		       pci_name(dev));
+		return;
+	}
+	
 	pirq = dev->irq;
 	/* Restore dev->irq to its default pin-assertion vector */
 	dev->irq = dev->irq_old;

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-11-26 10:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-16 12:00 [PATCH] Dont call msi_unmap_pirq() if did not enabled msi Joe Jin
2009-11-16 15:15 ` Konrad Rzeszutek Wilk
2009-11-16 15:26   ` Konrad Rzeszutek Wilk
2009-11-17  0:19   ` Joe Jin
2009-11-17  7:59     ` Jan Beulich
2009-11-17 10:14       ` Joe Jin
2009-11-17 11:21         ` Jan Beulich
2009-11-18  6:23           ` Jiang, Yunhong
2009-11-23  2:24             ` Joe Jin
2009-11-24  2:02               ` Joe Jin
2009-11-24  6:12                 ` Jiang, Yunhong
2009-11-24  6:42                   ` Joe Jin
2009-11-24  7:06                     ` Jiang, Yunhong
2009-11-26  9:14                 ` Jan Beulich
2009-11-26 10:03                   ` Jiang, Yunhong
2009-11-26 10:14                     ` Jiang, Yunhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.