]> err.no Git - linux-2.6/commitdiff
[S390] zcrypt: fix PCIXCC/CEX2C error recovery
authorRalph Wuerthner <rwuerthn@de.ibm.com>
Fri, 12 Oct 2007 14:11:30 +0000 (16:11 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 12 Oct 2007 14:13:05 +0000 (16:13 +0200)
Symptom:     zcrypt fails by setting all PCIXCC/CEX2C cards offline for a
             certain type of invalid keys.
Problem:     zcrypt does not handle rc=12/rs=769 request responses correctly
Solution:    modify convert_type86_ica() to handle these error codes correctly

Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/crypto/zcrypt_pcixcc.c

index c28369260c2f0e92c98ec4ed99deeb3dfcfdd54a..70b9ddc8cf9d6270db525c7a62e6d7c019aedccf 100644 (file)
@@ -432,14 +432,17 @@ static int convert_type86_ica(struct zcrypt_device *zdev,
                }
                if (service_rc == 8 && service_rs == 770) {
                        PDEBUG("Invalid key length on PCIXCC/CEX2C\n");
-                       zdev->min_mod_size = PCIXCC_MIN_MOD_SIZE_OLD;
-                       return -EAGAIN;
+                       return -EINVAL;
                }
                if (service_rc == 8 && service_rs == 783) {
                        PDEBUG("Extended bitlengths not enabled on PCIXCC/CEX2C\n");
                        zdev->min_mod_size = PCIXCC_MIN_MOD_SIZE_OLD;
                        return -EAGAIN;
                }
+               if (service_rc == 12 && service_rs == 769) {
+                       PDEBUG("Invalid key on PCIXCC/CEX2C\n");
+                       return -EINVAL;
+               }
                PRINTK("Unknown service rc/rs (PCIXCC/CEX2C): %d/%d\n",
                       service_rc, service_rs);
                zdev->online = 0;