mlxsw: core: Trace EMAD errors
authorNir Dotan <nird@mellanox.com>
Mon, 4 Feb 2019 18:47:46 +0000 (18:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Feb 2019 19:05:57 +0000 (11:05 -0800)
Trace EMAD errors returned from HW.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c

index ddedf8ab5b645e0255942d849065a4b5fea752aa..4f6fa515394eeff30245df0572af188636f39adb 100644 (file)
@@ -1460,13 +1460,17 @@ static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
        if (trans->retries)
                dev_warn(mlxsw_core->bus_info->dev, "EMAD retries (%d/%d) (tid=%llx)\n",
                         trans->retries, MLXSW_EMAD_MAX_RETRY, trans->tid);
-       if (err)
+       if (err) {
                dev_err(mlxsw_core->bus_info->dev, "EMAD reg access failed (tid=%llx,reg_id=%x(%s),type=%s,status=%x(%s))\n",
                        trans->tid, trans->reg->id,
                        mlxsw_reg_id_str(trans->reg->id),
                        mlxsw_core_reg_access_type_str(trans->type),
                        trans->emad_status,
                        mlxsw_emad_op_tlv_status_str(trans->emad_status));
+               trace_devlink_hwerr(priv_to_devlink(mlxsw_core),
+                                   trans->emad_status,
+                                   mlxsw_emad_op_tlv_status_str(trans->emad_status));
+       }
 
        list_del(&trans->bulk_list);
        kfree_rcu(trans, rcu);