diff mbox

[v6,04/19] crypto: marvell/cesa: remove redundant backlog checks on EBUSY

Message ID 1503324309-13673-5-git-send-email-gilad@benyossef.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Gilad Ben-Yossef Aug. 21, 2017, 2:04 p.m. UTC
Now that -EBUSY return code only indicates backlog queueing
we can safely remove the now redundant check for the
CRYPTO_TFM_REQ_MAY_BACKLOG flag when -EBUSY is returned.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/crypto/marvell/cesa.c | 3 +--
 drivers/crypto/marvell/cesa.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

kernel test robot Aug. 24, 2017, 1:01 p.m. UTC | #1
Hi Gilad,

[auto build test ERROR on cryptodev/master]
[also build test ERROR on v4.13-rc6 next-20170823]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Gilad-Ben-Yossef/crypto-change-transient-busy-return-code-to-EAGAIN/20170824-180606
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All error/warnings (new ones prefixed by >>):

   drivers/crypto/marvell/cesa.c: In function 'mv_cesa_queue_req':
>> drivers/crypto/marvell/cesa.c:187:3: error: expected ')' before 'mv_cesa_tdma_chain'
      mv_cesa_tdma_chain(engine, creq);
      ^~~~~~~~~~~~~~~~~~
>> drivers/crypto/marvell/cesa.c:196:1: error: expected expression before '}' token
    }
    ^
>> drivers/crypto/marvell/cesa.c:196:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +187 drivers/crypto/marvell/cesa.c

f63601fd6 Boris Brezillon  2015-06-18  176  
53da740fe Romain Perier    2016-06-21  177  int mv_cesa_queue_req(struct crypto_async_request *req,
53da740fe Romain Perier    2016-06-21  178  		      struct mv_cesa_req *creq)
f63601fd6 Boris Brezillon  2015-06-18  179  {
f63601fd6 Boris Brezillon  2015-06-18  180  	int ret;
bf8f91e71 Romain Perier    2016-06-21  181  	struct mv_cesa_engine *engine = creq->engine;
f63601fd6 Boris Brezillon  2015-06-18  182  
bf8f91e71 Romain Perier    2016-06-21  183  	spin_lock_bh(&engine->lock);
bf8f91e71 Romain Perier    2016-06-21  184  	ret = crypto_enqueue_request(&engine->queue, req);
603e989eb Romain Perier    2016-07-22  185  	if ((mv_cesa_req_get_type(creq) == CESA_DMA_REQ) &&
3a1c7473a Gilad Ben-Yossef 2017-08-21  186  	    (ret == -EINPROGRESS || ret == -EBUSY)
603e989eb Romain Perier    2016-07-22 @187  		mv_cesa_tdma_chain(engine, creq);
bf8f91e71 Romain Perier    2016-06-21  188  	spin_unlock_bh(&engine->lock);
f63601fd6 Boris Brezillon  2015-06-18  189  
f63601fd6 Boris Brezillon  2015-06-18  190  	if (ret != -EINPROGRESS)
f63601fd6 Boris Brezillon  2015-06-18  191  		return ret;
f63601fd6 Boris Brezillon  2015-06-18  192  
85030c516 Romain Perier    2016-06-21  193  	mv_cesa_rearm_engine(engine);
f63601fd6 Boris Brezillon  2015-06-18  194  
f63601fd6 Boris Brezillon  2015-06-18  195  	return -EINPROGRESS;
f63601fd6 Boris Brezillon  2015-06-18 @196  }
f63601fd6 Boris Brezillon  2015-06-18  197  

:::::: The code at line 187 was first introduced by commit
:::::: 603e989ebee21bfa9cddf8390d0515a07324edc8 crypto: marvell - Don't chain at DMA level when backlog is disabled

:::::: TO: Romain Perier <romain.perier@free-electrons.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Gilad Ben-Yossef Aug. 24, 2017, 1:25 p.m. UTC | #2
On Thu, Aug 24, 2017 at 4:01 PM, kbuild test robot <lkp@intel.com> wrote:
> Hi Gilad,
>
> [auto build test ERROR on cryptodev/master]
> [also build test ERROR on v4.13-rc6 next-20170823]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Gilad-Ben-Yossef/crypto-change-transient-busy-return-code-to-EAGAIN/20170824-180606
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
> config: arm-allmodconfig (attached as .config)
> compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=arm
>
> All error/warnings (new ones prefixed by >>):
>
>    drivers/crypto/marvell/cesa.c: In function 'mv_cesa_queue_req':
>>> drivers/crypto/marvell/cesa.c:187:3: error: expected ')' before 'mv_cesa_tdma_chain'
>       mv_cesa_tdma_chain(engine, creq);
>       ^~~~~~~~~~~~~~~~~~
>>> drivers/crypto/marvell/cesa.c:196:1: error: expected expression before '}' token
>     }
>     ^
>>> drivers/crypto/marvell/cesa.c:196:1: warning: control reaches end of non-void function [-Wreturn-type]
>     }
>     ^

Oy! I thought I've added COMPILE_TEST to my local tree to build it. I didn't.

Fix underway.

Gilad
diff mbox

Patch

diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c
index 6e7a5c7..269737f 100644
--- a/drivers/crypto/marvell/cesa.c
+++ b/drivers/crypto/marvell/cesa.c
@@ -183,8 +183,7 @@  int mv_cesa_queue_req(struct crypto_async_request *req,
 	spin_lock_bh(&engine->lock);
 	ret = crypto_enqueue_request(&engine->queue, req);
 	if ((mv_cesa_req_get_type(creq) == CESA_DMA_REQ) &&
-	    (ret == -EINPROGRESS ||
-	    (ret == -EBUSY && req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)))
+	    (ret == -EINPROGRESS || ret == -EBUSY)
 		mv_cesa_tdma_chain(engine, creq);
 	spin_unlock_bh(&engine->lock);
 
diff --git a/drivers/crypto/marvell/cesa.h b/drivers/crypto/marvell/cesa.h
index b7872f6..63c8457 100644
--- a/drivers/crypto/marvell/cesa.h
+++ b/drivers/crypto/marvell/cesa.h
@@ -763,7 +763,7 @@  static inline int mv_cesa_req_needs_cleanup(struct crypto_async_request *req,
 	 * the backlog and will be processed later. There's no need to
 	 * clean it up.
 	 */
-	if (ret == -EBUSY && req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)
+	if (ret == -EBUSY)
 		return false;
 
 	/* Request wasn't queued, we need to clean it up */