All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
To: "Hook, Gary" <Gary.Hook@amd.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Cc: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH 10/11] crypto: ccp - Add a module parameter to control registration for DMA
Date: Mon, 24 Jun 2019 22:45:00 +0000	[thread overview]
Message-ID: <b8c3fb43-a426-31e4-e8de-29d3aea087c2@amd.com> (raw)
In-Reply-To: <156140457814.116890.11773936937983757340.stgit@sosrh3.amd.com>

On 6/24/19 2:29 PM, Hook, Gary wrote:
> The CCP driver is able to act as a DMA engine. Add a module parameter that
> allows this feature to be enabled/disabled.
> 
> Signed-off-by: Gary R Hook <gary.hook@amd.com>
> ---
>  drivers/crypto/ccp/ccp-dev-v5.c |   11 +++++++----
>  drivers/crypto/ccp/ccp-dev.h    |    1 +
>  drivers/crypto/ccp/sp-pci.c     |    8 ++++++++
>  3 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
> index ffd546b951b6..dfd803f6fb55 100644
> --- a/drivers/crypto/ccp/ccp-dev-v5.c
> +++ b/drivers/crypto/ccp/ccp-dev-v5.c
> @@ -976,9 +976,11 @@ static int ccp5_init(struct ccp_device *ccp)
>  		goto e_kthread;
>  
>  	/* Register the DMA engine support */
> -	ret = ccp_dmaengine_register(ccp);
> -	if (ret)
> -		goto e_hwrng;
> +	if (ccp_register_dma()) {
> +		ret = ccp_dmaengine_register(ccp);
> +		if (ret)
> +			goto e_hwrng;
> +	}
>  
>  #ifdef CONFIG_CRYPTO_DEV_CCP_DEBUGFS
>  	/* Set up debugfs entries */
> @@ -1013,7 +1015,8 @@ static void ccp5_destroy(struct ccp_device *ccp)
>  	unsigned int i;
>  
>  	/* Unregister the DMA engine */
> -	ccp_dmaengine_unregister(ccp);
> +	if (ccp_register_dma())
> +		ccp_dmaengine_unregister(ccp);
>  
>  	/* Unregister the RNG */
>  	ccp_unregister_rng(ccp);
> diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h
> index cd1bd78d95cc..323f7d8ce454 100644
> --- a/drivers/crypto/ccp/ccp-dev.h
> +++ b/drivers/crypto/ccp/ccp-dev.h
> @@ -647,6 +647,7 @@ int ccp_register_rng(struct ccp_device *ccp);
>  void ccp_unregister_rng(struct ccp_device *ccp);
>  int ccp_dmaengine_register(struct ccp_device *ccp);
>  void ccp_dmaengine_unregister(struct ccp_device *ccp);
> +unsigned int ccp_register_dma(void);
>  
>  void ccp5_debugfs_setup(struct ccp_device *ccp);
>  void ccp5_debugfs_destroy(void);
> diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c
> index 86dee2a66f00..5b0a9c145c5a 100644
> --- a/drivers/crypto/ccp/sp-pci.c
> +++ b/drivers/crypto/ccp/sp-pci.c
> @@ -57,6 +57,10 @@ static unsigned int nqueues = MAX_HW_QUEUES;
>  module_param(nqueues, uint, 0444);
>  MODULE_PARM_DESC(nqueues, "Number of queues per CCP (default: 5)");
>  
> +static unsigned int registerdma = 1;
> +module_param(registerdma, uint, 0444);
> +MODULE_PARM_DESC(registerdma, "Register services with the DMA engine (default: 1)");

Same comment as earlier, this can live in the CCP related files. Also,
only doing this for v5, not v3 too?

Thanks,
Tom

> +
>  #define COMMA   ','
>  static void ccp_parse_pci_buses(void)
>  {
> @@ -154,6 +158,10 @@ unsigned int ccp_get_nqueues_param(void) {
>  	return nqueues;
>  }
>  
> +unsigned int ccp_register_dma(void) {
> +	return registerdma;
> +}
> +
>  #define MSIX_VECTORS			2
>  
>  struct sp_pci {
> 

  reply	other threads:[~2019-06-24 22:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 19:28 [PATCH 00/11] Add module parameters to control CCP activation Hook, Gary
2019-06-24 19:28 ` [PATCH 01/11] crypto: ccp - Make CCP debugfs support optional Hook, Gary
2019-06-24 19:28 ` [PATCH 02/11] crypto: ccp - Add a module parameter to specify a queue count Hook, Gary
2019-06-24 21:54   ` Lendacky, Thomas
2019-06-24 19:28 ` [PATCH 03/11] crypto: ccp - Expose the value of nqueues in DebugFS Hook, Gary
2019-06-24 21:59   ` Lendacky, Thomas
2019-06-25 13:06     ` Gary R Hook
2019-06-24 19:28 ` [PATCH 04/11] crypto: ccp - module parameter to limit the number of enabled CCPs Hook, Gary
2019-06-24 22:11   ` Lendacky, Thomas
2019-06-24 19:29 ` [PATCH 05/11] crypto: ccp - Expose maxdev through DebugFS Hook, Gary
2019-06-24 19:29 ` [PATCH 06/11] crypto: ccp - Specify a single CCP via PCI device ID Hook, Gary
2019-06-24 22:41   ` Lendacky, Thomas
2019-06-24 19:29 ` [PATCH 07/11] crypto: ccp - expose the pcidev module parameter in debugfs Hook, Gary
2019-06-24 19:29 ` [PATCH 08/11] crypto: ccp - module parameter to allow CCP selection by PCI bus Hook, Gary
2019-06-24 22:42   ` Lendacky, Thomas
2019-06-24 19:29 ` [PATCH 09/11] crypto: ccp - expose pcibus module parameter in debugfs Hook, Gary
2019-06-24 19:29 ` [PATCH 10/11] crypto: ccp - Add a module parameter to control registration for DMA Hook, Gary
2019-06-24 22:45   ` Lendacky, Thomas [this message]
2019-06-24 19:29 ` [PATCH 11/11] crypto: ccp - Expose the registerdma module parameter in DFS Hook, Gary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8c3fb43-a426-31e4-e8de-29d3aea087c2@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=Gary.Hook@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.