Commit:     e675c0d2bf523a80098c843603ccc091d3720fb4
Parent:     c6a48264739e3486f66e5b21a543c9573b713621
Author:     Ralph Wuerthner <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 26 20:42:43 2007 +0200
Committer:  Heiko Carstens <[EMAIL PROTECTED]>
CommitDate: Mon Mar 26 20:43:47 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Ralph Wuerthner <[EMAIL PROTECTED]>
    Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
 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 a817dad..bf37cdf 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)
+       spin_lock_bh(&ap_dev->lock);
+       atomic_sub(ap_dev->queue_count, &ap_poll_requests);
+       spin_unlock_bh(&ap_dev->lock);
        return 0;
@@ -867,6 +870,7 @@ static int ap_poll_read(struct ap_device *ap_dev, unsigned 
long *flags)
                if (status.queue_empty) {
                        /* The card shouldn't forget requests but who knows. */
+                       atomic_sub(ap_dev->queue_count, &ap_poll_requests);
                        ap_dev->queue_count = 0;
                        list_splice_init(&ap_dev->pendingq, &ap_dev->requestq);
                        ap_dev->requestq_count += ap_dev->pendingq_count;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to