Skip to content

Commit 2151fe0

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Handle RESET_NOTIFY async event from firmware.
This event from firmware signals a coordinated reset initiated by the firmware. It may be triggered by some error conditions encountered in the firmware or other orderly reset conditions. We store the parameters from this event. Subsequent patches will add logic to handle reset itself using devlink reporters. Signed-off-by: Vasundhara Volam <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6763c77 commit 2151fe0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ static const u16 bnxt_async_events_arr[] = {
254254
ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED,
255255
ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE,
256256
ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE,
257+
ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY,
257258
ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY,
258259
};
259260

@@ -1979,6 +1980,16 @@ static int bnxt_async_event_process(struct bnxt *bp,
19791980
goto async_event_process_exit;
19801981
set_bit(BNXT_RESET_TASK_SILENT_SP_EVENT, &bp->sp_event);
19811982
break;
1983+
case ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY:
1984+
bp->fw_reset_timestamp = jiffies;
1985+
bp->fw_reset_min_dsecs = cmpl->timestamp_lo;
1986+
if (!bp->fw_reset_min_dsecs)
1987+
bp->fw_reset_min_dsecs = BNXT_DFLT_FW_RST_MIN_DSECS;
1988+
bp->fw_reset_max_dsecs = le16_to_cpu(cmpl->timestamp_hi);
1989+
if (!bp->fw_reset_max_dsecs)
1990+
bp->fw_reset_max_dsecs = BNXT_DFLT_FW_RST_MAX_DSECS;
1991+
set_bit(BNXT_FW_RESET_NOTIFY_SP_EVENT, &bp->sp_event);
1992+
break;
19821993
case ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY: {
19831994
struct bnxt_fw_health *fw_health = bp->fw_health;
19841995
u32 data1 = le32_to_cpu(cmpl->event_data1);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,13 @@ struct bnxt {
17191719
#define BNXT_FLOW_STATS_SP_EVENT 15
17201720
#define BNXT_UPDATE_PHY_SP_EVENT 16
17211721
#define BNXT_RING_COAL_NOW_SP_EVENT 17
1722+
#define BNXT_FW_RESET_NOTIFY_SP_EVENT 18
1723+
1724+
u16 fw_reset_min_dsecs;
1725+
#define BNXT_DFLT_FW_RST_MIN_DSECS 20
1726+
u16 fw_reset_max_dsecs;
1727+
#define BNXT_DFLT_FW_RST_MAX_DSECS 60
1728+
unsigned long fw_reset_timestamp;
17221729

17231730
struct bnxt_fw_health *fw_health;
17241731

0 commit comments

Comments
 (0)