linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / pci / msi.c
index d4c89d7..48723d6 100644 (file)
 #include <asm/io.h>
 #include <asm/smp.h>
 
+#include "pci.h"
 #include "msi.h"
 
-static spinlock_t msi_lock = SPIN_LOCK_UNLOCKED;
+#define MSI_TARGET_CPU         first_cpu(cpu_online_map)
+
+static DEFINE_SPINLOCK(msi_lock);
 static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL };
 static kmem_cache_t* msi_cachep;
 
 static int pci_msi_enable = 1;
-static int last_alloc_vector = 0;
-static int nr_released_vectors = 0;
+static int last_alloc_vector;
+static int nr_released_vectors;
 static int nr_reserved_vectors = NR_HP_RESERVED_VECTORS;
-static int nr_msix_devices = 0;
+static int nr_msix_devices;
 
 #ifndef CONFIG_X86_IO_APIC
 int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
@@ -66,7 +69,7 @@ static void msi_set_mask_bit(unsigned int vector, int flag)
                int             pos;
                u32             mask_bits;
 
-               pos = entry->mask_base;
+               pos = (long)entry->mask_base;
                pci_read_config_dword(entry->dev, pos, &mask_bits);
                mask_bits &= ~(1);
                mask_bits |= flag;
@@ -90,6 +93,8 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask)
 {
        struct msi_desc *entry;
        struct msg_address address;
+       unsigned int irq = vector;
+       unsigned int dest_cpu = first_cpu(cpu_mask);
 
        entry = (struct msi_desc *)msi_desc[vector];
        if (!entry || !entry->dev)
@@ -106,11 +111,12 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask)
                pci_read_config_dword(entry->dev, msi_lower_address_reg(pos),
                        &address.lo_address.value);
                address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK;
-               address.lo_address.value |= (cpu_mask_to_apicid(cpu_mask) <<
-                       MSI_TARGET_CPU_SHIFT);
-               entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask);
+               address.lo_address.value |= (cpu_physical_id(dest_cpu) <<
+                                                                       MSI_TARGET_CPU_SHIFT);
+               entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu);
                pci_write_config_dword(entry->dev, msi_lower_address_reg(pos),
                        address.lo_address.value);
+               set_native_irq_info(irq, cpu_mask);
                break;
        }
        case PCI_CAP_ID_MSIX:
@@ -120,26 +126,19 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask)
 
                address.lo_address.value = readl(entry->mask_base + offset);
                address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK;
-               address.lo_address.value |= (cpu_mask_to_apicid(cpu_mask) <<
-                       MSI_TARGET_CPU_SHIFT);
-               entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask);
+               address.lo_address.value |= (cpu_physical_id(dest_cpu) <<
+                                                                       MSI_TARGET_CPU_SHIFT);
+               entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu);
                writel(address.lo_address.value, entry->mask_base + offset);
+               set_native_irq_info(irq, cpu_mask);
                break;
        }
        default:
                break;
        }
 }
-
-#ifdef CONFIG_IRQBALANCE
-static inline void move_msi(int vector)
-{
-       if (!cpus_empty(pending_irq_balance_cpumask[vector])) {
-               set_msi_affinity(vector, pending_irq_balance_cpumask[vector]);
-               cpus_clear(pending_irq_balance_cpumask[vector]);
-       }
-}
-#endif /* CONFIG_IRQBALANCE */
+#else
+#define set_msi_affinity NULL
 #endif /* CONFIG_SMP */
 
 static void mask_MSI_irq(unsigned int vector)
@@ -169,52 +168,42 @@ static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector)
        return 0;       /* never anything pending */
 }
 
-static void release_msi(unsigned int vector);
-static void shutdown_msi_irq(unsigned int vector)
-{
-       release_msi(vector);
-}
-
-#define shutdown_msi_irq_wo_maskbit    shutdown_msi_irq
-static void enable_msi_irq_wo_maskbit(unsigned int vector) {}
-static void disable_msi_irq_wo_maskbit(unsigned int vector) {}
-static void ack_msi_irq_wo_maskbit(unsigned int vector) {}
-static void end_msi_irq_wo_maskbit(unsigned int vector)
+static unsigned int startup_msi_irq_w_maskbit(unsigned int vector)
 {
-       move_msi(vector);
-       ack_APIC_irq();
+       startup_msi_irq_wo_maskbit(vector);
+       unmask_MSI_irq(vector);
+       return 0;       /* never anything pending */
 }
 
-static unsigned int startup_msi_irq_w_maskbit(unsigned int vector)
+static void shutdown_msi_irq(unsigned int vector)
 {
        struct msi_desc *entry;
        unsigned long flags;
 
        spin_lock_irqsave(&msi_lock, flags);
        entry = msi_desc[vector];
-       if (!entry || !entry->dev) {
-               spin_unlock_irqrestore(&msi_lock, flags);
-               return 0;
-       }
-       entry->msi_attrib.state = 1;    /* Mark it active */
+       if (entry && entry->dev)
+               entry->msi_attrib.state = 0;    /* Mark it not active */
        spin_unlock_irqrestore(&msi_lock, flags);
-
-       unmask_MSI_irq(vector);
-       return 0;       /* never anything pending */
 }
 
-#define shutdown_msi_irq_w_maskbit     shutdown_msi_irq
-#define enable_msi_irq_w_maskbit       unmask_MSI_irq
-#define disable_msi_irq_w_maskbit      mask_MSI_irq
-#define ack_msi_irq_w_maskbit          mask_MSI_irq
+static void end_msi_irq_wo_maskbit(unsigned int vector)
+{
+       move_native_irq(vector);
+       ack_APIC_irq();
+}
 
 static void end_msi_irq_w_maskbit(unsigned int vector)
 {
-       move_msi(vector);
+       move_native_irq(vector);
        unmask_MSI_irq(vector);
        ack_APIC_irq();
 }
 
+static void do_nothing(unsigned int vector)
+{
+}
+
 /*
  * Interrupt Type for MSI-X PCI/PCI-X/PCI-Express Devices,
  * which implement the MSI-X Capability Structure.
@@ -222,12 +211,12 @@ static void end_msi_irq_w_maskbit(unsigned int vector)
 static struct hw_interrupt_type msix_irq_type = {
        .typename       = "PCI-MSI-X",
        .startup        = startup_msi_irq_w_maskbit,
-       .shutdown       = shutdown_msi_irq_w_maskbit,
-       .enable         = enable_msi_irq_w_maskbit,
-       .disable        = disable_msi_irq_w_maskbit,
-       .ack            = ack_msi_irq_w_maskbit,
+       .shutdown       = shutdown_msi_irq,
+       .enable         = unmask_MSI_irq,
+       .disable        = mask_MSI_irq,
+       .ack            = mask_MSI_irq,
        .end            = end_msi_irq_w_maskbit,
-       .set_affinity   = set_msi_irq_affinity
+       .set_affinity   = set_msi_affinity
 };
 
 /*
@@ -238,12 +227,12 @@ static struct hw_interrupt_type msix_irq_type = {
 static struct hw_interrupt_type msi_irq_w_maskbit_type = {
        .typename       = "PCI-MSI",
        .startup        = startup_msi_irq_w_maskbit,
-       .shutdown       = shutdown_msi_irq_w_maskbit,
-       .enable         = enable_msi_irq_w_maskbit,
-       .disable        = disable_msi_irq_w_maskbit,
-       .ack            = ack_msi_irq_w_maskbit,
+       .shutdown       = shutdown_msi_irq,
+       .enable         = unmask_MSI_irq,
+       .disable        = mask_MSI_irq,
+       .ack            = mask_MSI_irq,
        .end            = end_msi_irq_w_maskbit,
-       .set_affinity   = set_msi_irq_affinity
+       .set_affinity   = set_msi_affinity
 };
 
 /*
@@ -254,12 +243,12 @@ static struct hw_interrupt_type msi_irq_w_maskbit_type = {
 static struct hw_interrupt_type msi_irq_wo_maskbit_type = {
        .typename       = "PCI-MSI",
        .startup        = startup_msi_irq_wo_maskbit,
-       .shutdown       = shutdown_msi_irq_wo_maskbit,
-       .enable         = enable_msi_irq_wo_maskbit,
-       .disable        = disable_msi_irq_wo_maskbit,
-       .ack            = ack_msi_irq_wo_maskbit,
+       .shutdown       = shutdown_msi_irq,
+       .enable         = do_nothing,
+       .disable        = do_nothing,
+       .ack            = do_nothing,
        .end            = end_msi_irq_wo_maskbit,
-       .set_affinity   = set_msi_irq_affinity
+       .set_affinity   = set_msi_affinity
 };
 
 static void msi_data_init(struct msg_data *msi_data,
@@ -275,14 +264,15 @@ static void msi_data_init(struct msg_data *msi_data,
 static void msi_address_init(struct msg_address *msi_address)
 {
        unsigned int    dest_id;
+       unsigned long   dest_phys_id = cpu_physical_id(MSI_TARGET_CPU);
 
        memset(msi_address, 0, sizeof(struct msg_address));
        msi_address->hi_address = (u32)0;
        dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT);
-       msi_address->lo_address.u.dest_mode = MSI_DEST_MODE;
+       msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE;
        msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE;
        msi_address->lo_address.u.dest_id = dest_id;
-       msi_address->lo_address.value |= (MSI_TARGET_CPU << MSI_TARGET_CPU_SHIFT);
+       msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT);
 }
 
 static int msi_free_vector(struct pci_dev* dev, int vector, int reassign);
@@ -372,21 +362,27 @@ static int msi_init(void)
        if (!status)
                return status;
 
+       if (pci_msi_quirk) {
+               pci_msi_enable = 0;
+               printk(KERN_WARNING "PCI: MSI quirk detected. MSI disabled.\n");
+               status = -EINVAL;
+               return status;
+       }
+
        if ((status = msi_cache_init()) < 0) {
                pci_msi_enable = 0;
-               printk(KERN_INFO "WARNING: MSI INIT FAILURE\n");
+               printk(KERN_WARNING "PCI: MSI cache init failed\n");
                return status;
        }
        last_alloc_vector = assign_irq_vector(AUTO_ASSIGN);
        if (last_alloc_vector < 0) {
                pci_msi_enable = 0;
-               printk(KERN_INFO "WARNING: ALL VECTORS ARE BUSY\n");
+               printk(KERN_WARNING "PCI: No interrupt vectors available for MSI\n");
                status = -EBUSY;
                return status;
        }
        vector_irq[last_alloc_vector] = 0;
        nr_released_vectors++;
-       printk(KERN_INFO "MSI INIT SUCCESS\n");
 
        return status;
 }
@@ -400,7 +396,7 @@ static struct msi_desc* alloc_msi_entry(void)
 {
        struct msi_desc *entry;
 
-       entry = (struct msi_desc*) kmem_cache_alloc(msi_cachep, SLAB_KERNEL);
+       entry = kmem_cache_alloc(msi_cachep, SLAB_KERNEL);
        if (!entry)
                return NULL;
 
@@ -422,7 +418,9 @@ static void attach_msi_entry(struct msi_desc *entry, int vector)
 
 static void irq_handler_init(int cap_id, int pos, int mask)
 {
-       spin_lock(&irq_desc[pos].lock);
+       unsigned long flags;
+
+       spin_lock_irqsave(&irq_desc[pos].lock, flags);
        if (cap_id == PCI_CAP_ID_MSIX)
                irq_desc[pos].handler = &msix_irq_type;
        else {
@@ -431,7 +429,7 @@ static void irq_handler_init(int cap_id, int pos, int mask)
                else
                        irq_desc[pos].handler = &msi_irq_w_maskbit_type;
        }
-       spin_unlock(&irq_desc[pos].lock);
+       spin_unlock_irqrestore(&irq_desc[pos].lock, flags);
 }
 
 static void enable_msi_mode(struct pci_dev *dev, int pos, int type)
@@ -449,14 +447,11 @@ static void enable_msi_mode(struct pci_dev *dev, int pos, int type)
        }
        if (pci_find_capability(dev, PCI_CAP_ID_EXP)) {
                /* PCI Express Endpoint device detected */
-               u16 cmd;
-               pci_read_config_word(dev, PCI_COMMAND, &cmd);
-               cmd |= PCI_COMMAND_INTX_DISABLE;
-               pci_write_config_word(dev, PCI_COMMAND, cmd);
+               pci_intx(dev, 0);  /* disable intx */
        }
 }
 
-static void disable_msi_mode(struct pci_dev *dev, int pos, int type)
+void disable_msi_mode(struct pci_dev *dev, int pos, int type)
 {
        u16 control;
 
@@ -471,10 +466,7 @@ static void disable_msi_mode(struct pci_dev *dev, int pos, int type)
        }
        if (pci_find_capability(dev, PCI_CAP_ID_EXP)) {
                /* PCI Express Endpoint device detected */
-               u16 cmd;
-               pci_read_config_word(dev, PCI_COMMAND, &cmd);
-               cmd &= ~PCI_COMMAND_INTX_DISABLE;
-               pci_write_config_word(dev, PCI_COMMAND, cmd);
+               pci_intx(dev, 1);  /* enable intx */
        }
 }
 
@@ -515,7 +507,7 @@ void pci_scan_msi_device(struct pci_dev *dev)
  * msi_capability_init - configure device's MSI capability structure
  * @dev: pointer to the pci_dev data structure of MSI device function
  *
- * Setup the MSI capability structure of device funtion with a single
+ * Setup the MSI capability structure of device function with a single
  * MSI vector, regardless of device function is capable of handling
  * multiple messages. A return of zero indicates the successful setup
  * of an entry zero with the new MSI vector or non-zero for otherwise.
@@ -548,7 +540,7 @@ static int msi_capability_init(struct pci_dev *dev)
        dev->irq = vector;
        entry->dev = dev;
        if (is_mask_bit_support(control)) {
-               entry->mask_base = msi_mask_bits_reg(pos,
+               entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos,
                                is_64bit_address(control));
        }
        /* Replace with MSI handler */
@@ -591,8 +583,10 @@ static int msi_capability_init(struct pci_dev *dev)
 /**
  * msix_capability_init - configure device's MSI-X capability
  * @dev: pointer to the pci_dev data structure of MSI-X device function
+ * @entries: pointer to an array of struct msix_entry entries
+ * @nvec: number of @entries
  *
- * Setup the MSI-X capability structure of device funtion with a
+ * Setup the MSI-X capability structure of device function with a
  * single MSI-X vector. A return of zero indicates the successful setup of
  * requested MSI-X entries with allocated vectors or non-zero for otherwise.
  **/
@@ -606,7 +600,7 @@ static int msix_capability_init(struct pci_dev *dev,
        u32 phys_addr, table_offset;
        u16 control;
        u8 bir;
-       void *base;
+       void __iomem *base;
 
        pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
        /* Request & Map MSI-X table region */
@@ -617,15 +611,10 @@ static int msix_capability_init(struct pci_dev *dev,
        bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
        phys_addr = pci_resource_start (dev, bir);
        phys_addr += (u32)(table_offset & ~PCI_MSIX_FLAGS_BIRMASK);
-       if (!request_mem_region(phys_addr,
-               nr_entries * PCI_MSIX_ENTRY_SIZE,
-               "MSI-X vector table"))
-               return -ENOMEM;
        base = ioremap_nocache(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
-       if (base == NULL) {
-               release_mem_region(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
+       if (base == NULL)
                return -ENOMEM;
-       }
+
        /* MSI-X Table Initialization */
        for (i = 0; i < nvec; i++) {
                entry = alloc_msi_entry();
@@ -642,7 +631,7 @@ static int msix_capability_init(struct pci_dev *dev,
                entry->msi_attrib.maskbit = 1;
                entry->msi_attrib.default_vector = dev->irq;
                entry->dev = dev;
-               entry->mask_base = (unsigned long)base;
+               entry->mask_base = base;
                if (!head) {
                        entry->link.head = vector;
                        entry->link.tail = vector;
@@ -701,12 +690,17 @@ static int msix_capability_init(struct pci_dev *dev,
  **/
 int pci_enable_msi(struct pci_dev* dev)
 {
-       int pos, temp = dev->irq, status = -EINVAL;
+       int pos, temp, status = -EINVAL;
        u16 control;
 
        if (!pci_msi_enable || !dev)
                return status;
 
+       if (dev->no_msi)
+               return status;
+
+       temp = dev->irq;
+
        if ((status = msi_init()) < 0)
                return status;
 
@@ -736,7 +730,9 @@ int pci_enable_msi(struct pci_dev* dev)
        /* Check whether driver already requested for MSI-X vectors */
        if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 &&
                !msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
-                       printk(KERN_INFO "Can't enable MSI. Device already had MSI-X vectors assigned\n");
+                       printk(KERN_INFO "PCI: %s: Can't enable MSI.  "
+                              "Device already has MSI-X vectors assigned\n",
+                              pci_name(dev));
                        dev->irq = temp;
                        return -EINVAL;
        }
@@ -774,9 +770,9 @@ void pci_disable_msi(struct pci_dev* dev)
        }
        if (entry->msi_attrib.state) {
                spin_unlock_irqrestore(&msi_lock, flags);
-               printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n",
-               dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn),
-               dev->irq);
+               printk(KERN_WARNING "PCI: %s: pci_disable_msi() called without "
+                      "free_irq() on MSI vector %d\n",
+                      pci_name(dev), dev->irq);
                BUG_ON(entry->msi_attrib.state > 0);
        } else {
                vector_irq[dev->irq] = 0; /* free it */
@@ -790,23 +786,11 @@ void pci_disable_msi(struct pci_dev* dev)
        }
 }
 
-static void release_msi(unsigned int vector)
-{
-       struct msi_desc *entry;
-       unsigned long flags;
-
-       spin_lock_irqsave(&msi_lock, flags);
-       entry = msi_desc[vector];
-       if (entry && entry->dev)
-               entry->msi_attrib.state = 0;    /* Mark it not active */
-       spin_unlock_irqrestore(&msi_lock, flags);
-}
-
 static int msi_free_vector(struct pci_dev* dev, int vector, int reassign)
 {
        struct msi_desc *entry;
        int head, entry_nr, type;
-       unsigned long base = 0L;
+       void __iomem *base;
        unsigned long flags;
 
        spin_lock_irqsave(&msi_lock, flags);
@@ -857,9 +841,7 @@ static int msi_free_vector(struct pci_dev* dev, int vector, int reassign)
                        phys_addr = pci_resource_start (dev, bir);
                        phys_addr += (u32)(table_offset &
                                ~PCI_MSIX_FLAGS_BIRMASK);
-                       iounmap((void*)base);
-                       release_mem_region(phys_addr,
-                               nr_entries * PCI_MSIX_ENTRY_SIZE);
+                       iounmap(base);
                }
        }
 
@@ -869,8 +851,8 @@ static int msi_free_vector(struct pci_dev* dev, int vector, int reassign)
 static int reroute_msix_table(int head, struct msix_entry *entries, int *nvec)
 {
        int vector = head, tail = 0;
-       int i = 0, j = 0, nr_entries = 0;
-       unsigned long base = 0L;
+       int i, j = 0, nr_entries = 0;
+       void __iomem *base;
        unsigned long flags;
 
        spin_lock_irqsave(&msi_lock, flags);
@@ -920,7 +902,7 @@ static int reroute_msix_table(int head, struct msix_entry *entries, int *nvec)
 /**
  * pci_enable_msix - configure device's MSI-X capability structure
  * @dev: pointer to the pci_dev data structure of MSI-X device function
- * @data: pointer to an array of MSI-X entries
+ * @entries: pointer to an array of MSI-X entries
  * @nvec: number of MSI-X vectors requested for allocation by device driver
  *
  * Setup the MSI-X capability structure of device function with the number
@@ -982,7 +964,9 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
        /* Check whether driver already requested for MSI vector */
        if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0 &&
                !msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
-               printk(KERN_INFO "Can't enable MSI-X. Device already had MSI vector assigned\n");
+               printk(KERN_INFO "PCI: %s: Can't enable MSI-X.  "
+                      "Device already has an MSI vector assigned\n",
+                      pci_name(dev));
                dev->irq = temp;
                return -EINVAL;
        }
@@ -1050,9 +1034,9 @@ void pci_disable_msix(struct pci_dev* dev)
                spin_unlock_irqrestore(&msi_lock, flags);
                if (warning) {
                        dev->irq = temp;
-                       printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n",
-                       dev->bus->number, PCI_SLOT(dev->devfn),
-                       PCI_FUNC(dev->devfn));
+                       printk(KERN_WARNING "PCI: %s: pci_disable_msix() called without "
+                              "free_irq() on all MSI-X vectors\n",
+                              pci_name(dev));
                        BUG_ON(warning > 0);
                } else {
                        dev->irq = temp;
@@ -1068,7 +1052,7 @@ void pci_disable_msix(struct pci_dev* dev)
  * msi_remove_pci_irq_vectors - reclaim MSI(X) vectors to unused state
  * @dev: pointer to the pci_dev data structure of MSI(X) device function
  *
- * Being called during hotplug remove, from which the device funciton
+ * Being called during hotplug remove, from which the device function
  * is hot-removed. All previous assigned MSI/MSI-X vectors, if
  * allocated for this device function, are reclaimed to unused state,
  * which may be used later on.
@@ -1088,9 +1072,9 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
                state = msi_desc[dev->irq]->msi_attrib.state;
                spin_unlock_irqrestore(&msi_lock, flags);
                if (state) {
-                       printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n",
-                       dev->bus->number, PCI_SLOT(dev->devfn),
-                       PCI_FUNC(dev->devfn), dev->irq);
+                       printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
+                              "called without free_irq() on MSI vector %d\n",
+                              pci_name(dev), dev->irq);
                        BUG_ON(state > 0);
                } else /* Release MSI vector assigned to this device */
                        msi_free_vector(dev, dev->irq, 0);
@@ -1099,7 +1083,7 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
        if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 &&
                !msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
                int vector, head, tail = 0, warning = 0;
-               unsigned long base = 0L;
+               void __iomem *base = NULL;
 
                vector = head = dev->irq;
                while (head != tail) {
@@ -1129,12 +1113,10 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
                        phys_addr = pci_resource_start (dev, bir);
                        phys_addr += (u32)(table_offset &
                                ~PCI_MSIX_FLAGS_BIRMASK);
-                       iounmap((void*)base);
-                       release_mem_region(phys_addr, PCI_MSIX_ENTRY_SIZE *
-                               multi_msix_capable(control));
-                       printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n",
-                               dev->bus->number, PCI_SLOT(dev->devfn),
-                               PCI_FUNC(dev->devfn));
+                       iounmap(base);
+                       printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
+                              "called without free_irq() on all MSI-X vectors\n",
+                              pci_name(dev));
                        BUG_ON(warning > 0);
                }
                dev->irq = temp;                /* Restore IOAPIC IRQ */