Пример #1
0
static void rtas_parse_epow_errlog(struct rtas_error_log *log)
{
	struct pseries_errorlog *pseries_log;
	struct epow_errorlog *epow_log;
	char action_code;
	char modifier;

	pseries_log = get_pseries_errorlog(log, PSERIES_ELOG_SECT_ID_EPOW);
	if (pseries_log == NULL)
		return;

	epow_log = (struct epow_errorlog *)pseries_log->data;
	action_code = epow_log->sensor_value & 0xF;	/* bottom 4 bits */
	modifier = epow_log->event_modifier & 0xF;	/* bottom 4 bits */

	switch (action_code) {
	case EPOW_RESET:
		if (num_epow_events) {
			pr_info("Non critical power/cooling issue cleared\n");
			num_epow_events--;
		}
		break;

	case EPOW_WARN_COOLING:
		pr_info("Non-critical cooling issue detected. Check RTAS error"
			" log for details\n");
		break;

	case EPOW_WARN_POWER:
		pr_info("Non-critical power issue detected. Check RTAS error"
			" log for details\n");
		break;

	case EPOW_SYSTEM_SHUTDOWN:
		handle_system_shutdown(epow_log->event_modifier);
		break;

	case EPOW_SYSTEM_HALT:
		pr_emerg("Critical power/cooling issue detected. Check RTAS"
			 " error log for details. Powering off.\n");
		orderly_poweroff(true);
		break;

	case EPOW_MAIN_ENCLOSURE:
	case EPOW_POWER_OFF:
		pr_emerg("System about to lose power. Check RTAS error log "
			 " for details. Powering off immediately.\n");
		emergency_sync();
		kernel_power_off();
		break;

	default:
		pr_err("Unknown power/cooling event (action code  = %d)\n",
			action_code);
	}

	/* Increment epow events counter variable */
	if (action_code != EPOW_RESET)
		num_epow_events++;
}
Пример #2
0
void rtas_parse_epow_errlog(struct rtas_error_log *log)
{
    struct pseries_errorlog *pseries_log;
    struct epow_errorlog *epow_log;
    char action_code;
    char modifier;

    pseries_log = get_pseries_errorlog(log, PSERIES_ELOG_SECT_ID_EPOW);
    if (pseries_log == NULL)
        return;

    epow_log = (struct epow_errorlog *)pseries_log->data;
    action_code = epow_log->sensor_value & 0xF;	/* bottom 4 bits */
    modifier = epow_log->event_modifier & 0xF;	/* bottom 4 bits */

    switch (action_code) {
    case EPOW_RESET:
        pr_err("Non critical power or cooling issue cleared");
        break;

    case EPOW_WARN_COOLING:
        pr_err("Non critical cooling issue reported by firmware");
        pr_err("Check RTAS error log for details");
        break;

    case EPOW_WARN_POWER:
        pr_err("Non critical power issue reported by firmware");
        pr_err("Check RTAS error log for details");
        break;

    case EPOW_SYSTEM_SHUTDOWN:
        handle_system_shutdown(epow_log->event_modifier);
        break;

    case EPOW_SYSTEM_HALT:
        pr_emerg("Firmware initiated power off");
        orderly_poweroff(1);
        break;

    case EPOW_MAIN_ENCLOSURE:
    case EPOW_POWER_OFF:
        pr_emerg("Critical power/cooling issue reported by firmware");
        pr_emerg("Check RTAS error log for details");
        pr_emerg("Immediate power off");
        emergency_sync();
        kernel_power_off();
        break;

    default:
        pr_err("Unknown power/cooling event (action code %d)",
               action_code);
    }
}