@@ -617,10 +617,17 @@ enum devlink_port_fn_opstate {
* @DL_HEALTH_STATE_ERROR: error state, running health reporter's recovery
* may fix the issue, otherwise user needs to try
* power cycling or other forms of reset
+ * @DL_HEALTH_STATE_BAD_IMAGE: device's non-volatile memory needs
+ * to be re-written, usually due to block corruption
+ * @DL_HEALTH_STATE_BAD_HW: hardware errors detected, device, host
+ * or the connection between the two may be at fault
*/
enum devlink_health_state {
DL_HEALTH_STATE_HEALTHY,
DL_HEALTH_STATE_ERROR,
+
+ DL_HEALTH_STATE_BAD_IMAGE,
+ DL_HEALTH_STATE_BAD_HW,
};
/**
@@ -6527,8 +6527,7 @@ void
devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
enum devlink_health_state state)
{
- if (WARN_ON(state != DL_HEALTH_STATE_HEALTHY &&
- state != DL_HEALTH_STATE_ERROR))
+ if (WARN_ON(state > DL_HEALTH_STATE_BAD_HW))
return;
if (reporter->health_state == state)