Lines Matching refs:fw_health
1435 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_fw_health_readl() local
1436 u32 reg = fw_health->regs[reg_idx]; in bnxt_fw_health_readl()
1446 reg_off = fw_health->mapped_regs[reg_idx]; in bnxt_fw_health_readl()
1456 val &= fw_health->fw_reset_inprog_reg_mask; in bnxt_fw_health_readl()
1497 struct bnxt_fw_health *fw_health = bp->fw_health; in is_bnxt_fw_ok() local
1502 if (val == fw_health->last_fw_heartbeat) in is_bnxt_fw_ok()
1506 if (val != fw_health->last_fw_reset_cnt) in is_bnxt_fw_ok()
1557 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_fw_reset_writel() local
1558 u32 reg = fw_health->fw_reset_seq_regs[reg_idx]; in bnxt_fw_reset_writel()
1559 u32 val = fw_health->fw_reset_seq_vals[reg_idx]; in bnxt_fw_reset_writel()
1562 delay_msecs = fw_health->fw_reset_seq_delay_msec[reg_idx]; in bnxt_fw_reset_writel()
1588 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_reset_all() local
1596 if (fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST) { in bnxt_reset_all()
1597 for (i = 0; i < fw_health->fw_reset_seq_cnt; i++) in bnxt_reset_all()
1599 } else if (fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU) { in bnxt_reset_all()
1617 if (bp->fw_health) in __bnxt_alloc_fw_health()
1620 bp->fw_health = kzalloc(sizeof(*bp->fw_health), GFP_KERNEL); in __bnxt_alloc_fw_health()
1621 if (!bp->fw_health) in __bnxt_alloc_fw_health()
1624 mutex_init(&bp->fw_health->lock); in __bnxt_alloc_fw_health()
1653 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_map_fw_health_regs() local
1657 bp->fw_health->status_reliable = false; in bnxt_map_fw_health_regs()
1658 bp->fw_health->resets_reliable = false; in bnxt_map_fw_health_regs()
1661 u32 reg = fw_health->regs[i]; in bnxt_map_fw_health_regs()
1669 fw_health->mapped_regs[i] = BNXT_FW_HEALTH_WIN_OFF(reg); in bnxt_map_fw_health_regs()
1671 bp->fw_health->status_reliable = true; in bnxt_map_fw_health_regs()
1672 bp->fw_health->resets_reliable = true; in bnxt_map_fw_health_regs()
1682 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_inv_fw_health_reg() local
1685 if (!fw_health) in bnxt_inv_fw_health_reg()
1688 reg_type = BNXT_FW_HEALTH_REG_TYPE(fw_health->regs[BNXT_FW_HEALTH_REG]); in bnxt_inv_fw_health_reg()
1690 fw_health->status_reliable = false; in bnxt_inv_fw_health_reg()
1692 reg_type = BNXT_FW_HEALTH_REG_TYPE(fw_health->regs[BNXT_FW_RESET_CNT_REG]); in bnxt_inv_fw_health_reg()
1694 fw_health->resets_reliable = false; in bnxt_inv_fw_health_reg()
1699 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_hwrm_error_recovery_qcfg() local
1713 fw_health->flags = le32toh(resp->flags); in bnxt_hwrm_error_recovery_qcfg()
1714 if ((fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU) && in bnxt_hwrm_error_recovery_qcfg()
1719 fw_health->polling_dsecs = le32toh(resp->driver_polling_freq); in bnxt_hwrm_error_recovery_qcfg()
1720 fw_health->master_func_wait_dsecs = in bnxt_hwrm_error_recovery_qcfg()
1722 fw_health->normal_func_wait_dsecs = in bnxt_hwrm_error_recovery_qcfg()
1724 fw_health->post_reset_wait_dsecs = in bnxt_hwrm_error_recovery_qcfg()
1726 fw_health->post_reset_max_wait_dsecs = in bnxt_hwrm_error_recovery_qcfg()
1728 fw_health->regs[BNXT_FW_HEALTH_REG] = in bnxt_hwrm_error_recovery_qcfg()
1730 fw_health->regs[BNXT_FW_HEARTBEAT_REG] = in bnxt_hwrm_error_recovery_qcfg()
1732 fw_health->regs[BNXT_FW_RESET_CNT_REG] = in bnxt_hwrm_error_recovery_qcfg()
1734 fw_health->regs[BNXT_FW_RESET_INPROG_REG] = in bnxt_hwrm_error_recovery_qcfg()
1736 fw_health->fw_reset_inprog_reg_mask = in bnxt_hwrm_error_recovery_qcfg()
1738 fw_health->fw_reset_seq_cnt = resp->reg_array_cnt; in bnxt_hwrm_error_recovery_qcfg()
1739 if (fw_health->fw_reset_seq_cnt >= 16) { in bnxt_hwrm_error_recovery_qcfg()
1743 for (i = 0; i < fw_health->fw_reset_seq_cnt; i++) { in bnxt_hwrm_error_recovery_qcfg()
1744 fw_health->fw_reset_seq_regs[i] = in bnxt_hwrm_error_recovery_qcfg()
1746 fw_health->fw_reset_seq_vals[i] = in bnxt_hwrm_error_recovery_qcfg()
1748 fw_health->fw_reset_seq_delay_msec[i] = in bnxt_hwrm_error_recovery_qcfg()
1887 if (!bp->fw_health->primary) { in bnxt_fw_reset_task()
1888 u32 wait_dsecs = bp->fw_health->normal_func_wait_dsecs; in bnxt_fw_reset_task()
1955 bp->fw_health->enabled) { in bnxt_fw_reset_task()
1956 bp->fw_health->last_fw_reset_cnt = in bnxt_fw_reset_task()
1970 if (bp->fw_health->status_reliable || in bnxt_fw_reset_task()
1984 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_force_fw_reset() local
1991 wait_dsecs = fw_health->master_func_wait_dsecs; in bnxt_force_fw_reset()
1992 if (fw_health->primary) { in bnxt_force_fw_reset()
1993 if (fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU) in bnxt_force_fw_reset()
1998 wait_dsecs = fw_health->normal_func_wait_dsecs; in bnxt_force_fw_reset()
2002 bp->fw_reset_min_dsecs = fw_health->post_reset_wait_dsecs; in bnxt_force_fw_reset()
2003 bp->fw_reset_max_dsecs = fw_health->post_reset_max_wait_dsecs; in bnxt_force_fw_reset()
2027 struct bnxt_fw_health *fw_health = bp->fw_health; in bnxt_devlink_health_fw_report() local
2029 if (!fw_health) in bnxt_devlink_health_fw_report()
2032 if (!fw_health->fw_reporter) { in bnxt_devlink_health_fw_report()
4488 struct bnxt_fw_health *fw_health; in bnxt_handle_async_event() local
4511 if (!softc->fw_health) in bnxt_handle_async_event()
4525 softc->fw_health->fatalities++; in bnxt_handle_async_event()
4530 softc->fw_health->survivals++; in bnxt_handle_async_event()
4542 fw_health = softc->fw_health; in bnxt_handle_async_event()
4546 if (!fw_health) in bnxt_handle_async_event()
4550 fw_health->enabled = false; in bnxt_handle_async_event()
4554 fw_health->primary = EVENT_DATA1_RECOVERY_MASTER_FUNC(data1); in bnxt_handle_async_event()
4555 fw_health->tmr_multiplier = in bnxt_handle_async_event()
4556 DIV_ROUND_UP(fw_health->polling_dsecs * HZ, in bnxt_handle_async_event()
4558 fw_health->tmr_counter = fw_health->tmr_multiplier; in bnxt_handle_async_event()
4559 if (!fw_health->enabled) in bnxt_handle_async_event()
4560 fw_health->last_fw_heartbeat = in bnxt_handle_async_event()
4562 fw_health->last_fw_reset_cnt = in bnxt_handle_async_event()
4569 fw_health->primary ? "primary" : "backup", status, in bnxt_handle_async_event()
4570 status_desc, fw_health->last_fw_reset_cnt); in bnxt_handle_async_event()
4571 if (!fw_health->enabled) { in bnxt_handle_async_event()
4576 fw_health->enabled = true; in bnxt_handle_async_event()