summaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/ap_card.c
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.ibm.com>2021-11-17 17:38:39 +0300
committerVasily Gorbik <gor@linux.ibm.com>2022-03-08 02:33:00 +0300
commita7e701dba1234adbfbacad5ce19656c5606728da (patch)
tree245680d4d662d8bfe5470ef51b4d57d9d56588a2 /drivers/s390/crypto/ap_card.c
parent985214af939b9935dac94aa6fb56c85039fb77e8 (diff)
downloadlinux-a7e701dba1234adbfbacad5ce19656c5606728da.tar.xz
s390/zcrypt: handle checkstopped cards with new state
A crypto card may be in checkstopped state. With this patch this is handled as a new state in the ap card and ap queue structs. There is also a new card sysfs attribute /sys/devices/ap/cardxx/chkstop and a new queue sysfs attribute /sys/devices/ap/cardxx/xx.yyyy/chkstop displaying the checkstop state of the card or queue. Please note that the queue's checkstop state is only a copy of the card's checkstop state but makes maintenance much easier. The checkstop state expressed here is the result of an RC 0x04 (CHECKSTOP) during an AP command, mostly the PQAP(TAPQ) command which is 'testing' the queue. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Jürgen Christ <jchrist@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_card.c')
-rw-r--r--drivers/s390/crypto/ap_card.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c
index 196325a66662..6b2170cf186e 100644
--- a/drivers/s390/crypto/ap_card.c
+++ b/drivers/s390/crypto/ap_card.c
@@ -174,6 +174,16 @@ static ssize_t config_store(struct device *dev,
static DEVICE_ATTR_RW(config);
+static ssize_t chkstop_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct ap_card *ac = to_ap_card(dev);
+
+ return scnprintf(buf, PAGE_SIZE, "%d\n", ac->chkstop ? 1 : 0);
+}
+
+static DEVICE_ATTR_RO(chkstop);
+
static ssize_t max_msg_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -194,6 +204,7 @@ static struct attribute *ap_card_dev_attrs[] = {
&dev_attr_pendingq_count.attr,
&dev_attr_modalias.attr,
&dev_attr_config.attr,
+ &dev_attr_chkstop.attr,
&dev_attr_max_msg_size.attr,
NULL
};