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-changelog

[Xen-changelog] [linux-2.6.18-xen] xen: Dont call msi_unmap_pirq() if di

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen: Dont call msi_unmap_pirq() if did not enable msi
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Nov 2009 09:05:03 -0800
Delivery-date: Tue, 24 Nov 2009 09:05:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259073919 0
# Node ID 7bae5a000157a222200337d24eafd5a00f87ca57
# Parent  1db1bb63824b25f97d127449faeb3a56f1272c97
xen: Dont call msi_unmap_pirq() if did not enable msi

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.

How to reproduce it:
  At the server with QLogic 25xx, try to reload qla2xxx will hit it.

Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
---
 drivers/pci/msi-xen.c |   13 +++++++++++++
 1 files changed, 13 insertions(+)

diff -r 1db1bb63824b -r 7bae5a000157 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c     Mon Nov 23 07:32:47 2009 +0000
+++ b/drivers/pci/msi-xen.c     Tue Nov 24 14:45:19 2009 +0000
@@ -618,6 +618,7 @@ int pci_enable_msi(struct pci_dev* dev)
                        return ret;
 
                dev->irq = evtchn_map_pirq(-1, dev->irq);
+               dev->msi_enabled = 1;
                msi_dev_entry->default_irq = temp;
 
                return ret;
@@ -662,9 +663,15 @@ void pci_disable_msi(struct pci_dev* dev
 
 #ifdef CONFIG_XEN_PCIDEV_FRONTEND
        if (!is_initial_xendomain()) {
+               if (!(dev->msi_enabled)) {
+                       printk(KERN_INFO "PCI: %s: Device did not enabled 
MSI.\n",
+                              pci_name(dev));
+                       return;
+               }
                evtchn_map_pirq(dev->irq, 0);
                pci_frontend_disable_msi(dev);
                dev->irq = msi_dev_entry->default_irq;
+               dev->msi_enabled = 0;
                return;
        }
 #endif
@@ -673,6 +680,12 @@ void pci_disable_msi(struct pci_dev* dev
        if (!pos)
                return;
 
+       if (!(dev->msi_enabled)) {
+               printk(KERN_INFO "PCI: %s: Device did not enabled MSI.\n",
+                      pci_name(dev));
+               return;
+       }
+ 
        pirq = dev->irq;
        /* Restore dev->irq to its default pin-assertion vector */
        dev->irq = msi_dev_entry->default_irq;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen: Dont call msi_unmap_pirq() if did not enable msi, Xen patchbot-linux-2.6.18-xen <=