aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp/ccp-dev-v3.c
diff options
context:
space:
mode:
authorHook, Gary <Gary.Hook@amd.com>2019-07-09 15:07:22 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2019-07-26 22:08:03 +1000
commitc4a89279086e9c98eba659d7665b1732e0d5e3e3 (patch)
tree3b28fcadcc0bea7955a6d98362f612cee55fde01 /drivers/crypto/ccp/ccp-dev-v3.c
parentcrypto: ccp - Make CCP debugfs support optional (diff)
downloadlinux-dev-c4a89279086e9c98eba659d7665b1732e0d5e3e3.tar.xz
linux-dev-c4a89279086e9c98eba659d7665b1732e0d5e3e3.zip
crypto: ccp - Add a module parameter to specify a queue count
Add a module parameter to limit the number of queues per CCP. The default value (nqueues=0) is to set up every available queue on each device. The count of queues starts from the first one found on the device (which varies based on the device ID). Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/ccp-dev-v3.c')
-rw-r--r--drivers/crypto/ccp/ccp-dev-v3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
index 2b7d47ed5c74..4005d438dff9 100644
--- a/drivers/crypto/ccp/ccp-dev-v3.c
+++ b/drivers/crypto/ccp/ccp-dev-v3.c
@@ -379,7 +379,7 @@ static int ccp_init(struct ccp_device *ccp)
/* Find available queues */
ccp->qim = 0;
qmr = ioread32(ccp->io_regs + Q_MASK_REG);
- for (i = 0; i < MAX_HW_QUEUES; i++) {
+ for (i = 0; (i < MAX_HW_QUEUES) && (ccp->cmd_q_count < ccp->max_q_count); i++) {
if (!(qmr & (1 << i)))
continue;