summaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/zcrypt_error.h
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.vnet.ibm.com>2016-11-24 08:45:21 +0300
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-12-14 18:33:39 +0300
commitcccd85bfb7bf6787302435c669ceec23b5a5301c (patch)
treec646f0474f1344372596c37adff268dbdb4f07c3 /drivers/s390/crypto/zcrypt_error.h
parentbf9f31190aa176c43c15cf58b60818d325e0f851 (diff)
downloadlinux-cccd85bfb7bf6787302435c669ceec23b5a5301c.tar.xz
s390/zcrypt: Rework debug feature invocations.
Rework the debug feature calls and initialization. There are now two debug feature entries used by the zcrypt code. The first is 'ap' with all the AP bus related stuff and the second is 'zcrypt' with all the zcrypt and devices and driver related entries. However, there isn't much traffic on both debug features. The ap bus code emits only some debug info and for zcrypt devices on appearance and disappearance there is an entry written. The new dbf invocations use the sprintf buffer layout, whereas the old implementation used the ascii dbf buffer. There are now 5*8=40 bytes used for each entry, resulting in 5 parameters per call. As the sprintf buffer needs a format string the first parameter provides this and so up to 4 more parameters can be used. Alltogehter the new layout should be much more human readable for customers and test. Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_error.h')
-rw-r--r--drivers/s390/crypto/zcrypt_error.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/s390/crypto/zcrypt_error.h b/drivers/s390/crypto/zcrypt_error.h
index 865978879661..13df60209ed3 100644
--- a/drivers/s390/crypto/zcrypt_error.h
+++ b/drivers/s390/crypto/zcrypt_error.h
@@ -93,6 +93,8 @@ static inline int convert_error(struct zcrypt_queue *zq,
struct ap_message *reply)
{
struct error_hdr *ehdr = reply->message;
+ int card = AP_QID_CARD(zq->queue->qid);
+ int queue = AP_QID_QUEUE(zq->queue->qid);
switch (ehdr->reply_code) {
case REP82_ERROR_OPERAND_INVALID:
@@ -105,6 +107,9 @@ static inline int convert_error(struct zcrypt_queue *zq,
// REP88_ERROR_OPERAND // '84' CEX2A
// REP88_ERROR_OPERAND_EVEN_MOD // '85' CEX2A
/* Invalid input data. */
+ ZCRYPT_DBF(DBF_WARN,
+ "device=%02x.%04x reply=0x%02x => rc=EINVAL\n",
+ card, queue, ehdr->reply_code);
return -EINVAL;
case REP82_ERROR_MESSAGE_TYPE:
// REP88_ERROR_MESSAGE_TYPE // '20' CEX2A
@@ -116,12 +121,10 @@ static inline int convert_error(struct zcrypt_queue *zq,
atomic_set(&zcrypt_rescan_req, 1);
zq->online = 0;
pr_err("Cryptographic device %02x.%04x failed and was set offline\n",
- AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid));
- ZCRYPT_DBF_DEV(DBF_ERR, zq, "dev%02x%04xo%drc%d",
- AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid), zq->online,
- ehdr->reply_code);
+ card, queue);
+ ZCRYPT_DBF(DBF_ERR,
+ "device=%02x.%04x reply=0x%02x => online=0 rc=EAGAIN\n",
+ card, queue, ehdr->reply_code);
return -EAGAIN;
case REP82_ERROR_TRANSPORT_FAIL:
case REP82_ERROR_MACHINE_FAILURE:
@@ -130,22 +133,18 @@ static inline int convert_error(struct zcrypt_queue *zq,
atomic_set(&zcrypt_rescan_req, 1);
zq->online = 0;
pr_err("Cryptographic device %02x.%04x failed and was set offline\n",
- AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid));
- ZCRYPT_DBF_DEV(DBF_ERR, zq, "dev%02x%04xo%drc%d",
- AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid), zq->online,
- ehdr->reply_code);
+ card, queue);
+ ZCRYPT_DBF(DBF_ERR,
+ "device=%02x.%04x reply=0x%02x => online=0 rc=EAGAIN\n",
+ card, queue, ehdr->reply_code);
return -EAGAIN;
default:
zq->online = 0;
pr_err("Cryptographic device %02x.%04x failed and was set offline\n",
- AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid));
- ZCRYPT_DBF_DEV(DBF_ERR, zq, "dev%02x%04xo%drc%d",
- AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid), zq->online,
- ehdr->reply_code);
+ card, queue);
+ ZCRYPT_DBF(DBF_ERR,
+ "device=%02x.%04x reply=0x%02x => online=0 rc=EAGAIN\n",
+ card, queue, ehdr->reply_code);
return -EAGAIN; /* repeat the request on a different device. */
}
}