diff options
author | Roland Dreier <rolandd@cisco.com> | 2007-06-07 14:51:58 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-06-07 14:51:58 -0400 |
commit | b581401ed0cc83a4483ed39c00a14a60bacecc3a (patch) | |
tree | fa83991f1f429c0bf9876856d5255cf4a8be79fe /drivers | |
parent | 09360d5408cb641abff0f32a172a3332f02e8e88 (diff) |
mlx4_core: Initialize ctx_list and ctx_lock earlier
We may call mlx4_dispatch_event() before mlx4_register_device() is
called for a device, because for example a catastrophic error happens
immediately after we enable interrupts. Therefore priv->ctx_list and
priv->ctx_lock need to be initialized earlier.
This bug was actually exposed by the MSI-X bug that returned IRQ numbers
to drivers in reverse order, so that the first FW command
interrupt looked to mlx4 like a catastrophic error.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/mlx4/intf.c | 3 | ||||
-rw-r--r-- | drivers/net/mlx4/main.c | 2 |
2 files changed, 2 insertions, 3 deletions
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 |