From: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Date: Mon, 2 Feb 2015 16:50:17 +0000 (+0100)
Subject: s390/zcrypt: fixed domain scanning problem (again)
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea96f78813823ab186e7e52122c06fb9c3cf6e20;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

s390/zcrypt: fixed domain scanning problem (again)

Older machines with more then 16 domains need a special check before
PQAP instructions can be processed. With commit 5bc334bff9a6e189 this
check was reverted by accident. This patch re-establishes the additional
code needed for checking the extended domains for older machines.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index a60fc2f9f4b2..3d7f19fb9a4e 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1060,9 +1060,13 @@ static inline int ap_test_config_card_id(unsigned int id)
  */
 static inline int ap_test_config_domain(unsigned int domain)
 {
-	if (!ap_configuration)
-		return 1;
-	return ap_test_config(ap_configuration->aqm, domain);
+	if (!ap_configuration)	  /* QCI not supported */
+		if (domain < 16)
+			return 1; /* then domains 0...15 are configured */
+		else
+			return 0;
+	else
+		return ap_test_config(ap_configuration->aqm, domain);
 }
 
 /*