aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/zcrypt_msgtype50.c
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.ibm.com>2020-07-02 11:22:01 +0200
committerVasily Gorbik <gor@linux.ibm.com>2020-10-07 21:49:59 +0200
commit0b641cbd24445e56073c69dd046be488dcf1965b (patch)
tree3e5843837542e091d06687bd94583f6bbd92b7e6 /drivers/s390/crypto/zcrypt_msgtype50.c
parents390/zcrypt: New config switch CONFIG_ZCRYPT_DEBUG (diff)
downloadlinux-dev-0b641cbd24445e56073c69dd046be488dcf1965b.tar.xz
linux-dev-0b641cbd24445e56073c69dd046be488dcf1965b.zip
s390/ap: split ap queue state machine state from device state
The state machine for each ap queue covered a mixture of device states and state machine (firmware queue state) states. This patch splits the device states and the state machine states into two different enums and variables. The major state is the device state with currently these values: AP_DEV_STATE_UNINITIATED - fresh and virgin, not touched AP_DEV_STATE_OPERATING - queue dev is working normal AP_DEV_STATE_SHUTDOWN - remove/unbind/shutdown in progress AP_DEV_STATE_ERROR - device is in error state only when the device state is > UNINITIATED the state machine is run. The state machine represents the states of the firmware queue: AP_SM_STATE_RESET_START - starting point, reset (RAPQ) ap queue AP_SM_STATE_RESET_WAIT - reset triggered, waiting to be finished if irqs enabled, set up irq (AQIC) AP_SM_STATE_SETIRQ_WAIT - enable irq triggered, waiting to be finished, then go to IDLE AP_SM_STATE_IDLE - queue is operational but empty AP_SM_STATE_WORKING - queue is operational, requests are stored and replies may wait for getting fetched AP_SM_STATE_QUEUE_FULL - firmware queue is full, so only replies can get fetched For debugging each ap queue shows a sysfs attribute 'states' which displays the device and state machine state and is only available when the kernel is build with CONFIG_ZCRYPT_DEBUG enabled. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to '')
-rw-r--r--drivers/s390/crypto/zcrypt_msgtype50.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/s390/crypto/zcrypt_msgtype50.c b/drivers/s390/crypto/zcrypt_msgtype50.c
index 7aedc338b445..349306c2f155 100644
--- a/drivers/s390/crypto/zcrypt_msgtype50.c
+++ b/drivers/s390/crypto/zcrypt_msgtype50.c
@@ -471,7 +471,9 @@ static long zcrypt_cex2a_modexpo(struct zcrypt_queue *zq,
if (rc)
goto out_free;
init_completion(&work);
- ap_queue_message(zq->queue, &ap_msg);
+ rc = ap_queue_message(zq->queue, &ap_msg);
+ if (rc)
+ goto out_free;
rc = wait_for_completion_interruptible(&work);
if (rc == 0) {
rc = ap_msg.rc;
@@ -515,7 +517,9 @@ static long zcrypt_cex2a_modexpo_crt(struct zcrypt_queue *zq,
if (rc)
goto out_free;
init_completion(&work);
- ap_queue_message(zq->queue, &ap_msg);
+ rc = ap_queue_message(zq->queue, &ap_msg);
+ if (rc)
+ goto out_free;
rc = wait_for_completion_interruptible(&work);
if (rc == 0) {
rc = ap_msg.rc;