lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007301910.TE2Q0Ew4%lkp@intel.com>
Date:   Thu, 30 Jul 2020 19:36:13 +0800
From:   kernel test robot <lkp@...el.com>
To:     SrujanaChalla <schalla@...vell.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Herbert Xu <herbert@...dor.apana.org.au>
Subject: drivers/crypto/marvell/cesa/tdma.c:117:40: sparse: sparse: incorrect
 type in assignment (different base types)

Hi SrujanaChalla,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   83bdc7275e6206f560d247be856bceba3e1ed8f2
commit: 655ff1a1a727f9b83df317c4ad3b2f4a48f6206c crypto: marvell - create common Kconfig and Makefile for Marvell
date:   4 months ago
config: arm-randconfig-s031-20200730 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.2-98-g4932334a-dirty
        git checkout 655ff1a1a727f9b83df317c4ad3b2f4a48f6206c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


sparse warnings: (new ones prefixed by >>)

   drivers/crypto/marvell/cesa/tdma.c:86:37: sparse: sparse: restricted __le32 degrades to integer
   drivers/crypto/marvell/cesa/tdma.c:89:37: sparse: sparse: restricted __le32 degrades to integer
>> drivers/crypto/marvell/cesa/tdma.c:117:40: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] next_dma @@     got unsigned int [usertype] cur_dma @@
   drivers/crypto/marvell/cesa/tdma.c:117:40: sparse:     expected restricted __le32 [usertype] next_dma
>> drivers/crypto/marvell/cesa/tdma.c:117:40: sparse:     got unsigned int [usertype] cur_dma
>> drivers/crypto/marvell/cesa/tdma.c:240:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] src @@     got unsigned int [usertype] src @@
   drivers/crypto/marvell/cesa/tdma.c:240:19: sparse:     expected restricted __le32 [usertype] src
>> drivers/crypto/marvell/cesa/tdma.c:240:19: sparse:     got unsigned int [usertype] src
   drivers/crypto/marvell/cesa/tdma.c:292:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] src @@     got unsigned int [usertype] src @@
   drivers/crypto/marvell/cesa/tdma.c:292:19: sparse:     expected restricted __le32 [usertype] src
   drivers/crypto/marvell/cesa/tdma.c:292:19: sparse:     got unsigned int [usertype] src
>> drivers/crypto/marvell/cesa/tdma.c:293:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] dst @@     got unsigned int [usertype] dst @@
   drivers/crypto/marvell/cesa/tdma.c:293:19: sparse:     expected restricted __le32 [usertype] dst
>> drivers/crypto/marvell/cesa/tdma.c:293:19: sparse:     got unsigned int [usertype] dst

vim +117 drivers/crypto/marvell/cesa/tdma.c

db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   78  
53da740fed302f drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21   79  void mv_cesa_dma_prepare(struct mv_cesa_req *dreq,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   80  			 struct mv_cesa_engine *engine)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   81  {
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   82  	struct mv_cesa_tdma_desc *tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   83  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   84  	for (tdma = dreq->chain.first; tdma; tdma = tdma->next) {
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   85  		if (tdma->flags & CESA_TDMA_DST_IN_SRAM)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  @86  			tdma->dst = cpu_to_le32(tdma->dst + engine->sram_dma);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   87  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   88  		if (tdma->flags & CESA_TDMA_SRC_IN_SRAM)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   89  			tdma->src = cpu_to_le32(tdma->src + engine->sram_dma);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   90  
b99acf79a17bf4 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21   91  		if ((tdma->flags & CESA_TDMA_TYPE_MSK) == CESA_TDMA_OP)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   92  			mv_cesa_adjust_op(engine, tdma->op);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   93  	}
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   94  }
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18   95  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21   96  void mv_cesa_tdma_chain(struct mv_cesa_engine *engine,
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21   97  			struct mv_cesa_req *dreq)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21   98  {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21   99  	if (engine->chain.first == NULL && engine->chain.last == NULL) {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  100  		engine->chain.first = dreq->chain.first;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  101  		engine->chain.last  = dreq->chain.last;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  102  	} else {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  103  		struct mv_cesa_tdma_desc *last;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  104  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  105  		last = engine->chain.last;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  106  		last->next = dreq->chain.first;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  107  		engine->chain.last = dreq->chain.last;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  108  
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  109  		/*
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  110  		 * Break the DMA chain if the CESA_TDMA_BREAK_CHAIN is set on
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  111  		 * the last element of the current chain, or if the request
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  112  		 * being queued needs the IV regs to be set before lauching
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  113  		 * the request.
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  114  		 */
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  115  		if (!(last->flags & CESA_TDMA_BREAK_CHAIN) &&
8759fec4af222f drivers/crypto/marvell/tdma.c      Romain Perier    2016-12-14  116  		    !(dreq->chain.first->flags & CESA_TDMA_SET_STATE))
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21 @117  			last->next_dma = dreq->chain.first->cur_dma;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  118  	}
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  119  }
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  120  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  121  int mv_cesa_tdma_process(struct mv_cesa_engine *engine, u32 status)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  122  {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  123  	struct crypto_async_request *req = NULL;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  124  	struct mv_cesa_tdma_desc *tdma = NULL, *next = NULL;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  125  	dma_addr_t tdma_cur;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  126  	int res = 0;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  127  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  128  	tdma_cur = readl(engine->regs + CESA_TDMA_CUR);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  129  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  130  	for (tdma = engine->chain.first; tdma; tdma = next) {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  131  		spin_lock_bh(&engine->lock);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  132  		next = tdma->next;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  133  		spin_unlock_bh(&engine->lock);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  134  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  135  		if (tdma->flags & CESA_TDMA_END_OF_REQ) {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  136  			struct crypto_async_request *backlog = NULL;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  137  			struct mv_cesa_ctx *ctx;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  138  			u32 current_status;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  139  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  140  			spin_lock_bh(&engine->lock);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  141  			/*
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  142  			 * if req is NULL, this means we're processing the
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  143  			 * request in engine->req.
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  144  			 */
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  145  			if (!req)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  146  				req = engine->req;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  147  			else
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  148  				req = mv_cesa_dequeue_req_locked(engine,
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  149  								 &backlog);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  150  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  151  			/* Re-chaining to the next request */
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  152  			engine->chain.first = tdma->next;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  153  			tdma->next = NULL;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  154  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  155  			/* If this is the last request, clear the chain */
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  156  			if (engine->chain.first == NULL)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  157  				engine->chain.last  = NULL;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  158  			spin_unlock_bh(&engine->lock);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  159  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  160  			ctx = crypto_tfm_ctx(req->tfm);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  161  			current_status = (tdma->cur_dma == tdma_cur) ?
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  162  					  status : CESA_SA_INT_ACC0_IDMA_DONE;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  163  			res = ctx->ops->process(req, current_status);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  164  			ctx->ops->complete(req);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  165  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  166  			if (res == 0)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  167  				mv_cesa_engine_enqueue_complete_request(engine,
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  168  									req);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  169  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  170  			if (backlog)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  171  				backlog->complete(backlog, -EINPROGRESS);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  172  		}
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  173  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  174  		if (res || tdma->cur_dma == tdma_cur)
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  175  			break;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  176  	}
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  177  
655ff1a1a727f9 drivers/crypto/marvell/cesa/tdma.c SrujanaChalla    2020-03-13  178  	/*
655ff1a1a727f9 drivers/crypto/marvell/cesa/tdma.c SrujanaChalla    2020-03-13  179  	 * Save the last request in error to engine->req, so that the core
655ff1a1a727f9 drivers/crypto/marvell/cesa/tdma.c SrujanaChalla    2020-03-13  180  	 * knows which request was fautly
655ff1a1a727f9 drivers/crypto/marvell/cesa/tdma.c SrujanaChalla    2020-03-13  181  	 */
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  182  	if (res) {
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  183  		spin_lock_bh(&engine->lock);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  184  		engine->req = req;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  185  		spin_unlock_bh(&engine->lock);
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  186  	}
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  187  
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  188  	return res;
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  189  }
85030c5168f1df drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  190  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  191  static struct mv_cesa_tdma_desc *
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  192  mv_cesa_dma_add_desc(struct mv_cesa_tdma_chain *chain, gfp_t flags)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  193  {
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  194  	struct mv_cesa_tdma_desc *new_tdma = NULL;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  195  	dma_addr_t dma_handle;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  196  
472d640bd0fe5b drivers/crypto/marvell/tdma.c      Julia Lawall     2016-04-29  197  	new_tdma = dma_pool_zalloc(cesa_dev->dma->tdma_desc_pool, flags,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  198  				   &dma_handle);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  199  	if (!new_tdma)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  200  		return ERR_PTR(-ENOMEM);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  201  
5d754137ab905a drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  202  	new_tdma->cur_dma = dma_handle;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  203  	if (chain->last) {
5d754137ab905a drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  204  		chain->last->next_dma = cpu_to_le32(dma_handle);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  205  		chain->last->next = new_tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  206  	} else {
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  207  		chain->first = new_tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  208  	}
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  209  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  210  	chain->last = new_tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  211  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  212  	return new_tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  213  }
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  214  
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  215  int mv_cesa_dma_add_result_op(struct mv_cesa_tdma_chain *chain, dma_addr_t src,
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  216  			  u32 size, u32 flags, gfp_t gfp_flags)
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  217  {
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  218  	struct mv_cesa_tdma_desc *tdma, *op_desc;
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  219  
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  220  	tdma = mv_cesa_dma_add_desc(chain, gfp_flags);
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  221  	if (IS_ERR(tdma))
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  222  		return PTR_ERR(tdma);
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  223  
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  224  	/* We re-use an existing op_desc object to retrieve the context
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  225  	 * and result instead of allocating a new one.
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  226  	 * There is at least one object of this type in a CESA crypto
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  227  	 * req, just pick the first one in the chain.
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  228  	 */
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  229  	for (op_desc = chain->first; op_desc; op_desc = op_desc->next) {
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  230  		u32 type = op_desc->flags & CESA_TDMA_TYPE_MSK;
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  231  
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  232  		if (type == CESA_TDMA_OP)
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  233  			break;
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  234  	}
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  235  
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  236  	if (!op_desc)
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  237  		return -EIO;
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  238  
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  239  	tdma->byte_cnt = cpu_to_le32(size | BIT(31));
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21 @240  	tdma->src = src;
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  241  	tdma->dst = op_desc->src;
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  242  	tdma->op = op_desc->op;
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  243  
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  244  	flags &= (CESA_TDMA_DST_IN_SRAM | CESA_TDMA_SRC_IN_SRAM);
0c99620f0ac13a drivers/crypto/marvell/tdma.c      Romain Perier    2016-10-05  245  	tdma->flags = flags | CESA_TDMA_RESULT;
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  246  	return 0;
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  247  }
bac8e805a30dc2 drivers/crypto/marvell/tdma.c      Romain Perier    2016-06-21  248  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  249  struct mv_cesa_op_ctx *mv_cesa_dma_add_op(struct mv_cesa_tdma_chain *chain,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  250  					const struct mv_cesa_op_ctx *op_templ,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  251  					bool skip_ctx,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  252  					gfp_t flags)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  253  {
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  254  	struct mv_cesa_tdma_desc *tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  255  	struct mv_cesa_op_ctx *op;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  256  	dma_addr_t dma_handle;
6de59d453ae567 drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  257  	unsigned int size;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  258  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  259  	tdma = mv_cesa_dma_add_desc(chain, flags);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  260  	if (IS_ERR(tdma))
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  261  		return ERR_CAST(tdma);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  262  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  263  	op = dma_pool_alloc(cesa_dev->dma->op_pool, flags, &dma_handle);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  264  	if (!op)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  265  		return ERR_PTR(-ENOMEM);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  266  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  267  	*op = *op_templ;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  268  
6de59d453ae567 drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  269  	size = skip_ctx ? sizeof(op->desc) : sizeof(*op);
6de59d453ae567 drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  270  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  271  	tdma = chain->last;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  272  	tdma->op = op;
6de59d453ae567 drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  273  	tdma->byte_cnt = cpu_to_le32(size | BIT(31));
ea1f662bde0675 drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  274  	tdma->src = cpu_to_le32(dma_handle);
36225b9170ea7b drivers/crypto/marvell/tdma.c      Thomas Petazzoni 2016-08-09  275  	tdma->dst = CESA_SA_CFG_SRAM_OFFSET;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  276  	tdma->flags = CESA_TDMA_DST_IN_SRAM | CESA_TDMA_OP;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  277  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  278  	return op;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  279  }
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  280  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  281  int mv_cesa_dma_add_data_transfer(struct mv_cesa_tdma_chain *chain,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  282  				  dma_addr_t dst, dma_addr_t src, u32 size,
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  283  				  u32 flags, gfp_t gfp_flags)
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  284  {
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  285  	struct mv_cesa_tdma_desc *tdma;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  286  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  287  	tdma = mv_cesa_dma_add_desc(chain, gfp_flags);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  288  	if (IS_ERR(tdma))
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  289  		return PTR_ERR(tdma);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  290  
6de59d453ae567 drivers/crypto/marvell/tdma.c      Russell King     2015-10-18  291  	tdma->byte_cnt = cpu_to_le32(size | BIT(31));
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  292  	tdma->src = src;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18 @293  	tdma->dst = dst;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  294  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  295  	flags &= (CESA_TDMA_DST_IN_SRAM | CESA_TDMA_SRC_IN_SRAM);
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  296  	tdma->flags = flags | CESA_TDMA_DATA;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  297  
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  298  	return 0;
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  299  }
db509a45339fd7 drivers/crypto/marvell/tdma.c      Boris Brezillon  2015-06-18  300  

:::::: The code at line 117 was first introduced by commit
:::::: 85030c5168f1df03a164d47254cc785331f1dfe2 crypto: marvell - Add support for chaining crypto requests in TDMA mode

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

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (30606 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ