[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.