diff options
author | Ralph Wuerthner <rwuerthn@de.ibm.com> | 2007-03-26 14:42:43 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2007-03-26 14:43:47 -0400 |
commit | e675c0d2bf523a80098c843603ccc091d3720fb4 (patch) | |
tree | 058e1373752e83d0b635676746afa11ddbc18544 | |
parent | c6a48264739e3486f66e5b21a543c9573b713621 (diff) |
[S390] zcrypt: Fix ap_poll_requests counter in lost requests error path.
In the unlikely event that an AP device lost requests, don't forget to
update the ap_poll_requests counter too. Same must happen in case an AP
device is removed while there are still outstanding requests.
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index a817dade37c0..bf37cdf43fae 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -505,6 +505,9 @@ static int ap_device_remove(struct device *dev) | |||
505 | spin_lock_bh(&ap_device_lock); | 505 | spin_lock_bh(&ap_device_lock); |
506 | list_del_init(&ap_dev->list); | 506 | list_del_init(&ap_dev->list); |
507 | spin_unlock_bh(&ap_device_lock); | 507 | spin_unlock_bh(&ap_device_lock); |
508 | spin_lock_bh(&ap_dev->lock); | ||
509 | atomic_sub(ap_dev->queue_count, &ap_poll_requests); | ||
510 | spin_unlock_bh(&ap_dev->lock); | ||
508 | return 0; | 511 | return 0; |
509 | } | 512 | } |
510 | 513 | ||
@@ -867,6 +870,7 @@ static int ap_poll_read(struct ap_device *ap_dev, unsigned long *flags) | |||
867 | case AP_RESPONSE_NO_PENDING_REPLY: | 870 | case AP_RESPONSE_NO_PENDING_REPLY: |
868 | if (status.queue_empty) { | 871 | if (status.queue_empty) { |
869 | /* The card shouldn't forget requests but who knows. */ | 872 | /* The card shouldn't forget requests but who knows. */ |
873 | atomic_sub(ap_dev->queue_count, &ap_poll_requests); | ||
870 | ap_dev->queue_count = 0; | 874 | ap_dev->queue_count = 0; |
871 | list_splice_init(&ap_dev->pendingq, &ap_dev->requestq); | 875 | list_splice_init(&ap_dev->pendingq, &ap_dev->requestq); |
872 | ap_dev->requestq_count += ap_dev->pendingq_count; | 876 | ap_dev->requestq_count += ap_dev->pendingq_count; |