Thread (10 messages) flat view 10 messages, 4 authors, 2016-02-18

Re: [PATCH net V1 4/6] net/mlx4_core: Do not BUG_ON during reset when PCI is offline

From: Sergei Shtylyov <hidden>
Date: 2016-02-18 12:45:42

Hello.

On 2/17/2016 6:24 PM, Or Gerlitz wrote:
quoted hunk ↗ jump to hunk
From: Daniel Jurgens <redacted>

The PCI channel could go offline during reset due to EEH.  Don't bug on in
this case, the error is recoverable.

Fixes: f6bc11e42646 ('net/mlx4_core: Enhance the catas flow to support device reset')
Signed-off-by: Daniel Jurgens <redacted>
Reviewed-by: Yishai Hadas <redacted>
---
  drivers/net/ethernet/mellanox/mlx4/catas.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/catas.c b/drivers/net/ethernet/mellanox/mlx4/catas.c
index 715de8a..c7e9399 100644
--- a/drivers/net/ethernet/mellanox/mlx4/catas.c
+++ b/drivers/net/ethernet/mellanox/mlx4/catas.c
@@ -182,10 +182,17 @@ void mlx4_enter_error_state(struct mlx4_dev_persistent *persist)
  		err = mlx4_reset_slave(dev);
  	else
  		err = mlx4_reset_master(dev);
-	BUG_ON(err != 0);

+	if (!err) {
    Grr, couldn't you add your new code just *instead* of BUG_ON()? There's 
really no need for empty line before the *if*.
+		mlx4_err(dev, "device was reset successfully\n");
+	} else {
+		/* EEH could have disabled the PCI channel during reset. That's
+		 * recoverable and the PCI error flow will handle it.
+		 */
+		if (!pci_channel_offline(dev->persist->pdev))
+			BUG_ON(1);
+	}
  	dev->persist->state |= MLX4_DEVICE_STATE_INTERNAL_ERROR;
-	mlx4_err(dev, "device was reset successfully\n");
  	mutex_unlock(&persist->device_state_mutex);

  	/* At that step HW was already reset, now notify clients */
MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help