Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67093
b: refs/heads/master
c: 08fb105
h: refs/heads/master
i:
  67091: dbb2968
v: v3
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Oct 10, 2007
1 parent fd3c772 commit 914c920
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a68bbe31d51cc75d2acf1c9f5ceff91f7662ea4
refs/heads/master: 08fb105540f4649eaa25270ec3ada1d35406afcc
34 changes: 22 additions & 12 deletions trunk/drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0");

#ifdef CONFIG_PCI_MSI

static int msi_x;
static int msi_x = 1;
module_param(msi_x, int, 0444);
MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");

Expand Down Expand Up @@ -599,13 +599,17 @@ static int __devinit mlx4_setup_hca(struct mlx4_dev *dev)

err = mlx4_NOP(dev);
if (err) {
mlx4_err(dev, "NOP command failed to generate interrupt "
"(IRQ %d), aborting.\n",
priv->eq_table.eq[MLX4_EQ_ASYNC].irq);
if (dev->flags & MLX4_FLAG_MSI_X)
mlx4_err(dev, "Try again with MSI-X disabled.\n");
else
if (dev->flags & MLX4_FLAG_MSI_X) {
mlx4_warn(dev, "NOP command failed to generate MSI-X "
"interrupt IRQ %d).\n",
priv->eq_table.eq[MLX4_EQ_ASYNC].irq);
mlx4_warn(dev, "Trying again without MSI-X.\n");
} else {
mlx4_err(dev, "NOP command failed to generate interrupt "
"(IRQ %d), aborting.\n",
priv->eq_table.eq[MLX4_EQ_ASYNC].irq);
mlx4_err(dev, "BIOS or ACPI interrupt routing problem?\n");
}

goto err_cmd_poll;
}
Expand Down Expand Up @@ -803,8 +807,6 @@ static int __devinit mlx4_init_one(struct pci_dev *pdev,
goto err_free_dev;
}

mlx4_enable_msi_x(dev);

if (mlx4_cmd_init(dev)) {
mlx4_err(dev, "Failed to init command interface, aborting.\n");
goto err_free_dev;
Expand All @@ -814,7 +816,15 @@ static int __devinit mlx4_init_one(struct pci_dev *pdev,
if (err)
goto err_cmd;

mlx4_enable_msi_x(dev);

err = mlx4_setup_hca(dev);
if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X)) {
dev->flags &= ~MLX4_FLAG_MSI_X;
pci_disable_msix(pdev);
err = mlx4_setup_hca(dev);
}

if (err)
goto err_close;

Expand All @@ -838,15 +848,15 @@ static int __devinit mlx4_init_one(struct pci_dev *pdev,
mlx4_cleanup_uar_table(dev);

err_close:
if (dev->flags & MLX4_FLAG_MSI_X)
pci_disable_msix(pdev);

mlx4_close_hca(dev);

err_cmd:
mlx4_cmd_cleanup(dev);

err_free_dev:
if (dev->flags & MLX4_FLAG_MSI_X)
pci_disable_msix(pdev);

kfree(priv);

err_release_bar2:
Expand Down

0 comments on commit 914c920

Please sign in to comment.