Commit abf90ac2 authored by Pavan Chebbi's avatar Pavan Chebbi Committed by David S. Miller

bnxt_en: Log if an invalid signal detected on TSIO pin

FW can report to driver via ASYNC event if it encountered an
invalid signal on any TSIO PIN. Driver will log this event
for the user to take corrective action.
Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: default avatarArvind Susarla <arvind.susarla@broadcom.com>
Reviewed-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
Signed-off-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 099fdeda
...@@ -278,6 +278,7 @@ static const u16 bnxt_async_events_arr[] = { ...@@ -278,6 +278,7 @@ static const u16 bnxt_async_events_arr[] = {
ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG, ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG,
ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST, ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST,
ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP, ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP,
ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT,
}; };
static struct workqueue_struct *bnxt_pf_wq; static struct workqueue_struct *bnxt_pf_wq;
...@@ -2043,6 +2044,19 @@ static u16 bnxt_agg_ring_id_to_grp_idx(struct bnxt *bp, u16 ring_id) ...@@ -2043,6 +2044,19 @@ static u16 bnxt_agg_ring_id_to_grp_idx(struct bnxt *bp, u16 ring_id)
return INVALID_HW_RING_ID; return INVALID_HW_RING_ID;
} }
static void bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2)
{
switch (BNXT_EVENT_ERROR_REPORT_TYPE(data1)) {
case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL:
netdev_err(bp->dev, "1PPS: Received invalid signal on pin%lu from the external source. Please fix the signal and reconfigure the pin\n",
BNXT_EVENT_INVALID_SIGNAL_DATA(data2));
break;
default:
netdev_err(bp->dev, "FW reported unknown error type\n");
break;
}
}
#define BNXT_GET_EVENT_PORT(data) \ #define BNXT_GET_EVENT_PORT(data) \
((data) & \ ((data) & \
ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK) ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK)
...@@ -2207,6 +2221,10 @@ static int bnxt_async_event_process(struct bnxt *bp, ...@@ -2207,6 +2221,10 @@ static int bnxt_async_event_process(struct bnxt *bp,
bnxt_ptp_pps_event(bp, data1, data2); bnxt_ptp_pps_event(bp, data1, data2);
goto async_event_process_exit; goto async_event_process_exit;
} }
case ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT: {
bnxt_event_error_report(bp, data1, data2);
goto async_event_process_exit;
}
default: default:
goto async_event_process_exit; goto async_event_process_exit;
} }
......
...@@ -496,6 +496,16 @@ struct rx_tpa_end_cmp_ext { ...@@ -496,6 +496,16 @@ struct rx_tpa_end_cmp_ext {
!!((data1) & \ !!((data1) & \
ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED) ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED)
#define BNXT_EVENT_ERROR_REPORT_TYPE(data1) \
(((data1) & \
ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK) >>\
ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT)
#define BNXT_EVENT_INVALID_SIGNAL_DATA(data2) \
(((data2) & \
ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_MASK) >>\
ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_SFT)
struct nqe_cn { struct nqe_cn {
__le16 type; __le16 type;
#define NQ_CN_TYPE_MASK 0x3fUL #define NQ_CN_TYPE_MASK 0x3fUL
......
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