aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/cq.c2
-rw-r--r--drivers/net/mlx4/eq.c4
-rw-r--r--drivers/net/mlx4/fw.c27
-rw-r--r--drivers/net/mlx4/intf.c3
-rw-r--r--drivers/net/mlx4/main.c2
-rw-r--r--drivers/net/mlx4/mr.c8
6 files changed, 35 insertions, 11 deletions
diff --git a/drivers/net/mlx4/cq.c b/drivers/net/mlx4/cq.c
index 437d78ad0912..39253d0c1590 100644
--- a/drivers/net/mlx4/cq.c
+++ b/drivers/net/mlx4/cq.c
@@ -61,7 +61,7 @@ struct mlx4_cq_context {
61 __be32 solicit_producer_index; 61 __be32 solicit_producer_index;
62 __be32 consumer_index; 62 __be32 consumer_index;
63 __be32 producer_index; 63 __be32 producer_index;
64 u8 reserved6[2]; 64 u32 reserved6[2];
65 __be64 db_rec_addr; 65 __be64 db_rec_addr;
66}; 66};
67 67
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index 0f11adb8eb4a..27a82cecd693 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -490,9 +490,11 @@ static void mlx4_free_irqs(struct mlx4_dev *dev)
490 490
491 if (eq_table->have_irq) 491 if (eq_table->have_irq)
492 free_irq(dev->pdev->irq, dev); 492 free_irq(dev->pdev->irq, dev);
493 for (i = 0; i < MLX4_NUM_EQ; ++i) 493 for (i = 0; i < MLX4_EQ_CATAS; ++i)
494 if (eq_table->eq[i].have_irq) 494 if (eq_table->eq[i].have_irq)
495 free_irq(eq_table->eq[i].irq, eq_table->eq + i); 495 free_irq(eq_table->eq[i].irq, eq_table->eq + i);
496 if (eq_table->eq[MLX4_EQ_CATAS].have_irq)
497 free_irq(eq_table->eq[MLX4_EQ_CATAS].irq, dev);
496} 498}
497 499
498static int __devinit mlx4_map_clr_int(struct mlx4_dev *dev) 500static int __devinit mlx4_map_clr_int(struct mlx4_dev *dev)
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index cfa5cc072339..e7ca118c8dfd 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -37,6 +37,10 @@
37#include "fw.h" 37#include "fw.h"
38#include "icm.h" 38#include "icm.h"
39 39
40enum {
41 MLX4_COMMAND_INTERFACE_REV = 1
42};
43
40extern void __buggy_use_of_MLX4_GET(void); 44extern void __buggy_use_of_MLX4_GET(void);
41extern void __buggy_use_of_MLX4_PUT(void); 45extern void __buggy_use_of_MLX4_PUT(void);
42 46
@@ -452,10 +456,12 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev)
452 u32 *outbox; 456 u32 *outbox;
453 int err = 0; 457 int err = 0;
454 u64 fw_ver; 458 u64 fw_ver;
459 u16 cmd_if_rev;
455 u8 lg; 460 u8 lg;
456 461
457#define QUERY_FW_OUT_SIZE 0x100 462#define QUERY_FW_OUT_SIZE 0x100
458#define QUERY_FW_VER_OFFSET 0x00 463#define QUERY_FW_VER_OFFSET 0x00
464#define QUERY_FW_CMD_IF_REV_OFFSET 0x0a
459#define QUERY_FW_MAX_CMD_OFFSET 0x0f 465#define QUERY_FW_MAX_CMD_OFFSET 0x0f
460#define QUERY_FW_ERR_START_OFFSET 0x30 466#define QUERY_FW_ERR_START_OFFSET 0x30
461#define QUERY_FW_ERR_SIZE_OFFSET 0x38 467#define QUERY_FW_ERR_SIZE_OFFSET 0x38
@@ -477,21 +483,36 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev)
477 483
478 MLX4_GET(fw_ver, outbox, QUERY_FW_VER_OFFSET); 484 MLX4_GET(fw_ver, outbox, QUERY_FW_VER_OFFSET);
479 /* 485 /*
480 * FW subminor version is at more signifant bits than minor 486 * FW subminor version is at more significant bits than minor
481 * version, so swap here. 487 * version, so swap here.
482 */ 488 */
483 dev->caps.fw_ver = (fw_ver & 0xffff00000000ull) | 489 dev->caps.fw_ver = (fw_ver & 0xffff00000000ull) |
484 ((fw_ver & 0xffff0000ull) >> 16) | 490 ((fw_ver & 0xffff0000ull) >> 16) |
485 ((fw_ver & 0x0000ffffull) << 16); 491 ((fw_ver & 0x0000ffffull) << 16);
486 492
493 MLX4_GET(cmd_if_rev, outbox, QUERY_FW_CMD_IF_REV_OFFSET);
494 if (cmd_if_rev != MLX4_COMMAND_INTERFACE_REV) {
495 mlx4_err(dev, "Installed FW has unsupported "
496 "command interface revision %d.\n",
497 cmd_if_rev);
498 mlx4_err(dev, "(Installed FW version is %d.%d.%03d)\n",
499 (int) (dev->caps.fw_ver >> 32),
500 (int) (dev->caps.fw_ver >> 16) & 0xffff,
501 (int) dev->caps.fw_ver & 0xffff);
502 mlx4_err(dev, "This driver version supports only revision %d.\n",
503 MLX4_COMMAND_INTERFACE_REV);
504 err = -ENODEV;
505 goto out;
506 }
507
487 MLX4_GET(lg, outbox, QUERY_FW_MAX_CMD_OFFSET); 508 MLX4_GET(lg, outbox, QUERY_FW_MAX_CMD_OFFSET);
488 cmd->max_cmds = 1 << lg; 509 cmd->max_cmds = 1 << lg;
489 510
490 mlx4_dbg(dev, "FW version %d.%d.%03d, max commands %d\n", 511 mlx4_dbg(dev, "FW version %d.%d.%03d (cmd intf rev %d), max commands %d\n",
491 (int) (dev->caps.fw_ver >> 32), 512 (int) (dev->caps.fw_ver >> 32),
492 (int) (dev->caps.fw_ver >> 16) & 0xffff, 513 (int) (dev->caps.fw_ver >> 16) & 0xffff,
493 (int) dev->caps.fw_ver & 0xffff, 514 (int) dev->caps.fw_ver & 0xffff,
494 cmd->max_cmds); 515 cmd_if_rev, cmd->max_cmds);
495 516
496 MLX4_GET(fw->catas_offset, outbox, QUERY_FW_ERR_START_OFFSET); 517 MLX4_GET(fw->catas_offset, outbox, QUERY_FW_ERR_START_OFFSET);
497 MLX4_GET(fw->catas_size, outbox, QUERY_FW_ERR_SIZE_OFFSET); 518 MLX4_GET(fw->catas_size, outbox, QUERY_FW_ERR_SIZE_OFFSET);
diff --git a/drivers/net/mlx4/intf.c b/drivers/net/mlx4/intf.c
index 65854f9e9c76..9ae951bf6aa6 100644
--- a/drivers/net/mlx4/intf.c
+++ b/drivers/net/mlx4/intf.c
@@ -135,9 +135,6 @@ int mlx4_register_device(struct mlx4_dev *dev)
135 struct mlx4_priv *priv = mlx4_priv(dev); 135 struct mlx4_priv *priv = mlx4_priv(dev);
136 struct mlx4_interface *intf; 136 struct mlx4_interface *intf;
137 137
138 INIT_LIST_HEAD(&priv->ctx_list);
139 spin_lock_init(&priv->ctx_lock);
140
141 mutex_lock(&intf_mutex); 138 mutex_lock(&intf_mutex);
142 139
143 list_add_tail(&priv->dev_list, &dev_list); 140 list_add_tail(&priv->dev_list, &dev_list);
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 20b8c0d3ced4..d4172937025b 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -787,6 +787,8 @@ static int __devinit mlx4_init_one(struct pci_dev *pdev,
787 787
788 dev = &priv->dev; 788 dev = &priv->dev;
789 dev->pdev = pdev; 789 dev->pdev = pdev;
790 INIT_LIST_HEAD(&priv->ctx_list);
791 spin_lock_init(&priv->ctx_lock);
790 792
791 /* 793 /*
792 * Now reset the HCA before we touch the PCI capabilities or 794 * Now reset the HCA before we touch the PCI capabilities or
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c
index b33864dab179..d0808fa3ec82 100644
--- a/drivers/net/mlx4/mr.c
+++ b/drivers/net/mlx4/mr.c
@@ -324,15 +324,17 @@ int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr)
324 MLX4_MPT_FLAG_MIO | 324 MLX4_MPT_FLAG_MIO |
325 MLX4_MPT_FLAG_REGION | 325 MLX4_MPT_FLAG_REGION |
326 mr->access); 326 mr->access);
327 if (mr->mtt.order < 0)
328 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
329 327
330 mpt_entry->key = cpu_to_be32(key_to_hw_index(mr->key)); 328 mpt_entry->key = cpu_to_be32(key_to_hw_index(mr->key));
331 mpt_entry->pd = cpu_to_be32(mr->pd); 329 mpt_entry->pd = cpu_to_be32(mr->pd);
332 mpt_entry->start = cpu_to_be64(mr->iova); 330 mpt_entry->start = cpu_to_be64(mr->iova);
333 mpt_entry->length = cpu_to_be64(mr->size); 331 mpt_entry->length = cpu_to_be64(mr->size);
334 mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); 332 mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
335 mpt_entry->mtt_seg = cpu_to_be64(mlx4_mtt_addr(dev, &mr->mtt)); 333 if (mr->mtt.order < 0) {
334 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
335 mpt_entry->mtt_seg = 0;
336 } else
337 mpt_entry->mtt_seg = cpu_to_be64(mlx4_mtt_addr(dev, &mr->mtt));
336 338
337 err = mlx4_SW2HW_MPT(dev, mailbox, 339 err = mlx4_SW2HW_MPT(dev, mailbox,
338 key_to_hw_index(mr->key) & (dev->caps.num_mpts - 1)); 340 key_to_hw_index(mr->key) & (dev->caps.num_mpts - 1));