linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] crypto: caam: Error reporting fixes
@ 2014-04-24 18:05 Marek Vasut
  2014-04-24 18:05 ` [PATCH 01/11] crypto: caam: Contain caam_jr_strstatus() ugliness Marek Vasut
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

First stab at reworking the error.c thing in Freescale CAAM.
This patchset cleans it up so it's not doing any too insane
string messing anymore.

NOTE: Can someone please test this on real hardware? I have
      none at hand, so THIS IS COMPILE-TESTED ONLY!

Marek Vasut (11):
  crypto: caam: Contain caam_jr_strstatus() ugliness
  crypto: caam: Pull all the error codes out
  crypto: caam: Implement fast-path for error codes with no handler
  crypto: caam: Pass error type into the functions
  crypto: caam: Kill the easy targets
  crypto: caam: Dissolve report_jump_idx()
  crypto: caam: Clean up report_ccb_status()
  crypto: caam: Clean up report_deco_status()
  crypto: caam: Kill SPRINTFCAT() with fire
  crypto: caam: Sweep the remnants
  crypto: caam: Fix the 'quoted string split across lines'

 drivers/crypto/caam/caamalg.c  |  28 +--
 drivers/crypto/caam/caamhash.c |  28 +--
 drivers/crypto/caam/caamrng.c  |   7 +-
 drivers/crypto/caam/error.c    | 389 +++++++++++++++++++----------------------
 drivers/crypto/caam/error.h    |   2 +-
 drivers/crypto/caam/key_gen.c  |   7 +-
 6 files changed, 200 insertions(+), 261 deletions(-)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>

-- 
1.9.2

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/11] crypto: caam: Contain caam_jr_strstatus() ugliness
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 02/11] crypto: caam: Pull all the error codes out Marek Vasut
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

The tentacles of this function were firmly attached to various
places in the CAAM code. Just cut them, or this cthulhu function
will sprout them anew.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/caamalg.c  | 28 ++++++++--------------------
 drivers/crypto/caam/caamhash.c | 28 ++++++++--------------------
 drivers/crypto/caam/caamrng.c  |  7 ++-----
 drivers/crypto/caam/error.c    |  5 +++--
 drivers/crypto/caam/error.h    |  2 +-
 drivers/crypto/caam/key_gen.c  |  7 ++-----
 6 files changed, 24 insertions(+), 53 deletions(-)

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 5f89125..339277c7 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -918,11 +918,8 @@ static void aead_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
 	edesc = (struct aead_edesc *)((char *)desc -
 		 offsetof(struct aead_edesc, hw_desc));
 
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	aead_unmap(jrdev, edesc, req);
 
@@ -969,11 +966,8 @@ static void aead_decrypt_done(struct device *jrdev, u32 *desc, u32 err,
 		       req->cryptlen - ctx->authsize, 1);
 #endif
 
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	aead_unmap(jrdev, edesc, req);
 
@@ -1018,11 +1012,8 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
 	edesc = (struct ablkcipher_edesc *)((char *)desc -
 		 offsetof(struct ablkcipher_edesc, hw_desc));
 
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 #ifdef DEBUG
 	print_hex_dump(KERN_ERR, "dstiv  @"__stringify(__LINE__)": ",
@@ -1053,11 +1044,8 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err,
 
 	edesc = (struct ablkcipher_edesc *)((char *)desc -
 		 offsetof(struct ablkcipher_edesc, hw_desc));
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 #ifdef DEBUG
 	print_hex_dump(KERN_ERR, "dstiv  @"__stringify(__LINE__)": ",
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index 0378328..430df39 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -631,11 +631,8 @@ static void ahash_done(struct device *jrdev, u32 *desc, u32 err,
 
 	edesc = (struct ahash_edesc *)((char *)desc -
 		 offsetof(struct ahash_edesc, hw_desc));
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	ahash_unmap(jrdev, edesc, req, digestsize);
 	kfree(edesc);
@@ -669,11 +666,8 @@ static void ahash_done_bi(struct device *jrdev, u32 *desc, u32 err,
 
 	edesc = (struct ahash_edesc *)((char *)desc -
 		 offsetof(struct ahash_edesc, hw_desc));
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_BIDIRECTIONAL);
 	kfree(edesc);
@@ -707,11 +701,8 @@ static void ahash_done_ctx_src(struct device *jrdev, u32 *desc, u32 err,
 
 	edesc = (struct ahash_edesc *)((char *)desc -
 		 offsetof(struct ahash_edesc, hw_desc));
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	ahash_unmap_ctx(jrdev, edesc, req, digestsize, DMA_FROM_DEVICE);
 	kfree(edesc);
@@ -745,11 +736,8 @@ static void ahash_done_ctx_dst(struct device *jrdev, u32 *desc, u32 err,
 
 	edesc = (struct ahash_edesc *)((char *)desc -
 		 offsetof(struct ahash_edesc, hw_desc));
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_TO_DEVICE);
 	kfree(edesc);
diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
index 3529b54..8c07d31 100644
--- a/drivers/crypto/caam/caamrng.c
+++ b/drivers/crypto/caam/caamrng.c
@@ -103,11 +103,8 @@ static void rng_done(struct device *jrdev, u32 *desc, u32 err, void *context)
 	bd = (struct buf_data *)((char *)desc -
 	      offsetof(struct buf_data, hw_desc));
 
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(jrdev, err);
 
 	atomic_set(&bd->empty, BUF_NOT_EMPTY);
 	complete(&bd->filled);
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 9f25f52..ba426d9 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -243,8 +243,9 @@ static void report_cond_code_status(u32 status, char *outstr)
 	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
 }
 
-char *caam_jr_strstatus(char *outstr, u32 status)
+void caam_jr_strstatus(struct device *jrdev, u32 status)
 {
+	char outstr[CAAM_ERROR_STR_MAX];
 	static const struct stat_src {
 		void (*report_ssed)(u32 status, char *outstr);
 		char *error;
@@ -265,6 +266,6 @@ char *caam_jr_strstatus(char *outstr, u32 status)
 	if (status_src[ssrc].report_ssed)
 		status_src[ssrc].report_ssed(status, outstr);
 
-	return outstr;
+	dev_err(jrdev, "%08x: %s\n", status, outstr);
 }
 EXPORT_SYMBOL(caam_jr_strstatus);
diff --git a/drivers/crypto/caam/error.h b/drivers/crypto/caam/error.h
index 02c7baa..b6350b0 100644
--- a/drivers/crypto/caam/error.h
+++ b/drivers/crypto/caam/error.h
@@ -7,5 +7,5 @@
 #ifndef CAAM_ERROR_H
 #define CAAM_ERROR_H
 #define CAAM_ERROR_STR_MAX 302
-extern char *caam_jr_strstatus(char *outstr, u32 status);
+void caam_jr_strstatus(struct device *jrdev, u32 status);
 #endif /* CAAM_ERROR_H */
diff --git a/drivers/crypto/caam/key_gen.c b/drivers/crypto/caam/key_gen.c
index ea2e406..871703c 100644
--- a/drivers/crypto/caam/key_gen.c
+++ b/drivers/crypto/caam/key_gen.c
@@ -19,11 +19,8 @@ void split_key_done(struct device *dev, u32 *desc, u32 err,
 	dev_err(dev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
 #endif
 
-	if (err) {
-		char tmp[CAAM_ERROR_STR_MAX];
-
-		dev_err(dev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
-	}
+	if (err)
+		caam_jr_strstatus(dev, err);
 
 	res->err = err;
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/11] crypto: caam: Pull all the error codes out
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
  2014-04-24 18:05 ` [PATCH 01/11] crypto: caam: Contain caam_jr_strstatus() ugliness Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 03/11] crypto: caam: Implement fast-path for error codes with no handler Marek Vasut
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Pull the error code <-> error string mapping tables out of the function
so the code becomes readable. This lets me see the real flesh of the
functions, without all that flab clouding the view.

Note: There is a checkpatch issue with quoted strings across multiple
      lines. I will fix that in a subsequent patch to keep the changes
      small and separate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 290 ++++++++++++++++++++++----------------------
 1 file changed, 147 insertions(+), 143 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index ba426d9..3d7be4c 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -11,6 +11,153 @@
 #include "jr.h"
 #include "error.h"
 
+static const struct {
+	u8 value;
+	char *error_text;
+} desc_error_list[] = {
+	{ 0x00, "No error." },
+	{ 0x01, "SGT Length Error. The descriptor is trying to read "
+		"more data than is contained in the SGT table." },
+	{ 0x02, "SGT Null Entry Error." },
+	{ 0x03, "Job Ring Control Error. There is a bad value in the "
+		"Job Ring Control register." },
+	{ 0x04, "Invalid Descriptor Command. The Descriptor Command "
+		"field is invalid." },
+	{ 0x05, "Reserved." },
+	{ 0x06, "Invalid KEY Command" },
+	{ 0x07, "Invalid LOAD Command" },
+	{ 0x08, "Invalid STORE Command" },
+	{ 0x09, "Invalid OPERATION Command" },
+	{ 0x0A, "Invalid FIFO LOAD Command" },
+	{ 0x0B, "Invalid FIFO STORE Command" },
+	{ 0x0C, "Invalid MOVE/MOVE_LEN Command" },
+	{ 0x0D, "Invalid JUMP Command. A nonlocal JUMP Command is "
+		"invalid because the target is not a Job Header "
+		"Command, or the jump is from a Trusted Descriptor to "
+		"a Job Descriptor, or because the target Descriptor "
+		"contains a Shared Descriptor." },
+	{ 0x0E, "Invalid MATH Command" },
+	{ 0x0F, "Invalid SIGNATURE Command" },
+	{ 0x10, "Invalid Sequence Command. A SEQ IN PTR OR SEQ OUT PTR "
+		"Command is invalid or a SEQ KEY, SEQ LOAD, SEQ FIFO "
+		"LOAD, or SEQ FIFO STORE decremented the input or "
+		"output sequence length below 0. This error may result "
+		"if a built-in PROTOCOL Command has encountered a "
+		"malformed PDU." },
+	{ 0x11, "Skip data type invalid. The type must be 0xE or 0xF."},
+	{ 0x12, "Shared Descriptor Header Error" },
+	{ 0x13, "Header Error. Invalid length or parity, or certain "
+		"other problems." },
+	{ 0x14, "Burster Error. Burster has gotten to an illegal "
+		"state" },
+	{ 0x15, "Context Register Length Error. The descriptor is "
+		"trying to read or write past the end of the Context "
+		"Register. A SEQ LOAD or SEQ STORE with the VLF bit "
+		"set was executed with too large a length in the "
+		"variable length register (VSOL for SEQ STORE or VSIL "
+		"for SEQ LOAD)." },
+	{ 0x16, "DMA Error" },
+	{ 0x17, "Reserved." },
+	{ 0x1A, "Job failed due to JR reset" },
+	{ 0x1B, "Job failed due to Fail Mode" },
+	{ 0x1C, "DECO Watchdog timer timeout error" },
+	{ 0x1D, "DECO tried to copy a key from another DECO but the "
+		"other DECO's Key Registers were locked" },
+	{ 0x1E, "DECO attempted to copy data from a DECO that had an "
+		"unmasked Descriptor error" },
+	{ 0x1F, "LIODN error. DECO was trying to share from itself or "
+		"from another DECO but the two Non-SEQ LIODN values "
+		"didn't match or the 'shared from' DECO's Descriptor "
+		"required that the SEQ LIODNs be the same and they "
+		"aren't." },
+	{ 0x20, "DECO has completed a reset initiated via the DRR "
+		"register" },
+	{ 0x21, "Nonce error. When using EKT (CCM) key encryption "
+		"option in the FIFO STORE Command, the Nonce counter "
+		"reached its maximum value and this encryption mode "
+		"can no longer be used." },
+	{ 0x22, "Meta data is too large (> 511 bytes) for TLS decap "
+		"(input frame; block ciphers) and IPsec decap (output "
+		"frame, when doing the next header byte update) and "
+		"DCRC (output frame)." },
+	{ 0x23, "Read Input Frame error" },
+	{ 0x24, "JDKEK, TDKEK or TDSK not loaded error" },
+	{ 0x80, "DNR (do not run) error" },
+	{ 0x81, "undefined protocol command" },
+	{ 0x82, "invalid setting in PDB" },
+	{ 0x83, "Anti-replay LATE error" },
+	{ 0x84, "Anti-replay REPLAY error" },
+	{ 0x85, "Sequence number overflow" },
+	{ 0x86, "Sigver invalid signature" },
+	{ 0x87, "DSA Sign Illegal test descriptor" },
+	{ 0x88, "Protocol Format Error - A protocol has seen an error "
+		"in the format of data received. When running RSA, "
+		"this means that formatting with random padding was "
+		"used, and did not follow the form: 0x00, 0x02, 8-to-N "
+		"bytes of non-zero pad, 0x00, F data." },
+	{ 0x89, "Protocol Size Error - A protocol has seen an error in "
+		"size. When running RSA, pdb size N < (size of F) when "
+		"no formatting is used; or pdb size N < (F + 11) when "
+		"formatting is used." },
+	{ 0xC1, "Blob Command error: Undefined mode" },
+	{ 0xC2, "Blob Command error: Secure Memory Blob mode error" },
+	{ 0xC4, "Blob Command error: Black Blob key or input size "
+		"error" },
+	{ 0xC5, "Blob Command error: Invalid key destination" },
+	{ 0xC8, "Blob Command error: Trusted/Secure mode error" },
+	{ 0xF0, "IPsec TTL or hop limit field either came in as 0, "
+		"or was decremented to 0" },
+	{ 0xF1, "3GPP HFN matches or exceeds the Threshold" },
+};
+
+static const char * const cha_id_list[] = {
+	"",
+	"AES",
+	"DES",
+	"ARC4",
+	"MDHA",
+	"RNG",
+	"SNOW f8",
+	"Kasumi f8/9",
+	"PKHA",
+	"CRCA",
+	"SNOW f9",
+	"ZUCE",
+	"ZUCA",
+};
+
+static const char * const err_id_list[] = {
+	"No error.",
+	"Mode error.",
+	"Data size error.",
+	"Key size error.",
+	"PKHA A memory size error.",
+	"PKHA B memory size error.",
+	"Data arrived out of sequence error.",
+	"PKHA divide-by-zero error.",
+	"PKHA modulus even error.",
+	"DES key parity error.",
+	"ICV check failed.",
+	"Hardware error.",
+	"Unsupported CCM AAD size.",
+	"Class 1 CHA is not reset",
+	"Invalid CHA combination was selected",
+	"Invalid CHA selected.",
+};
+
+static const char * const rng_err_id_list[] = {
+	"",
+	"",
+	"",
+	"Instantiate",
+	"Not instantiated",
+	"Test instantiate",
+	"Prediction resistance",
+	"Prediction resistance and test request",
+	"Uninstantiate",
+	"Secure key generation",
+};
+
 #define SPRINTFCAT(str, format, param, max_alloc)		\
 {								\
 	char *tmp;						\
@@ -36,51 +183,6 @@ static void report_jump_idx(u32 status, char *outstr)
 
 static void report_ccb_status(u32 status, char *outstr)
 {
-	static const char * const cha_id_list[] = {
-		"",
-		"AES",
-		"DES",
-		"ARC4",
-		"MDHA",
-		"RNG",
-		"SNOW f8",
-		"Kasumi f8/9",
-		"PKHA",
-		"CRCA",
-		"SNOW f9",
-		"ZUCE",
-		"ZUCA",
-	};
-	static const char * const err_id_list[] = {
-		"No error.",
-		"Mode error.",
-		"Data size error.",
-		"Key size error.",
-		"PKHA A memory size error.",
-		"PKHA B memory size error.",
-		"Data arrived out of sequence error.",
-		"PKHA divide-by-zero error.",
-		"PKHA modulus even error.",
-		"DES key parity error.",
-		"ICV check failed.",
-		"Hardware error.",
-		"Unsupported CCM AAD size.",
-		"Class 1 CHA is not reset",
-		"Invalid CHA combination was selected",
-		"Invalid CHA selected.",
-	};
-	static const char * const rng_err_id_list[] = {
-		"",
-		"",
-		"",
-		"Instantiate",
-		"Not instantiated",
-		"Test instantiate",
-		"Prediction resistance",
-		"Prediction resistance and test request",
-		"Uninstantiate",
-		"Secure key generation",
-	};
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
 	u8 err_id = status & JRSTA_CCBERR_ERRID_MASK;
@@ -117,104 +219,6 @@ static void report_jump_status(u32 status, char *outstr)
 
 static void report_deco_status(u32 status, char *outstr)
 {
-	static const struct {
-		u8 value;
-		char *error_text;
-	} desc_error_list[] = {
-		{ 0x00, "No error." },
-		{ 0x01, "SGT Length Error. The descriptor is trying to read "
-			"more data than is contained in the SGT table." },
-		{ 0x02, "SGT Null Entry Error." },
-		{ 0x03, "Job Ring Control Error. There is a bad value in the "
-			"Job Ring Control register." },
-		{ 0x04, "Invalid Descriptor Command. The Descriptor Command "
-			"field is invalid." },
-		{ 0x05, "Reserved." },
-		{ 0x06, "Invalid KEY Command" },
-		{ 0x07, "Invalid LOAD Command" },
-		{ 0x08, "Invalid STORE Command" },
-		{ 0x09, "Invalid OPERATION Command" },
-		{ 0x0A, "Invalid FIFO LOAD Command" },
-		{ 0x0B, "Invalid FIFO STORE Command" },
-		{ 0x0C, "Invalid MOVE/MOVE_LEN Command" },
-		{ 0x0D, "Invalid JUMP Command. A nonlocal JUMP Command is "
-			"invalid because the target is not a Job Header "
-			"Command, or the jump is from a Trusted Descriptor to "
-			"a Job Descriptor, or because the target Descriptor "
-			"contains a Shared Descriptor." },
-		{ 0x0E, "Invalid MATH Command" },
-		{ 0x0F, "Invalid SIGNATURE Command" },
-		{ 0x10, "Invalid Sequence Command. A SEQ IN PTR OR SEQ OUT PTR "
-			"Command is invalid or a SEQ KEY, SEQ LOAD, SEQ FIFO "
-			"LOAD, or SEQ FIFO STORE decremented the input or "
-			"output sequence length below 0. This error may result "
-			"if a built-in PROTOCOL Command has encountered a "
-			"malformed PDU." },
-		{ 0x11, "Skip data type invalid. The type must be 0xE or 0xF."},
-		{ 0x12, "Shared Descriptor Header Error" },
-		{ 0x13, "Header Error. Invalid length or parity, or certain "
-			"other problems." },
-		{ 0x14, "Burster Error. Burster has gotten to an illegal "
-			"state" },
-		{ 0x15, "Context Register Length Error. The descriptor is "
-			"trying to read or write past the end of the Context "
-			"Register. A SEQ LOAD or SEQ STORE with the VLF bit "
-			"set was executed with too large a length in the "
-			"variable length register (VSOL for SEQ STORE or VSIL "
-			"for SEQ LOAD)." },
-		{ 0x16, "DMA Error" },
-		{ 0x17, "Reserved." },
-		{ 0x1A, "Job failed due to JR reset" },
-		{ 0x1B, "Job failed due to Fail Mode" },
-		{ 0x1C, "DECO Watchdog timer timeout error" },
-		{ 0x1D, "DECO tried to copy a key from another DECO but the "
-			"other DECO's Key Registers were locked" },
-		{ 0x1E, "DECO attempted to copy data from a DECO that had an "
-			"unmasked Descriptor error" },
-		{ 0x1F, "LIODN error. DECO was trying to share from itself or "
-			"from another DECO but the two Non-SEQ LIODN values "
-			"didn't match or the 'shared from' DECO's Descriptor "
-			"required that the SEQ LIODNs be the same and they "
-			"aren't." },
-		{ 0x20, "DECO has completed a reset initiated via the DRR "
-			"register" },
-		{ 0x21, "Nonce error. When using EKT (CCM) key encryption "
-			"option in the FIFO STORE Command, the Nonce counter "
-			"reached its maximum value and this encryption mode "
-			"can no longer be used." },
-		{ 0x22, "Meta data is too large (> 511 bytes) for TLS decap "
-			"(input frame; block ciphers) and IPsec decap (output "
-			"frame, when doing the next header byte update) and "
-			"DCRC (output frame)." },
-		{ 0x23, "Read Input Frame error" },
-		{ 0x24, "JDKEK, TDKEK or TDSK not loaded error" },
-		{ 0x80, "DNR (do not run) error" },
-		{ 0x81, "undefined protocol command" },
-		{ 0x82, "invalid setting in PDB" },
-		{ 0x83, "Anti-replay LATE error" },
-		{ 0x84, "Anti-replay REPLAY error" },
-		{ 0x85, "Sequence number overflow" },
-		{ 0x86, "Sigver invalid signature" },
-		{ 0x87, "DSA Sign Illegal test descriptor" },
-		{ 0x88, "Protocol Format Error - A protocol has seen an error "
-			"in the format of data received. When running RSA, "
-			"this means that formatting with random padding was "
-			"used, and did not follow the form: 0x00, 0x02, 8-to-N "
-			"bytes of non-zero pad, 0x00, F data." },
-		{ 0x89, "Protocol Size Error - A protocol has seen an error in "
-			"size. When running RSA, pdb size N < (size of F) when "
-			"no formatting is used; or pdb size N < (F + 11) when "
-			"formatting is used." },
-		{ 0xC1, "Blob Command error: Undefined mode" },
-		{ 0xC2, "Blob Command error: Secure Memory Blob mode error" },
-		{ 0xC4, "Blob Command error: Black Blob key or input size "
-			"error" },
-		{ 0xC5, "Blob Command error: Invalid key destination" },
-		{ 0xC8, "Blob Command error: Trusted/Secure mode error" },
-		{ 0xF0, "IPsec TTL or hop limit field either came in as 0, "
-			"or was decremented to 0" },
-		{ 0xF1, "3GPP HFN matches or exceeds the Threshold" },
-	};
 	u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK;
 	int i;
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/11] crypto: caam: Implement fast-path for error codes with no handler
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
  2014-04-24 18:05 ` [PATCH 01/11] crypto: caam: Contain caam_jr_strstatus() ugliness Marek Vasut
  2014-04-24 18:05 ` [PATCH 02/11] crypto: caam: Pull all the error codes out Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 04/11] crypto: caam: Pass error type into the functions Marek Vasut
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Implement fast-path error code printout for errors with no associated
handler function. This reduces calls to this kmalloc() nonsense in
SPRINTFCAT() already.

Note that the format of output is compatible with the old code, even
if -- exposed like this -- it looks a bit weird. Checkpatch complains
on this one as well.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 3d7be4c..961331d 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -265,10 +265,18 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
 	};
 	u32 ssrc = status >> JRSTA_SSRC_SHIFT;
 
+	/*
+	 * If there is no further error handling function, just
+	 * print the error code, error string and exit.
+	 */
+	if (!status_src[ssrc].report_ssed) {
+		dev_err(jrdev, "%08x: %s: \n", status, status_src[ssrc].error);
+		return;
+	}
+
 	sprintf(outstr, "%s: ", status_src[ssrc].error);
 
-	if (status_src[ssrc].report_ssed)
-		status_src[ssrc].report_ssed(status, outstr);
+	status_src[ssrc].report_ssed(status, outstr);
 
 	dev_err(jrdev, "%08x: %s\n", status, outstr);
 }
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/11] crypto: caam: Pass error type into the functions
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (2 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 03/11] crypto: caam: Implement fast-path for error codes with no handler Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 05/11] crypto: caam: Kill the easy targets Marek Vasut
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Pass the error type string into the functions, so they can handle
the printing of the string. This is now still using the very unsafe
sprintf(), but we will fix that.

While at this, pass the device pointer too, so we can dev_err()
functions readily when we start fixing this proper.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 961331d..7ce1d03 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -181,12 +181,15 @@ static void report_jump_idx(u32 status, char *outstr)
 	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
 }
 
-static void report_ccb_status(u32 status, char *outstr)
+static void report_ccb_status(struct device *jrdev, u32 status,
+			      const char *error, char *outstr)
 {
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
 	u8 err_id = status & JRSTA_CCBERR_ERRID_MASK;
 
+	sprintf(outstr, "%s: ", error);
+
 	report_jump_idx(status, outstr);
 
 	if (cha_id < ARRAY_SIZE(cha_id_list)) {
@@ -212,15 +215,19 @@ static void report_ccb_status(u32 status, char *outstr)
 	}
 }
 
-static void report_jump_status(u32 status, char *outstr)
+static void report_jump_status(struct device *jrdev, u32 status,
+			       const char *error, char *outstr)
 {
+	sprintf(outstr, "%s: ", error);
 	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
 }
 
-static void report_deco_status(u32 status, char *outstr)
+static void report_deco_status(struct device *jrdev, u32 status,
+			       const char *error, char *outstr)
 {
 	u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK;
 	int i;
+	sprintf(outstr, "%s: ", error);
 
 	report_jump_idx(status, outstr);
 
@@ -237,13 +244,17 @@ static void report_deco_status(u32 status, char *outstr)
 	}
 }
 
-static void report_jr_status(u32 status, char *outstr)
+static void report_jr_status(struct device *jrdev, u32 status,
+			     const char *error, char *outstr)
 {
+	sprintf(outstr, "%s: ", error);
 	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
 }
 
-static void report_cond_code_status(u32 status, char *outstr)
+static void report_cond_code_status(struct device *jrdev, u32 status,
+				    const char *error, char *outstr)
 {
+	sprintf(outstr, "%s: ", error);
 	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
 }
 
@@ -251,8 +262,9 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
 {
 	char outstr[CAAM_ERROR_STR_MAX];
 	static const struct stat_src {
-		void (*report_ssed)(u32 status, char *outstr);
-		char *error;
+		void (*report_ssed)(struct device *jrdev, u32 status,
+				    const char *error, char *outstr);
+		const char *error;
 	} status_src[] = {
 		{ NULL, "No error" },
 		{ NULL, NULL },
@@ -274,9 +286,8 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
 		return;
 	}
 
-	sprintf(outstr, "%s: ", status_src[ssrc].error);
-
-	status_src[ssrc].report_ssed(status, outstr);
+	status_src[ssrc].report_ssed(jrdev, status,
+			status_src[ssrc].error, outstr);
 
 	dev_err(jrdev, "%08x: %s\n", status, outstr);
 }
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/11] crypto: caam: Kill the easy targets
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (3 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 04/11] crypto: caam: Pass error type into the functions Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 06/11] crypto: caam: Dissolve report_jump_idx() Marek Vasut
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Fix the functions which can be obviously done right with a simple
dev_err() now. While at it, further press the on-stack allocation
of buffer for sprintf() voodoo down into the abominated functions.

This patch cleans up most of the functions and leaves just two
remaining functions, report_ccb_status() and report_deco_status()
ugly and unhappy.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 7ce1d03..a8736abd7 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -182,8 +182,10 @@ static void report_jump_idx(u32 status, char *outstr)
 }
 
 static void report_ccb_status(struct device *jrdev, u32 status,
-			      const char *error, char *outstr)
+			      const char *error, char *__outstr)
 {
+	char outstr[CAAM_ERROR_STR_MAX];
+
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
 	u8 err_id = status & JRSTA_CCBERR_ERRID_MASK;
@@ -213,18 +215,22 @@ static void report_ccb_status(struct device *jrdev, u32 status,
 		SPRINTFCAT(outstr, "unidentified err_id value 0x%02x",
 			   err_id, sizeof("ff"));
 	}
+
+	dev_err(jrdev, "%08x: %s\n", status, outstr);
 }
 
 static void report_jump_status(struct device *jrdev, u32 status,
 			       const char *error, char *outstr)
 {
-	sprintf(outstr, "%s: ", error);
-	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
+	dev_err(jrdev, "%08x: %s: %s() not implemented\n",
+		status, error, __func__);
 }
 
 static void report_deco_status(struct device *jrdev, u32 status,
-			       const char *error, char *outstr)
+			       const char *error, char *__outstr)
 {
+	char outstr[CAAM_ERROR_STR_MAX];
+
 	u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK;
 	int i;
 	sprintf(outstr, "%s: ", error);
@@ -242,25 +248,26 @@ static void report_deco_status(struct device *jrdev, u32 status,
 		SPRINTFCAT(outstr, "unidentified error value 0x%02x",
 			   desc_error, sizeof("ff"));
 	}
+
+	dev_err(jrdev, "%08x: %s\n", status, outstr);
 }
 
 static void report_jr_status(struct device *jrdev, u32 status,
 			     const char *error, char *outstr)
 {
-	sprintf(outstr, "%s: ", error);
-	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
+	dev_err(jrdev, "%08x: %s: %s() not implemented\n",
+		status, error, __func__);
 }
 
 static void report_cond_code_status(struct device *jrdev, u32 status,
 				    const char *error, char *outstr)
 {
-	sprintf(outstr, "%s: ", error);
-	SPRINTFCAT(outstr, "%s() not implemented", __func__, sizeof(__func__));
+	dev_err(jrdev, "%08x: %s: %s() not implemented\n",
+		status, error, __func__);
 }
 
 void caam_jr_strstatus(struct device *jrdev, u32 status)
 {
-	char outstr[CAAM_ERROR_STR_MAX];
 	static const struct stat_src {
 		void (*report_ssed)(struct device *jrdev, u32 status,
 				    const char *error, char *outstr);
@@ -287,8 +294,6 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
 	}
 
 	status_src[ssrc].report_ssed(jrdev, status,
-			status_src[ssrc].error, outstr);
-
-	dev_err(jrdev, "%08x: %s\n", status, outstr);
+			status_src[ssrc].error, NULL);
 }
 EXPORT_SYMBOL(caam_jr_strstatus);
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/11] crypto: caam: Dissolve report_jump_idx()
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (4 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 05/11] crypto: caam: Kill the easy targets Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 07/11] crypto: caam: Clean up report_ccb_status() Marek Vasut
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Just dissolve this function so it's not in the way of applying
further white magic cleanup down the line.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index a8736abd7..aa7d5cf 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -168,19 +168,6 @@ static const char * const rng_err_id_list[] = {
 	kfree(tmp);						\
 }
 
-static void report_jump_idx(u32 status, char *outstr)
-{
-	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
-		  JRSTA_DECOERR_INDEX_SHIFT;
-
-	if (status & JRSTA_DECOERR_JUMP)
-		strcat(outstr, "jump tgt desc idx ");
-	else
-		strcat(outstr, "desc idx ");
-
-	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
-}
-
 static void report_ccb_status(struct device *jrdev, u32 status,
 			      const char *error, char *__outstr)
 {
@@ -189,10 +176,17 @@ static void report_ccb_status(struct device *jrdev, u32 status,
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
 	u8 err_id = status & JRSTA_CCBERR_ERRID_MASK;
+	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
+		  JRSTA_DECOERR_INDEX_SHIFT;
 
 	sprintf(outstr, "%s: ", error);
 
-	report_jump_idx(status, outstr);
+	if (status & JRSTA_DECOERR_JUMP)
+		strcat(outstr, "jump tgt desc idx ");
+	else
+		strcat(outstr, "desc idx ");
+
+	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
 
 	if (cha_id < ARRAY_SIZE(cha_id_list)) {
 		SPRINTFCAT(outstr, "%s: ", cha_id_list[cha_id],
@@ -232,10 +226,18 @@ static void report_deco_status(struct device *jrdev, u32 status,
 	char outstr[CAAM_ERROR_STR_MAX];
 
 	u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK;
+	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
+		  JRSTA_DECOERR_INDEX_SHIFT;
+
 	int i;
 	sprintf(outstr, "%s: ", error);
 
-	report_jump_idx(status, outstr);
+	if (status & JRSTA_DECOERR_JUMP)
+		strcat(outstr, "jump tgt desc idx ");
+	else
+		strcat(outstr, "desc idx ");
+
+	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
 
 	for (i = 0; i < ARRAY_SIZE(desc_error_list); i++)
 		if (desc_error_list[i].value == desc_error)
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/11] crypto: caam: Clean up report_ccb_status()
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (5 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 06/11] crypto: caam: Dissolve report_jump_idx() Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 08/11] crypto: caam: Clean up report_deco_status() Marek Vasut
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Clean this function up and rework it into sensible shape. This function
now contains one single dev_err() instead of the previous insanity full
of memory allocation, possible stack overwriting, chaotic string handling
and use of SPRINTFCAT().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 45 ++++++++++++++++++++-------------------------
 1 file changed, 20 insertions(+), 25 deletions(-)

NOTE: This one I am unsure about. This _should_ work with me printing
      the numeric codes into $cha_err_code, $err_err_code using snprintf(),
      but please verify thoroughly.

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index aa7d5cf..91cc5fc 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -171,46 +171,41 @@ static const char * const rng_err_id_list[] = {
 static void report_ccb_status(struct device *jrdev, u32 status,
 			      const char *error, char *__outstr)
 {
-	char outstr[CAAM_ERROR_STR_MAX];
-
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
 	u8 err_id = status & JRSTA_CCBERR_ERRID_MASK;
 	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
 		  JRSTA_DECOERR_INDEX_SHIFT;
-
-	sprintf(outstr, "%s: ", error);
+	char *idx_str;
+	const char *cha_str = "unidentified cha_id value 0x";
+	char cha_err_code[3] = { 0 };
+	const char *err_str = "unidentified err_id value 0x";
+	char err_err_code[3] = { 0 };
 
 	if (status & JRSTA_DECOERR_JUMP)
-		strcat(outstr, "jump tgt desc idx ");
+		idx_str = "jump tgt desc idx";
 	else
-		strcat(outstr, "desc idx ");
-
-	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
+		idx_str = "desc idx";
 
-	if (cha_id < ARRAY_SIZE(cha_id_list)) {
-		SPRINTFCAT(outstr, "%s: ", cha_id_list[cha_id],
-			   strlen(cha_id_list[cha_id]));
-	} else {
-		SPRINTFCAT(outstr, "unidentified cha_id value 0x%02x: ",
-			   cha_id, sizeof("ff"));
-	}
+	if (cha_id < ARRAY_SIZE(cha_id_list))
+		cha_str = cha_id_list[cha_id];
+	else
+		snprintf(cha_err_code, sizeof(cha_err_code), "%02x", cha_id);
 
 	if ((cha_id << JRSTA_CCBERR_CHAID_SHIFT) == JRSTA_CCBERR_CHAID_RNG &&
 	    err_id < ARRAY_SIZE(rng_err_id_list) &&
 	    strlen(rng_err_id_list[err_id])) {
 		/* RNG-only error */
-		SPRINTFCAT(outstr, "%s", rng_err_id_list[err_id],
-			   strlen(rng_err_id_list[err_id]));
-	} else if (err_id < ARRAY_SIZE(err_id_list)) {
-		SPRINTFCAT(outstr, "%s", err_id_list[err_id],
-			   strlen(err_id_list[err_id]));
-	} else {
-		SPRINTFCAT(outstr, "unidentified err_id value 0x%02x",
-			   err_id, sizeof("ff"));
-	}
+		err_str = rng_err_id_list[err_id];
+	} else if (err_id < ARRAY_SIZE(err_id_list))
+		err_str = err_id_list[err_id];
+	else
+		snprintf(err_err_code, sizeof(err_err_code), "%02x", err_id);
 
-	dev_err(jrdev, "%08x: %s\n", status, outstr);
+	dev_err(jrdev, "%08x: %s: %s %d: %s%s: %s%s\n",
+		status, error, idx_str, idx,
+		cha_str, cha_err_code,
+		err_str, err_err_code);
 }
 
 static void report_jump_status(struct device *jrdev, u32 status,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/11] crypto: caam: Clean up report_deco_status()
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (6 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 07/11] crypto: caam: Clean up report_ccb_status() Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 09/11] crypto: caam: Kill SPRINTFCAT() with fire Marek Vasut
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Clean this function up and rework it into sensible shape. This function
now contains one single dev_err() instead of the previous insanity full
of memory allocation, chaotic string handling and use of SPRINTFCAT().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

NOTE: This one I am unsure about. This _should_ work with me printing
      the numeric codes into $cha_err_code, $err_err_code using snprintf(),
      but please verify thoroughly.

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 91cc5fc..66a7461 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -218,35 +218,30 @@ static void report_jump_status(struct device *jrdev, u32 status,
 static void report_deco_status(struct device *jrdev, u32 status,
 			       const char *error, char *__outstr)
 {
-	char outstr[CAAM_ERROR_STR_MAX];
-
-	u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK;
+	u8 err_id = status & JRSTA_DECOERR_ERROR_MASK;
 	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
 		  JRSTA_DECOERR_INDEX_SHIFT;
-
+	char *idx_str;
+	char *err_str = "unidentified error value 0x";
+	char err_err_code[3] = { 0 };
 	int i;
-	sprintf(outstr, "%s: ", error);
 
 	if (status & JRSTA_DECOERR_JUMP)
-		strcat(outstr, "jump tgt desc idx ");
+		idx_str = "jump tgt desc idx";
 	else
-		strcat(outstr, "desc idx ");
-
-	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
+		idx_str = "desc idx";
 
 	for (i = 0; i < ARRAY_SIZE(desc_error_list); i++)
-		if (desc_error_list[i].value == desc_error)
+		if (desc_error_list[i].value == err_id)
 			break;
 
-	if (i != ARRAY_SIZE(desc_error_list) && desc_error_list[i].error_text) {
-		SPRINTFCAT(outstr, "%s", desc_error_list[i].error_text,
-			   strlen(desc_error_list[i].error_text));
-	} else {
-		SPRINTFCAT(outstr, "unidentified error value 0x%02x",
-			   desc_error, sizeof("ff"));
-	}
+	if (i != ARRAY_SIZE(desc_error_list) && desc_error_list[i].error_text)
+		err_str = desc_error_list[i].error_text;
+	else
+		snprintf(err_err_code, sizeof(err_err_code), "%02x", err_id);
 
-	dev_err(jrdev, "%08x: %s\n", status, outstr);
+	dev_err(jrdev, "%08x: %s: %s %d: %s%s\n",
+		status, error, idx_str, idx, err_str, err_err_code);
 }
 
 static void report_jr_status(struct device *jrdev, u32 status,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/11] crypto: caam: Kill SPRINTFCAT() with fire
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (7 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 08/11] crypto: caam: Clean up report_deco_status() Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 10/11] crypto: caam: Sweep the remnants Marek Vasut
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

This macro is just like an encyclopedia of string handling done wrong.
This must die. This is so wrong on so many levels.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 66a7461..7ed2e4f 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -158,16 +158,6 @@ static const char * const rng_err_id_list[] = {
 	"Secure key generation",
 };
 
-#define SPRINTFCAT(str, format, param, max_alloc)		\
-{								\
-	char *tmp;						\
-								\
-	tmp = kmalloc(sizeof(format) + max_alloc, GFP_ATOMIC);	\
-	sprintf(tmp, format, param);				\
-	strcat(str, tmp);					\
-	kfree(tmp);						\
-}
-
 static void report_ccb_status(struct device *jrdev, u32 status,
 			      const char *error, char *__outstr)
 {
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/11] crypto: caam: Sweep the remnants
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (8 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 09/11] crypto: caam: Kill SPRINTFCAT() with fire Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-24 18:05 ` [PATCH 11/11] crypto: caam: Fix the 'quoted string split across lines' Marek Vasut
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Clean up the remnants from the rework. Constify function arguments.

Note that checkpatch again complains about this space before newline,
but this is the original code behavior, so I'm keeping it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 7ed2e4f..0f4725c 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -13,7 +13,7 @@
 
 static const struct {
 	u8 value;
-	char *error_text;
+	const char *error_text;
 } desc_error_list[] = {
 	{ 0x00, "No error." },
 	{ 0x01, "SGT Length Error. The descriptor is trying to read "
@@ -158,8 +158,8 @@ static const char * const rng_err_id_list[] = {
 	"Secure key generation",
 };
 
-static void report_ccb_status(struct device *jrdev, u32 status,
-			      const char *error, char *__outstr)
+static void report_ccb_status(struct device *jrdev, const u32 status,
+			      const char *error)
 {
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
@@ -198,21 +198,21 @@ static void report_ccb_status(struct device *jrdev, u32 status,
 		err_str, err_err_code);
 }
 
-static void report_jump_status(struct device *jrdev, u32 status,
-			       const char *error, char *outstr)
+static void report_jump_status(struct device *jrdev, const u32 status,
+			       const char *error)
 {
 	dev_err(jrdev, "%08x: %s: %s() not implemented\n",
 		status, error, __func__);
 }
 
-static void report_deco_status(struct device *jrdev, u32 status,
-			       const char *error, char *__outstr)
+static void report_deco_status(struct device *jrdev, const u32 status,
+			       const char *error)
 {
 	u8 err_id = status & JRSTA_DECOERR_ERROR_MASK;
 	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
 		  JRSTA_DECOERR_INDEX_SHIFT;
 	char *idx_str;
-	char *err_str = "unidentified error value 0x";
+	const char *err_str = "unidentified error value 0x";
 	char err_err_code[3] = { 0 };
 	int i;
 
@@ -234,15 +234,15 @@ static void report_deco_status(struct device *jrdev, u32 status,
 		status, error, idx_str, idx, err_str, err_err_code);
 }
 
-static void report_jr_status(struct device *jrdev, u32 status,
-			     const char *error, char *outstr)
+static void report_jr_status(struct device *jrdev, const u32 status,
+			     const char *error)
 {
 	dev_err(jrdev, "%08x: %s: %s() not implemented\n",
 		status, error, __func__);
 }
 
-static void report_cond_code_status(struct device *jrdev, u32 status,
-				    const char *error, char *outstr)
+static void report_cond_code_status(struct device *jrdev, const u32 status,
+				    const char *error)
 {
 	dev_err(jrdev, "%08x: %s: %s() not implemented\n",
 		status, error, __func__);
@@ -251,8 +251,8 @@ static void report_cond_code_status(struct device *jrdev, u32 status,
 void caam_jr_strstatus(struct device *jrdev, u32 status)
 {
 	static const struct stat_src {
-		void (*report_ssed)(struct device *jrdev, u32 status,
-				    const char *error, char *outstr);
+		void (*report_ssed)(struct device *jrdev, const u32 status,
+				    const char *error);
 		const char *error;
 	} status_src[] = {
 		{ NULL, "No error" },
@@ -265,17 +265,16 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
 		{ report_cond_code_status, "Condition Code" },
 	};
 	u32 ssrc = status >> JRSTA_SSRC_SHIFT;
+	const char *error = status_src[ssrc].error;
 
 	/*
 	 * If there is no further error handling function, just
-	 * print the error code, error string and exit.
+	 * print the error code, error string and exit. Otherwise
+	 * call the handler function.
 	 */
-	if (!status_src[ssrc].report_ssed) {
+	if (!status_src[ssrc].report_ssed)
 		dev_err(jrdev, "%08x: %s: \n", status, status_src[ssrc].error);
-		return;
-	}
-
-	status_src[ssrc].report_ssed(jrdev, status,
-			status_src[ssrc].error, NULL);
+	else
+		status_src[ssrc].report_ssed(jrdev, status, error);
 }
 EXPORT_SYMBOL(caam_jr_strstatus);
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/11] crypto: caam: Fix the 'quoted string split across lines'
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (9 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 10/11] crypto: caam: Sweep the remnants Marek Vasut
@ 2014-04-24 18:05 ` Marek Vasut
  2014-04-25 18:20 ` [PATCH 00/11] crypto: caam: Error reporting fixes Kees Cook
  2014-05-08 14:01 ` Herbert Xu
  12 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-04-24 18:05 UTC (permalink / raw)
  To: linux-crypto; +Cc: Marek Vasut, Herbert Xu, Horia Geanta

Fix the checkpatch warnings that the strings were split across
multiple lines. Checkpatch now complains about lines over 80,
but this is better, since we can actually grep the source code
for these strings now.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 77 +++++++++++----------------------------------
 1 file changed, 18 insertions(+), 59 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 0f4725c..6531054 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -16,13 +16,10 @@ static const struct {
 	const char *error_text;
 } desc_error_list[] = {
 	{ 0x00, "No error." },
-	{ 0x01, "SGT Length Error. The descriptor is trying to read "
-		"more data than is contained in the SGT table." },
+	{ 0x01, "SGT Length Error. The descriptor is trying to read more data than is contained in the SGT table." },
 	{ 0x02, "SGT Null Entry Error." },
-	{ 0x03, "Job Ring Control Error. There is a bad value in the "
-		"Job Ring Control register." },
-	{ 0x04, "Invalid Descriptor Command. The Descriptor Command "
-		"field is invalid." },
+	{ 0x03, "Job Ring Control Error. There is a bad value in the Job Ring Control register." },
+	{ 0x04, "Invalid Descriptor Command. The Descriptor Command field is invalid." },
 	{ 0x05, "Reserved." },
 	{ 0x06, "Invalid KEY Command" },
 	{ 0x07, "Invalid LOAD Command" },
@@ -31,55 +28,26 @@ static const struct {
 	{ 0x0A, "Invalid FIFO LOAD Command" },
 	{ 0x0B, "Invalid FIFO STORE Command" },
 	{ 0x0C, "Invalid MOVE/MOVE_LEN Command" },
-	{ 0x0D, "Invalid JUMP Command. A nonlocal JUMP Command is "
-		"invalid because the target is not a Job Header "
-		"Command, or the jump is from a Trusted Descriptor to "
-		"a Job Descriptor, or because the target Descriptor "
-		"contains a Shared Descriptor." },
+	{ 0x0D, "Invalid JUMP Command. A nonlocal JUMP Command is invalid because the target is not a Job Header Command, or the jump is from a Trusted Descriptor to a Job Descriptor, or because the target Descriptor contains a Shared Descriptor." },
 	{ 0x0E, "Invalid MATH Command" },
 	{ 0x0F, "Invalid SIGNATURE Command" },
-	{ 0x10, "Invalid Sequence Command. A SEQ IN PTR OR SEQ OUT PTR "
-		"Command is invalid or a SEQ KEY, SEQ LOAD, SEQ FIFO "
-		"LOAD, or SEQ FIFO STORE decremented the input or "
-		"output sequence length below 0. This error may result "
-		"if a built-in PROTOCOL Command has encountered a "
-		"malformed PDU." },
+	{ 0x10, "Invalid Sequence Command. A SEQ IN PTR OR SEQ OUT PTR Command is invalid or a SEQ KEY, SEQ LOAD, SEQ FIFO LOAD, or SEQ FIFO STORE decremented the input or output sequence length below 0. This error may result if a built-in PROTOCOL Command has encountered a malformed PDU." },
 	{ 0x11, "Skip data type invalid. The type must be 0xE or 0xF."},
 	{ 0x12, "Shared Descriptor Header Error" },
-	{ 0x13, "Header Error. Invalid length or parity, or certain "
-		"other problems." },
-	{ 0x14, "Burster Error. Burster has gotten to an illegal "
-		"state" },
-	{ 0x15, "Context Register Length Error. The descriptor is "
-		"trying to read or write past the end of the Context "
-		"Register. A SEQ LOAD or SEQ STORE with the VLF bit "
-		"set was executed with too large a length in the "
-		"variable length register (VSOL for SEQ STORE or VSIL "
-		"for SEQ LOAD)." },
+	{ 0x13, "Header Error. Invalid length or parity, or certain other problems." },
+	{ 0x14, "Burster Error. Burster has gotten to an illegal state" },
+	{ 0x15, "Context Register Length Error. The descriptor is trying to read or write past the end of the Context Register. A SEQ LOAD or SEQ STORE with the VLF bit set was executed with too large a length in the variable length register (VSOL for SEQ STORE or VSIL for SEQ LOAD)." },
 	{ 0x16, "DMA Error" },
 	{ 0x17, "Reserved." },
 	{ 0x1A, "Job failed due to JR reset" },
 	{ 0x1B, "Job failed due to Fail Mode" },
 	{ 0x1C, "DECO Watchdog timer timeout error" },
-	{ 0x1D, "DECO tried to copy a key from another DECO but the "
-		"other DECO's Key Registers were locked" },
-	{ 0x1E, "DECO attempted to copy data from a DECO that had an "
-		"unmasked Descriptor error" },
-	{ 0x1F, "LIODN error. DECO was trying to share from itself or "
-		"from another DECO but the two Non-SEQ LIODN values "
-		"didn't match or the 'shared from' DECO's Descriptor "
-		"required that the SEQ LIODNs be the same and they "
-		"aren't." },
-	{ 0x20, "DECO has completed a reset initiated via the DRR "
-		"register" },
-	{ 0x21, "Nonce error. When using EKT (CCM) key encryption "
-		"option in the FIFO STORE Command, the Nonce counter "
-		"reached its maximum value and this encryption mode "
-		"can no longer be used." },
-	{ 0x22, "Meta data is too large (> 511 bytes) for TLS decap "
-		"(input frame; block ciphers) and IPsec decap (output "
-		"frame, when doing the next header byte update) and "
-		"DCRC (output frame)." },
+	{ 0x1D, "DECO tried to copy a key from another DECO but the other DECO's Key Registers were locked" },
+	{ 0x1E, "DECO attempted to copy data from a DECO that had an unmasked Descriptor error" },
+	{ 0x1F, "LIODN error. DECO was trying to share from itself or from another DECO but the two Non-SEQ LIODN values didn't match or the 'shared from' DECO's Descriptor required that the SEQ LIODNs be the same and they aren't." },
+	{ 0x20, "DECO has completed a reset initiated via the DRR register" },
+	{ 0x21, "Nonce error. When using EKT (CCM) key encryption option in the FIFO STORE Command, the Nonce counter reached its maximum value and this encryption mode can no longer be used." },
+	{ 0x22, "Meta data is too large (> 511 bytes) for TLS decap (input frame; block ciphers) and IPsec decap (output frame, when doing the next header byte update) and DCRC (output frame)." },
 	{ 0x23, "Read Input Frame error" },
 	{ 0x24, "JDKEK, TDKEK or TDSK not loaded error" },
 	{ 0x80, "DNR (do not run) error" },
@@ -90,23 +58,14 @@ static const struct {
 	{ 0x85, "Sequence number overflow" },
 	{ 0x86, "Sigver invalid signature" },
 	{ 0x87, "DSA Sign Illegal test descriptor" },
-	{ 0x88, "Protocol Format Error - A protocol has seen an error "
-		"in the format of data received. When running RSA, "
-		"this means that formatting with random padding was "
-		"used, and did not follow the form: 0x00, 0x02, 8-to-N "
-		"bytes of non-zero pad, 0x00, F data." },
-	{ 0x89, "Protocol Size Error - A protocol has seen an error in "
-		"size. When running RSA, pdb size N < (size of F) when "
-		"no formatting is used; or pdb size N < (F + 11) when "
-		"formatting is used." },
+	{ 0x88, "Protocol Format Error - A protocol has seen an error in the format of data received. When running RSA, this means that formatting with random padding was used, and did not follow the form: 0x00, 0x02, 8-to-N bytes of non-zero pad, 0x00, F data." },
+	{ 0x89, "Protocol Size Error - A protocol has seen an error in size. When running RSA, pdb size N < (size of F) when no formatting is used; or pdb size N < (F + 11) when formatting is used." },
 	{ 0xC1, "Blob Command error: Undefined mode" },
 	{ 0xC2, "Blob Command error: Secure Memory Blob mode error" },
-	{ 0xC4, "Blob Command error: Black Blob key or input size "
-		"error" },
+	{ 0xC4, "Blob Command error: Black Blob key or input size error" },
 	{ 0xC5, "Blob Command error: Invalid key destination" },
 	{ 0xC8, "Blob Command error: Trusted/Secure mode error" },
-	{ 0xF0, "IPsec TTL or hop limit field either came in as 0, "
-		"or was decremented to 0" },
+	{ 0xF0, "IPsec TTL or hop limit field either came in as 0, or was decremented to 0" },
 	{ 0xF1, "3GPP HFN matches or exceeds the Threshold" },
 };
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/11] crypto: caam: Error reporting fixes
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (10 preceding siblings ...)
  2014-04-24 18:05 ` [PATCH 11/11] crypto: caam: Fix the 'quoted string split across lines' Marek Vasut
@ 2014-04-25 18:20 ` Kees Cook
  2014-05-08 14:01 ` Herbert Xu
  12 siblings, 0 replies; 15+ messages in thread
From: Kees Cook @ 2014-04-25 18:20 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-crypto

On Apr 24, Marek wrote:
> First stab at reworking the error.c thing in Freescale CAAM.
> This patchset cleans it up so it's not doing any too insane
> string messing anymore.
>
> NOTE: Can someone please test this on real hardware? I have
>       none at hand, so THIS IS COMPILE-TESTED ONLY!
>
> Marek Vasut (11):
>   crypto: caam: Contain caam_jr_strstatus() ugliness
>   crypto: caam: Pull all the error codes out
>   crypto: caam: Implement fast-path for error codes with no handler
>   crypto: caam: Pass error type into the functions
>   crypto: caam: Kill the easy targets
>   crypto: caam: Dissolve report_jump_idx()
>   crypto: caam: Clean up report_ccb_status()
>   crypto: caam: Clean up report_deco_status()
>   crypto: caam: Kill SPRINTFCAT() with fire
>   crypto: caam: Sweep the remnants
>   crypto: caam: Fix the 'quoted string split across lines'
>
>  drivers/crypto/caam/caamalg.c  |  28 +--
>  drivers/crypto/caam/caamhash.c |  28 +--
>  drivers/crypto/caam/caamrng.c  |   7 +-
>  drivers/crypto/caam/error.c    | 389
> +++++++++++++++++++----------------------
>  drivers/crypto/caam/error.h    |   2 +-
>  drivers/crypto/caam/key_gen.c  |   7 +-
>  6 files changed, 200 insertions(+), 261 deletions(-)
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Horia Geanta <horia.geanta@freescale.com>

Thanks for doing this! The final result looks good to me, though I too
can't test with real hardware. Please consider the whole series:

Reviewed-by: Kees Cook <keescook@chromium.org>

Thanks,

-Kees

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/11] crypto: caam: Error reporting fixes
  2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
                   ` (11 preceding siblings ...)
  2014-04-25 18:20 ` [PATCH 00/11] crypto: caam: Error reporting fixes Kees Cook
@ 2014-05-08 14:01 ` Herbert Xu
  2014-05-08 14:50   ` Marek Vasut
  12 siblings, 1 reply; 15+ messages in thread
From: Herbert Xu @ 2014-05-08 14:01 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-crypto, Horia Geanta

On Thu, Apr 24, 2014 at 08:05:11PM +0200, Marek Vasut wrote:
> First stab at reworking the error.c thing in Freescale CAAM.
> This patchset cleans it up so it's not doing any too insane
> string messing anymore.
> 
> NOTE: Can someone please test this on real hardware? I have
>       none at hand, so THIS IS COMPILE-TESTED ONLY!
> 
> Marek Vasut (11):

All applied.  Thanks Marek.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/11] crypto: caam: Error reporting fixes
  2014-05-08 14:01 ` Herbert Xu
@ 2014-05-08 14:50   ` Marek Vasut
  0 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2014-05-08 14:50 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, Horia Geanta

On Thursday, May 08, 2014 at 04:01:06 PM, Herbert Xu wrote:
> On Thu, Apr 24, 2014 at 08:05:11PM +0200, Marek Vasut wrote:
> > First stab at reworking the error.c thing in Freescale CAAM.
> > This patchset cleans it up so it's not doing any too insane
> > string messing anymore.
> > 
> > NOTE: Can someone please test this on real hardware? I have
> > 
> >       none at hand, so THIS IS COMPILE-TESTED ONLY!
> > 
> > Marek Vasut (11):
> All applied.  Thanks Marek.

Thank you!

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-05-08 15:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
2014-04-24 18:05 ` [PATCH 01/11] crypto: caam: Contain caam_jr_strstatus() ugliness Marek Vasut
2014-04-24 18:05 ` [PATCH 02/11] crypto: caam: Pull all the error codes out Marek Vasut
2014-04-24 18:05 ` [PATCH 03/11] crypto: caam: Implement fast-path for error codes with no handler Marek Vasut
2014-04-24 18:05 ` [PATCH 04/11] crypto: caam: Pass error type into the functions Marek Vasut
2014-04-24 18:05 ` [PATCH 05/11] crypto: caam: Kill the easy targets Marek Vasut
2014-04-24 18:05 ` [PATCH 06/11] crypto: caam: Dissolve report_jump_idx() Marek Vasut
2014-04-24 18:05 ` [PATCH 07/11] crypto: caam: Clean up report_ccb_status() Marek Vasut
2014-04-24 18:05 ` [PATCH 08/11] crypto: caam: Clean up report_deco_status() Marek Vasut
2014-04-24 18:05 ` [PATCH 09/11] crypto: caam: Kill SPRINTFCAT() with fire Marek Vasut
2014-04-24 18:05 ` [PATCH 10/11] crypto: caam: Sweep the remnants Marek Vasut
2014-04-24 18:05 ` [PATCH 11/11] crypto: caam: Fix the 'quoted string split across lines' Marek Vasut
2014-04-25 18:20 ` [PATCH 00/11] crypto: caam: Error reporting fixes Kees Cook
2014-05-08 14:01 ` Herbert Xu
2014-05-08 14:50   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).