diff options
Diffstat (limited to 'drivers/s390/crypto/zcrypt_error.h')
| -rw-r--r-- | drivers/s390/crypto/zcrypt_error.h | 23 | 
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/s390/crypto/zcrypt_error.h b/drivers/s390/crypto/zcrypt_error.h index 03ba27f05f9..7b23f43c7b0 100644 --- a/drivers/s390/crypto/zcrypt_error.h +++ b/drivers/s390/crypto/zcrypt_error.h @@ -1,9 +1,7 @@  /* - *  linux/drivers/s390/crypto/zcrypt_error.h - *   *  zcrypt 2.1.0   * - *  Copyright (C)  2001, 2006 IBM Corporation + *  Copyright IBM Corp. 2001, 2006   *  Author(s): Robert Burroughs   *	       Eric Rossman (edrossma@us.ibm.com)   * @@ -28,6 +26,8 @@  #ifndef _ZCRYPT_ERROR_H_  #define _ZCRYPT_ERROR_H_ +#include <linux/atomic.h> +#include "zcrypt_debug.h"  #include "zcrypt_api.h"  /** @@ -106,20 +106,33 @@ static inline int convert_error(struct zcrypt_device *zdev,  	//   REP88_ERROR_MESSAGE_TYPE		// '20' CEX2A  		/*  		 * To sent a message of the wrong type is a bug in the -		 * device driver. Warn about it, disable the device +		 * device driver. Send error msg, disable the device  		 * and then repeat the request.  		 */ -		WARN_ON(1); +		atomic_set(&zcrypt_rescan_req, 1);  		zdev->online = 0; +		pr_err("Cryptographic device %x failed and was set offline\n", +		       zdev->ap_dev->qid); +		ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", +			zdev->ap_dev->qid, zdev->online, ehdr->reply_code);  		return -EAGAIN;  	case REP82_ERROR_TRANSPORT_FAIL:  	case REP82_ERROR_MACHINE_FAILURE:  	//   REP88_ERROR_MODULE_FAILURE		// '10' CEX2A  		/* If a card fails disable it and repeat the request. */ +		atomic_set(&zcrypt_rescan_req, 1);  		zdev->online = 0; +		pr_err("Cryptographic device %x failed and was set offline\n", +		       zdev->ap_dev->qid); +		ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", +			zdev->ap_dev->qid, zdev->online, ehdr->reply_code);  		return -EAGAIN;  	default:  		zdev->online = 0; +		pr_err("Cryptographic device %x failed and was set offline\n", +		       zdev->ap_dev->qid); +		ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", +			zdev->ap_dev->qid, zdev->online, ehdr->reply_code);  		return -EAGAIN;	/* repeat the request on a different device. */  	}  }  | 
