aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>2016-01-22 10:18:29 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-01-26 06:46:58 -0500
commitd8f51227f33fbb34e1e54e315175268f54e573e7 (patch)
tree2ccadb61a115d8342f276cbeaa6d3523567fa2e7
parentf5e44f82c1848d8e55fb0061308f14c0884e5483 (diff)
s390/zcrypt: Fix cryptographic device id in kernel messages
Currently, on card response failures a combination of card domain and domain id is recorded in the kernel messages. According to the message description only the card id will be recorded. The domain id is not relevant, since the whole card including all domains is set offline. Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/crypto/zcrypt_error.h15
-rw-r--r--drivers/s390/crypto/zcrypt_msgtype50.c9
-rw-r--r--drivers/s390/crypto/zcrypt_msgtype6.c20
3 files changed, 24 insertions, 20 deletions
diff --git a/drivers/s390/crypto/zcrypt_error.h b/drivers/s390/crypto/zcrypt_error.h
index 7b23f43c7b08..de1b6c1d172c 100644
--- a/drivers/s390/crypto/zcrypt_error.h
+++ b/drivers/s390/crypto/zcrypt_error.h
@@ -112,9 +112,10 @@ static inline int convert_error(struct zcrypt_device *zdev,
112 atomic_set(&zcrypt_rescan_req, 1); 112 atomic_set(&zcrypt_rescan_req, 1);
113 zdev->online = 0; 113 zdev->online = 0;
114 pr_err("Cryptographic device %x failed and was set offline\n", 114 pr_err("Cryptographic device %x failed and was set offline\n",
115 zdev->ap_dev->qid); 115 AP_QID_DEVICE(zdev->ap_dev->qid));
116 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", 116 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d",
117 zdev->ap_dev->qid, zdev->online, ehdr->reply_code); 117 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online,
118 ehdr->reply_code);
118 return -EAGAIN; 119 return -EAGAIN;
119 case REP82_ERROR_TRANSPORT_FAIL: 120 case REP82_ERROR_TRANSPORT_FAIL:
120 case REP82_ERROR_MACHINE_FAILURE: 121 case REP82_ERROR_MACHINE_FAILURE:
@@ -123,16 +124,18 @@ static inline int convert_error(struct zcrypt_device *zdev,
123 atomic_set(&zcrypt_rescan_req, 1); 124 atomic_set(&zcrypt_rescan_req, 1);
124 zdev->online = 0; 125 zdev->online = 0;
125 pr_err("Cryptographic device %x failed and was set offline\n", 126 pr_err("Cryptographic device %x failed and was set offline\n",
126 zdev->ap_dev->qid); 127 AP_QID_DEVICE(zdev->ap_dev->qid));
127 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", 128 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d",
128 zdev->ap_dev->qid, zdev->online, ehdr->reply_code); 129 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online,
130 ehdr->reply_code);
129 return -EAGAIN; 131 return -EAGAIN;
130 default: 132 default:
131 zdev->online = 0; 133 zdev->online = 0;
132 pr_err("Cryptographic device %x failed and was set offline\n", 134 pr_err("Cryptographic device %x failed and was set offline\n",
133 zdev->ap_dev->qid); 135 AP_QID_DEVICE(zdev->ap_dev->qid));
134 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", 136 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d",
135 zdev->ap_dev->qid, zdev->online, ehdr->reply_code); 137 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online,
138 ehdr->reply_code);
136 return -EAGAIN; /* repeat the request on a different device. */ 139 return -EAGAIN; /* repeat the request on a different device. */
137 } 140 }
138} 141}
diff --git a/drivers/s390/crypto/zcrypt_msgtype50.c b/drivers/s390/crypto/zcrypt_msgtype50.c
index 74edf2934e7c..eedfaa2cf715 100644
--- a/drivers/s390/crypto/zcrypt_msgtype50.c
+++ b/drivers/s390/crypto/zcrypt_msgtype50.c
@@ -336,9 +336,10 @@ static int convert_type80(struct zcrypt_device *zdev,
336 /* The result is too short, the CEX2A card may not do that.. */ 336 /* The result is too short, the CEX2A card may not do that.. */
337 zdev->online = 0; 337 zdev->online = 0;
338 pr_err("Cryptographic device %x failed and was set offline\n", 338 pr_err("Cryptographic device %x failed and was set offline\n",
339 zdev->ap_dev->qid); 339 AP_QID_DEVICE(zdev->ap_dev->qid));
340 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", 340 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d",
341 zdev->ap_dev->qid, zdev->online, t80h->code); 341 AP_QID_DEVICE(zdev->ap_dev->qid),
342 zdev->online, t80h->code);
342 343
343 return -EAGAIN; /* repeat the request on a different device. */ 344 return -EAGAIN; /* repeat the request on a different device. */
344 } 345 }
@@ -368,9 +369,9 @@ static int convert_response(struct zcrypt_device *zdev,
368 default: /* Unknown response type, this should NEVER EVER happen */ 369 default: /* Unknown response type, this should NEVER EVER happen */
369 zdev->online = 0; 370 zdev->online = 0;
370 pr_err("Cryptographic device %x failed and was set offline\n", 371 pr_err("Cryptographic device %x failed and was set offline\n",
371 zdev->ap_dev->qid); 372 AP_QID_DEVICE(zdev->ap_dev->qid));
372 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail", 373 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail",
373 zdev->ap_dev->qid, zdev->online); 374 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online);
374 return -EAGAIN; /* repeat the request on a different device. */ 375 return -EAGAIN; /* repeat the request on a different device. */
375 } 376 }
376} 377}
diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 9a2dd472c1cc..21959719daef 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -572,9 +572,9 @@ static int convert_type86_ica(struct zcrypt_device *zdev,
572 return -EINVAL; 572 return -EINVAL;
573 zdev->online = 0; 573 zdev->online = 0;
574 pr_err("Cryptographic device %x failed and was set offline\n", 574 pr_err("Cryptographic device %x failed and was set offline\n",
575 zdev->ap_dev->qid); 575 AP_QID_DEVICE(zdev->ap_dev->qid));
576 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d", 576 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%drc%d",
577 zdev->ap_dev->qid, zdev->online, 577 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online,
578 msg->hdr.reply_code); 578 msg->hdr.reply_code);
579 return -EAGAIN; /* repeat the request on a different device. */ 579 return -EAGAIN; /* repeat the request on a different device. */
580 } 580 }
@@ -715,9 +715,9 @@ static int convert_response_ica(struct zcrypt_device *zdev,
715 default: /* Unknown response type, this should NEVER EVER happen */ 715 default: /* Unknown response type, this should NEVER EVER happen */
716 zdev->online = 0; 716 zdev->online = 0;
717 pr_err("Cryptographic device %x failed and was set offline\n", 717 pr_err("Cryptographic device %x failed and was set offline\n",
718 zdev->ap_dev->qid); 718 AP_QID_DEVICE(zdev->ap_dev->qid));
719 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail", 719 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail",
720 zdev->ap_dev->qid, zdev->online); 720 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online);
721 return -EAGAIN; /* repeat the request on a different device. */ 721 return -EAGAIN; /* repeat the request on a different device. */
722 } 722 }
723} 723}
@@ -747,9 +747,9 @@ static int convert_response_xcrb(struct zcrypt_device *zdev,
747 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */ 747 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */
748 zdev->online = 0; 748 zdev->online = 0;
749 pr_err("Cryptographic device %x failed and was set offline\n", 749 pr_err("Cryptographic device %x failed and was set offline\n",
750 zdev->ap_dev->qid); 750 AP_QID_DEVICE(zdev->ap_dev->qid));
751 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail", 751 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail",
752 zdev->ap_dev->qid, zdev->online); 752 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online);
753 return -EAGAIN; /* repeat the request on a different device. */ 753 return -EAGAIN; /* repeat the request on a different device. */
754 } 754 }
755} 755}
@@ -773,9 +773,9 @@ static int convert_response_ep11_xcrb(struct zcrypt_device *zdev,
773 default: /* Unknown response type, this should NEVER EVER happen */ 773 default: /* Unknown response type, this should NEVER EVER happen */
774 zdev->online = 0; 774 zdev->online = 0;
775 pr_err("Cryptographic device %x failed and was set offline\n", 775 pr_err("Cryptographic device %x failed and was set offline\n",
776 zdev->ap_dev->qid); 776 AP_QID_DEVICE(zdev->ap_dev->qid));
777 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail", 777 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail",
778 zdev->ap_dev->qid, zdev->online); 778 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online);
779 return -EAGAIN; /* repeat the request on a different device. */ 779 return -EAGAIN; /* repeat the request on a different device. */
780 } 780 }
781} 781}
@@ -800,9 +800,9 @@ static int convert_response_rng(struct zcrypt_device *zdev,
800 default: /* Unknown response type, this should NEVER EVER happen */ 800 default: /* Unknown response type, this should NEVER EVER happen */
801 zdev->online = 0; 801 zdev->online = 0;
802 pr_err("Cryptographic device %x failed and was set offline\n", 802 pr_err("Cryptographic device %x failed and was set offline\n",
803 zdev->ap_dev->qid); 803 AP_QID_DEVICE(zdev->ap_dev->qid));
804 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail", 804 ZCRYPT_DBF_DEV(DBF_ERR, zdev, "dev%04xo%dfail",
805 zdev->ap_dev->qid, zdev->online); 805 AP_QID_DEVICE(zdev->ap_dev->qid), zdev->online);
806 return -EAGAIN; /* repeat the request on a different device. */ 806 return -EAGAIN; /* repeat the request on a different device. */
807 } 807 }
808} 808}