Commit 2ec276d5 authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller

net: qed: invoke err notify on critical areas

In a number of critical places not only debug trace should be printed,
but the appropriate hw error condition should be raised and error
handling/recovery should start.

Introduce our new qed_hw_err_notify invocation in these places to
record and indicate critical error conditions in hardware.
Signed-off-by: default avatarAriel Elior <ariel.elior@marvell.com>
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8736ea8
...@@ -3085,7 +3085,9 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) ...@@ -3085,7 +3085,9 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
rc = qed_final_cleanup(p_hwfn, p_hwfn->p_main_ptt, rc = qed_final_cleanup(p_hwfn, p_hwfn->p_main_ptt,
p_hwfn->rel_pf_id, false); p_hwfn->rel_pf_id, false);
if (rc) { if (rc) {
DP_NOTICE(p_hwfn, "Final cleanup failed\n"); qed_hw_err_notify(p_hwfn, p_hwfn->p_main_ptt,
QED_HW_ERR_RAMROD_FAIL,
"Final cleanup failed\n");
goto load_err; goto load_err;
} }
} }
......
...@@ -762,9 +762,10 @@ static int qed_dmae_execute_command(struct qed_hwfn *p_hwfn, ...@@ -762,9 +762,10 @@ static int qed_dmae_execute_command(struct qed_hwfn *p_hwfn,
dst_type, dst_type,
length_cur); length_cur);
if (qed_status) { if (qed_status) {
DP_NOTICE(p_hwfn, qed_hw_err_notify(p_hwfn, p_ptt, QED_HW_ERR_DMAE_FAIL,
"qed_dmae_execute_sub_operation Failed with error 0x%x. source_addr 0x%llx, destination addr 0x%llx, size_in_dwords 0x%x\n", "qed_dmae_execute_sub_operation Failed with error 0x%x. source_addr 0x%llx, destination addr 0x%llx, size_in_dwords 0x%x\n",
qed_status, src_addr, dst_addr, length_cur); qed_status, src_addr,
dst_addr, length_cur);
break; break;
} }
} }
......
...@@ -363,6 +363,14 @@ static int qed_pglueb_rbc_attn_cb(struct qed_hwfn *p_hwfn) ...@@ -363,6 +363,14 @@ static int qed_pglueb_rbc_attn_cb(struct qed_hwfn *p_hwfn)
return qed_pglueb_rbc_attn_handler(p_hwfn, p_hwfn->p_dpc_ptt); return qed_pglueb_rbc_attn_handler(p_hwfn, p_hwfn->p_dpc_ptt);
} }
static int qed_fw_assertion(struct qed_hwfn *p_hwfn)
{
qed_hw_err_notify(p_hwfn, p_hwfn->p_dpc_ptt, QED_HW_ERR_FW_ASSERT,
"FW assertion!\n");
return -EINVAL;
}
#define QED_DORQ_ATTENTION_REASON_MASK (0xfffff) #define QED_DORQ_ATTENTION_REASON_MASK (0xfffff)
#define QED_DORQ_ATTENTION_OPAQUE_MASK (0xffff) #define QED_DORQ_ATTENTION_OPAQUE_MASK (0xffff)
#define QED_DORQ_ATTENTION_OPAQUE_SHIFT (0x0) #define QED_DORQ_ATTENTION_OPAQUE_SHIFT (0x0)
...@@ -606,7 +614,8 @@ static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = { ...@@ -606,7 +614,8 @@ static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
{ {
{ /* After Invert 4 */ { /* After Invert 4 */
{"General Attention 32", ATTENTION_SINGLE, {"General Attention 32", ATTENTION_SINGLE,
NULL, MAX_BLOCK_ID}, qed_fw_assertion,
MAX_BLOCK_ID},
{"General Attention %d", {"General Attention %d",
(2 << ATTENTION_LENGTH_SHIFT) | (2 << ATTENTION_LENGTH_SHIFT) |
(33 << ATTENTION_OFFSET_SHIFT), NULL, MAX_BLOCK_ID}, (33 << ATTENTION_OFFSET_SHIFT), NULL, MAX_BLOCK_ID},
...@@ -927,9 +936,12 @@ qed_int_deassertion_aeu_bit(struct qed_hwfn *p_hwfn, ...@@ -927,9 +936,12 @@ qed_int_deassertion_aeu_bit(struct qed_hwfn *p_hwfn,
qed_int_attn_print(p_hwfn, p_aeu->block_index, qed_int_attn_print(p_hwfn, p_aeu->block_index,
ATTN_TYPE_INTERRUPT, !b_fatal); ATTN_TYPE_INTERRUPT, !b_fatal);
/* Reach assertion if attention is fatal */
/* If the attention is benign, no need to prevent it */ if (b_fatal)
if (!rc) qed_hw_err_notify(p_hwfn, p_hwfn->p_dpc_ptt, QED_HW_ERR_HW_ATTN,
"`%s': Fatal attention\n",
p_bit_name);
else /* If the attention is benign, no need to prevent it */
goto out; goto out;
/* Prevent this Attention from being asserted in the future */ /* Prevent this Attention from being asserted in the future */
......
...@@ -575,6 +575,8 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn, ...@@ -575,6 +575,8 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
if (!QED_MB_FLAGS_IS_SET(p_mb_params, AVOID_BLOCK)) if (!QED_MB_FLAGS_IS_SET(p_mb_params, AVOID_BLOCK))
qed_mcp_cmd_set_blocking(p_hwfn, true); qed_mcp_cmd_set_blocking(p_hwfn, true);
qed_hw_err_notify(p_hwfn, p_ptt,
QED_HW_ERR_MFW_RESP_FAIL, NULL);
return -EAGAIN; return -EAGAIN;
} }
......
...@@ -160,12 +160,16 @@ static int qed_spq_block(struct qed_hwfn *p_hwfn, ...@@ -160,12 +160,16 @@ static int qed_spq_block(struct qed_hwfn *p_hwfn,
return 0; return 0;
} }
err: err:
DP_NOTICE(p_hwfn, p_ptt = qed_ptt_acquire(p_hwfn);
"Ramrod is stuck [CID %08x cmd %02x protocol %02x echo %04x]\n", if (!p_ptt)
le32_to_cpu(p_ent->elem.hdr.cid), return -EBUSY;
p_ent->elem.hdr.cmd_id, qed_hw_err_notify(p_hwfn, p_ptt, QED_HW_ERR_RAMROD_FAIL,
p_ent->elem.hdr.protocol_id, "Ramrod is stuck [CID %08x cmd %02x protocol %02x echo %04x]\n",
le16_to_cpu(p_ent->elem.hdr.echo)); le32_to_cpu(p_ent->elem.hdr.cid),
p_ent->elem.hdr.cmd_id,
p_ent->elem.hdr.protocol_id,
le16_to_cpu(p_ent->elem.hdr.echo));
qed_ptt_release(p_hwfn, p_ptt);
return -EBUSY; return -EBUSY;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment