Lines Matching refs:residue
35 struct tegra_se_datbuf residue;
361 rctx->residue.size = 0;
373 rctx->residue.buf = dma_alloc_coherent(se->dev, rctx->blk_size,
374 &rctx->residue.addr, GFP_KERNEL);
375 if (!rctx->residue.buf)
387 dma_free_coherent(se->dev, rctx->residue.size, rctx->residue.buf,
388 rctx->residue.addr);
404 nresidue = (req->nbytes + rctx->residue.size) % rctx->blk_size;
405 nblks = (req->nbytes + rctx->residue.size) / rctx->blk_size;
408 * If nbytes is a multiple of block size and there is no residue,
409 * then reserve the last block as residue during final() to process.
417 rctx->datbuf.size = (req->nbytes + rctx->residue.size) - nresidue;
420 * If nbytes are less than a block size, copy it residue and
424 scatterwalk_map_and_copy(rctx->residue.buf + rctx->residue.size,
426 rctx->residue.size += req->nbytes;
436 /* Copy the previous residue first */
437 if (rctx->residue.size)
438 memcpy(rctx->datbuf.buf, rctx->residue.buf, rctx->residue.size);
440 scatterwalk_map_and_copy(rctx->datbuf.buf + rctx->residue.size,
443 scatterwalk_map_and_copy(rctx->residue.buf, rctx->src_sg,
446 /* Update residue value with the residue after current block */
447 rctx->residue.size = nresidue;
471 if (rctx->residue.size) {
472 rctx->datbuf.buf = dma_alloc_coherent(se->dev, rctx->residue.size,
479 memcpy(rctx->datbuf.buf, rctx->residue.buf, rctx->residue.size);
482 rctx->datbuf.size = rctx->residue.size;
483 rctx->total_len += rctx->residue.size;
497 if (rctx->residue.size)
502 rctx->residue.buf, rctx->residue.addr);