Exemplo n.º 1
0
static int zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter,
					   int result)
{
	switch (result) {
	case ZFCP_ERP_SUCCEEDED :
		atomic_set(&adapter->erp_counter, 0);
		zfcp_erp_adapter_unblock(adapter);
		break;

	case ZFCP_ERP_FAILED :
		atomic_inc(&adapter->erp_counter);
		if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) {
			dev_err(&adapter->ccw_device->dev,
				"ERP cannot recover an error "
				"on the FCP device\n");
			zfcp_erp_adapter_failed(adapter, "erasck1", NULL);
		}
		break;
	}

	if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
		zfcp_erp_adapter_block(adapter, 0);
		result = ZFCP_ERP_EXIT;
	}
	return result;
}
Exemplo n.º 2
0
static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter,
				    int clear_mask, u8 id, void *ref)
{
	zfcp_erp_adapter_block(adapter, clear_mask);

	/* ensure propagation of failed status to new devices */
	if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
		zfcp_erp_adapter_failed(adapter, 13, NULL);
		return -EIO;
	}
	return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER,
				       adapter, NULL, NULL, id, ref);
}
Exemplo n.º 3
0
static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter,
                                    int clear_mask, char *id)
{
    zfcp_erp_adapter_block(adapter, clear_mask);
    zfcp_scsi_schedule_rports_block(adapter);


    if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
        zfcp_erp_set_adapter_status(adapter,
                                    ZFCP_STATUS_COMMON_ERP_FAILED);
        return -EIO;
    }
    return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER,
                                   adapter, NULL, NULL, id, 0);
}
Exemplo n.º 4
0
void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, char *id)
{
    unsigned long flags;

    zfcp_erp_adapter_block(adapter, clear);
    zfcp_scsi_schedule_rports_block(adapter);

    write_lock_irqsave(&adapter->erp_lock, flags);
    if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
        zfcp_erp_set_adapter_status(adapter,
                                    ZFCP_STATUS_COMMON_ERP_FAILED);
    else
        zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, adapter,
                                NULL, NULL, id, 0);
    write_unlock_irqrestore(&adapter->erp_lock, flags);
}