Skip to content

Commit

Permalink
[S390] zcrypt: fix PCIXCC/CEX2C error recovery
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ralph Wuerthner authored and Martin Schwidefsky committed Oct 12, 2007
1 parent 39aa7cf commit 2af4808
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/s390/crypto/zcrypt_pcixcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2af4808

Please sign in to comment.