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

Re: [Xen-devel] [PATCH] Dont call msi_unmap_pirq() if did not enabled ms

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Dont call msi_unmap_pirq() if did not enabled msi
From: Joe Jin <joe.jin@xxxxxxxxxx>
Date: Tue, 17 Nov 2009 08:19:09 +0800
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Hackel, Kurt" <kurt.hackel@xxxxxxxxxx>, greg.marsden@xxxxxxxxxx, Joe Jin <joe.jin@xxxxxxxxxx>, Jerry Yuanjiang Ou <yuanjiang.ou@xxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Mon, 16 Nov 2009 16:20:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20091116151546.GC30967@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>
References: <20091116120030.GA13803@xxxxxxxxxxxxxxxxxxxxxxx> <20091116151546.GC30967@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
On 2009-11-16 10:15, Konrad Rzeszutek Wilk wrote:
> On Mon, Nov 16, 2009 at 08:00:30PM +0800, Joe Jin wrote:
> > 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
> 
> Where does that happen? That looks to be a driver bug as well.

We tried to reload qla2xxx driver, unload was worked, but installed the module
again, failed with ""Failed to reserve interrupt 22/23 already in use."

Have tried no-xen kernel and it worked fine, dig the codes found when unloaded
the driver, the driver always call pci_disable_msi() even driver call 
pci_enable_msi() during driver initializing.

Compared xen pci_disable_msi() with no-xen pci_disable_msi() found it caused 
by called msi_unmap_pirq(), at the function it set irq_desc[irq]->chip to
&no_irq_chip.

Then when tried to install the driver again via request_irq(), when call
setup_irq(), the function found the chip's value is no_irq_chip then return
-ENOSYS and failed to assign the irq to driver.


> 
> > +   if (!(dev->msi_enabled)) {
> > +           printk(KERN_INFO "PCI: %s: Device did not eanble MSI.\n",
>                                                           ^^^^^- enable.

Thanks and regenerated the patch :)


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

diff -r 6301ebc85480 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c     Fri Oct 23 10:07:22 2009 +0100
+++ b/drivers/pci/msi-xen.c     Tue Nov 17 08:16:42 2009 +0800
@@ -673,6 +673,12 @@
        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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel