WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Dont call msi_unmap_pirq() if did not enabled msi

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Hackel,Kurt" <kurt.hackel@xxxxxxxxxx>, Jerry Yuanjiang Ou <yuanjiang.ou@xxxxxxxxxx>, greg.marsden@xxxxxxxxxx
Subject: [Xen-devel] [PATCH] Dont call msi_unmap_pirq() if did not enabled msi
From: Joe Jin <joe.jin@xxxxxxxxxx>
Date: Mon, 16 Nov 2009 20:00:30 +0800
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, joe.jin@xxxxxxxxxx
Delivery-date: Mon, 16 Nov 2009 04:01:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
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@xxxxxxxxxx>
---
 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;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel