]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/mthca/mthca_main.c
IB/mthca: Update QP state if query QP succeeds
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / mthca / mthca_main.c
index 60de6f93869e7487fa91696950507b82e22b4267..9ebadd6e0cfba4046e4dc7309aeaf4033cc0e18f 100644 (file)
@@ -65,14 +65,9 @@ static int msi_x = 1;
 module_param(msi_x, int, 0444);
 MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");
 
-static int msi = 0;
-module_param(msi, int, 0444);
-MODULE_PARM_DESC(msi, "attempt to use MSI if nonzero (deprecated, use MSI-X instead)");
-
 #else /* CONFIG_PCI_MSI */
 
 #define msi_x (0)
-#define msi   (0)
 
 #endif /* CONFIG_PCI_MSI */
 
@@ -131,7 +126,7 @@ module_param_named(fmr_reserved_mtts, hca_profile.fmr_reserved_mtts, int, 0444);
 MODULE_PARM_DESC(fmr_reserved_mtts,
                 "number of memory translation table segments reserved for FMR");
 
-static const char mthca_version[] __devinitdata =
+static char mthca_version[] __devinitdata =
        DRV_NAME ": Mellanox InfiniBand HCA driver v"
        DRV_VERSION " (" DRV_RELDATE ")\n";
 
@@ -272,11 +267,16 @@ static int mthca_dev_lim(struct mthca_dev *mdev, struct mthca_dev_lim *dev_lim)
        if (dev_lim->flags & DEV_LIM_FLAG_SRQ)
                mdev->mthca_flags |= MTHCA_FLAG_SRQ;
 
+       if (mthca_is_memfree(mdev))
+               if (dev_lim->flags & DEV_LIM_FLAG_IPOIB_CSUM)
+                       mdev->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
+
        return 0;
 }
 
 static int mthca_init_tavor(struct mthca_dev *mdev)
 {
+       s64 size;
        u8 status;
        int err;
        struct mthca_dev_lim        dev_lim;
@@ -329,9 +329,11 @@ static int mthca_init_tavor(struct mthca_dev *mdev)
        if (mdev->mthca_flags & MTHCA_FLAG_SRQ)
                profile.num_srq = dev_lim.max_srqs;
 
-       err = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca);
-       if (err < 0)
+       size = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca);
+       if (size < 0) {
+               err = size;
                goto err_disable;
+       }
 
        err = mthca_INIT_HCA(mdev, &init_hca, &status);
        if (err) {
@@ -610,7 +612,7 @@ static int mthca_init_arbel(struct mthca_dev *mdev)
        struct mthca_dev_lim        dev_lim;
        struct mthca_profile        profile;
        struct mthca_init_hca_param init_hca;
-       u64 icm_size;
+       s64 icm_size;
        u8 status;
        int err;
 
@@ -658,7 +660,7 @@ static int mthca_init_arbel(struct mthca_dev *mdev)
                profile.num_srq = dev_lim.max_srqs;
 
        icm_size = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca);
-       if ((int) icm_size < 0) {
+       if (icm_size < 0) {
                err = icm_size;
                goto err_stop_fw;
        }
@@ -740,7 +742,8 @@ static int mthca_init_hca(struct mthca_dev *mdev)
        }
 
        mdev->eq_table.inta_pin = adapter.inta_pin;
-       mdev->rev_id            = adapter.revision_id;
+       if (!mthca_is_memfree(mdev))
+               mdev->rev_id = adapter.revision_id;
        memcpy(mdev->board_id, adapter.board_id, sizeof mdev->board_id);
 
        return 0;
@@ -816,13 +819,11 @@ static int mthca_setup_hca(struct mthca_dev *dev)
 
        err = mthca_NOP(dev, &status);
        if (err || status) {
-               if (dev->mthca_flags & (MTHCA_FLAG_MSI | MTHCA_FLAG_MSI_X)) {
+               if (dev->mthca_flags & MTHCA_FLAG_MSI_X) {
                        mthca_warn(dev, "NOP command failed to generate interrupt "
                                   "(IRQ %d).\n",
-                                  dev->mthca_flags & MTHCA_FLAG_MSI_X ?
-                                  dev->eq_table.eq[MTHCA_EQ_CMD].msi_x_vector :
-                                  dev->pdev->irq);
-                       mthca_warn(dev, "Trying again with MSI/MSI-X disabled.\n");
+                                  dev->eq_table.eq[MTHCA_EQ_CMD].msi_x_vector);
+                       mthca_warn(dev, "Trying again with MSI-X disabled.\n");
                } else {
                        mthca_err(dev, "NOP command failed to generate interrupt "
                                  "(IRQ %d), aborting.\n",
@@ -1005,7 +1006,7 @@ static struct {
                           .flags     = 0 },
        [ARBEL_COMPAT] = { .latest_fw = MTHCA_FW_VER(4, 8, 200),
                           .flags     = MTHCA_FLAG_PCIE },
-       [ARBEL_NATIVE] = { .latest_fw = MTHCA_FW_VER(5, 2, 0),
+       [ARBEL_NATIVE] = { .latest_fw = MTHCA_FW_VER(5, 3, 0),
                           .flags     = MTHCA_FLAG_MEMFREE |
                                        MTHCA_FLAG_PCIE },
        [SINAI]        = { .latest_fw = MTHCA_FW_VER(1, 2, 0),
@@ -1128,29 +1129,12 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type)
 
        if (msi_x && !mthca_enable_msi_x(mdev))
                mdev->mthca_flags |= MTHCA_FLAG_MSI_X;
-       else if (msi) {
-               static int warned;
-
-               if (!warned) {
-                       printk(KERN_WARNING PFX "WARNING: MSI support will be "
-                              "removed from the ib_mthca driver in January 2008.\n");
-                       printk(KERN_WARNING "    If you are using MSI and cannot "
-                              "switch to MSI-X, please tell "
-                              "<general@lists.openfabrics.org>.\n");
-                       ++warned;
-               }
-
-               if (!pci_enable_msi(pdev))
-                       mdev->mthca_flags |= MTHCA_FLAG_MSI;
-       }
 
        err = mthca_setup_hca(mdev);
-       if (err == -EBUSY && (mdev->mthca_flags & (MTHCA_FLAG_MSI | MTHCA_FLAG_MSI_X))) {
+       if (err == -EBUSY && (mdev->mthca_flags & MTHCA_FLAG_MSI_X)) {
                if (mdev->mthca_flags & MTHCA_FLAG_MSI_X)
                        pci_disable_msix(pdev);
-               if (mdev->mthca_flags & MTHCA_FLAG_MSI)
-                       pci_disable_msi(pdev);
-               mdev->mthca_flags &= ~(MTHCA_FLAG_MSI_X | MTHCA_FLAG_MSI);
+               mdev->mthca_flags &= ~MTHCA_FLAG_MSI_X;
 
                err = mthca_setup_hca(mdev);
        }
@@ -1192,8 +1176,6 @@ err_cleanup:
 err_close:
        if (mdev->mthca_flags & MTHCA_FLAG_MSI_X)
                pci_disable_msix(pdev);
-       if (mdev->mthca_flags & MTHCA_FLAG_MSI)
-               pci_disable_msi(pdev);
 
        mthca_close_hca(mdev);
 
@@ -1246,8 +1228,6 @@ static void __mthca_remove_one(struct pci_dev *pdev)
 
                if (mdev->mthca_flags & MTHCA_FLAG_MSI_X)
                        pci_disable_msix(pdev);
-               if (mdev->mthca_flags & MTHCA_FLAG_MSI)
-                       pci_disable_msi(pdev);
 
                ib_dealloc_device(&mdev->ib_dev);
                mthca_release_regions(pdev, mdev->mthca_flags &