From b581401ed0cc83a4483ed39c00a14a60bacecc3a Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Thu, 7 Jun 2007 11:51:58 -0700 Subject: 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 --- drivers/net/mlx4/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/mlx4/main.c') 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, dev = &priv->dev; dev->pdev = pdev; + INIT_LIST_HEAD(&priv->ctx_list); + spin_lock_init(&priv->ctx_lock); /* * Now reset the HCA before we touch the PCI capabilities or -- cgit v1.2.1