linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve system log messaging in ccp-crypto
@ 2019-07-10 21:45 Hook, Gary
  2019-07-10 21:45 ` [PATCH 1/2] crypto: ccp - Include the module name in system log messages Hook, Gary
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hook, Gary @ 2019-07-10 21:45 UTC (permalink / raw)
  To: linux-crypto; +Cc: herbert, davem, Lendacky, Thomas, Hook, Gary

From: Gary R Hook <gary.hook@amd.com>

Add a prefix to any messages logged by the ccp-crypto module, and
add a notice if the module fails to load in the case that no CCPs
are defined.

Gary R Hook (2):
  crypto: ccp - Include the module name in system log messages
  crypto: ccp - Log an error message when ccp-crypto fails to load

 drivers/crypto/ccp/ccp-crypto-main.c | 4 +++-
 drivers/crypto/ccp/ccp-crypto.h      | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.17.1


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

* [PATCH 1/2] crypto: ccp - Include the module name in system log messages
  2019-07-10 21:45 [PATCH 0/2] Improve system log messaging in ccp-crypto Hook, Gary
@ 2019-07-10 21:45 ` Hook, Gary
  2019-07-10 21:45 ` [PATCH 2/2] crypto: ccp - Log an error message when ccp-crypto fails to load Hook, Gary
  2019-07-26 12:34 ` [PATCH 0/2] Improve system log messaging in ccp-crypto Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Hook, Gary @ 2019-07-10 21:45 UTC (permalink / raw)
  To: linux-crypto; +Cc: herbert, davem, Lendacky, Thomas, Hook, Gary

Redefine pr_fmt so that the module name is prefixed to every
log message produced by the ccp-crypto module

Signed-off-by: Gary R Hook <gary.hook@amd.com>
---
 drivers/crypto/ccp/ccp-crypto.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/crypto/ccp/ccp-crypto.h b/drivers/crypto/ccp/ccp-crypto.h
index a4a593dddfd6..c5d471b2ac1b 100644
--- a/drivers/crypto/ccp/ccp-crypto.h
+++ b/drivers/crypto/ccp/ccp-crypto.h
@@ -24,6 +24,10 @@
 #include <crypto/akcipher.h>
 #include <crypto/internal/rsa.h>
 
+/* We want the module name in front of our messages */
+#undef pr_fmt
+#define	pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+
 #define	CCP_LOG_LEVEL	KERN_INFO
 
 #define CCP_CRA_PRIORITY	300
-- 
2.17.1


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

* [PATCH 2/2] crypto: ccp - Log an error message when ccp-crypto fails to load
  2019-07-10 21:45 [PATCH 0/2] Improve system log messaging in ccp-crypto Hook, Gary
  2019-07-10 21:45 ` [PATCH 1/2] crypto: ccp - Include the module name in system log messages Hook, Gary
@ 2019-07-10 21:45 ` Hook, Gary
  2019-07-26 12:34 ` [PATCH 0/2] Improve system log messaging in ccp-crypto Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Hook, Gary @ 2019-07-10 21:45 UTC (permalink / raw)
  To: linux-crypto; +Cc: herbert, davem, Lendacky, Thomas, Hook, Gary

If there are no CCP devices on the system, ccp-crypto will not load.
Write a message to the system log clarifying the reason for the failure
of the modprobe operation
---
 drivers/crypto/ccp/ccp-crypto-main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/ccp-crypto-main.c b/drivers/crypto/ccp/ccp-crypto-main.c
index 44a9917a4a6a..5b61c440dff0 100644
--- a/drivers/crypto/ccp/ccp-crypto-main.c
+++ b/drivers/crypto/ccp/ccp-crypto-main.c
@@ -405,8 +405,10 @@ static int ccp_crypto_init(void)
 	int ret;
 
 	ret = ccp_present();
-	if (ret)
+	if (ret) {
+		pr_err("Cannot load: there are no available CCPs\n");
 		return ret;
+	}
 
 	spin_lock_init(&req_queue_lock);
 	INIT_LIST_HEAD(&req_queue.cmds);
-- 
2.17.1


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

* Re: [PATCH 0/2] Improve system log messaging in ccp-crypto
  2019-07-10 21:45 [PATCH 0/2] Improve system log messaging in ccp-crypto Hook, Gary
  2019-07-10 21:45 ` [PATCH 1/2] crypto: ccp - Include the module name in system log messages Hook, Gary
  2019-07-10 21:45 ` [PATCH 2/2] crypto: ccp - Log an error message when ccp-crypto fails to load Hook, Gary
@ 2019-07-26 12:34 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2019-07-26 12:34 UTC (permalink / raw)
  To: Hook, Gary; +Cc: linux-crypto, davem, Thomas.Lendacky, Gary.Hook

Hook, Gary <Gary.Hook@amd.com> wrote:
> From: Gary R Hook <gary.hook@amd.com>
> 
> Add a prefix to any messages logged by the ccp-crypto module, and
> add a notice if the module fails to load in the case that no CCPs
> are defined.
> 
> Gary R Hook (2):
>  crypto: ccp - Include the module name in system log messages
>  crypto: ccp - Log an error message when ccp-crypto fails to load
> 
> drivers/crypto/ccp/ccp-crypto-main.c | 4 +++-
> drivers/crypto/ccp/ccp-crypto.h      | 4 ++++
> 2 files changed, 7 insertions(+), 1 deletion(-)

All applied.  Thanks.
-- 
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] 4+ messages in thread

end of thread, other threads:[~2019-07-26 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 21:45 [PATCH 0/2] Improve system log messaging in ccp-crypto Hook, Gary
2019-07-10 21:45 ` [PATCH 1/2] crypto: ccp - Include the module name in system log messages Hook, Gary
2019-07-10 21:45 ` [PATCH 2/2] crypto: ccp - Log an error message when ccp-crypto fails to load Hook, Gary
2019-07-26 12:34 ` [PATCH 0/2] Improve system log messaging in ccp-crypto Herbert Xu

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).