Skip to content

Commit

Permalink
Merge branch 'ti-linux-4.1.y' of git.ti.com:ti-linux-kernel/ti-linux-…
Browse files Browse the repository at this point in the history
…kernel into ti-rt-linux-4.1.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.1.y

* 'ti-linux-4.1.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  Revert "media: ti-vpe: vip: Add scaler support"
  crypto: omap-des - Fix support for unequal lengths
  ti_config_fragments: Add SDK release defconfig options
  ti_config_fragments: Fix defconfig_map for dra7 builds

Signed-off-by: Texas Instruments Auto Merger <lcpd_integration@list.ti.com>
  • Loading branch information
Texas Instruments Auto Merger committed Mar 16, 2016
2 parents eb42f57 + d3e48a8 commit 0036eec
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 444 deletions.
27 changes: 17 additions & 10 deletions drivers/crypto/omap-des.c
Expand Up @@ -539,29 +539,36 @@ static int omap_des_crypt_dma_stop(struct omap_des_dev *dd)
return err;
}

static int omap_des_copy_needed(struct scatterlist *sg)
static int omap_des_copy_needed(struct scatterlist *sg, int total)
{
int len = 0;

if (!IS_ALIGNED(total, DES_BLOCK_SIZE))
return -1;

while (sg) {
if (!IS_ALIGNED(sg->offset, 4))
return -1;
if (!IS_ALIGNED(sg->length, DES_BLOCK_SIZE))
return -1;

len += sg->length;
sg = sg_next(sg);
}

if (len != total)
return -1;

return 0;
}

static int omap_des_copy_sgs(struct omap_des_dev *dd)
{
void *buf_in, *buf_out;
int pages;

pages = dd->total >> PAGE_SHIFT;

if (dd->total & (PAGE_SIZE-1))
pages++;
int pages, total;

BUG_ON(!pages);
total = ALIGN(dd->total, DES_BLOCK_SIZE);
pages = get_order(total);

buf_in = (void *)__get_free_pages(GFP_ATOMIC, pages);
buf_out = (void *)__get_free_pages(GFP_ATOMIC, pages);
Expand Down Expand Up @@ -623,8 +630,8 @@ static int omap_des_handle_queue(struct omap_des_dev *dd,
dd->in_sg = req->src;
dd->out_sg = req->dst;

if (omap_des_copy_needed(dd->in_sg) ||
omap_des_copy_needed(dd->out_sg)) {
if (omap_des_copy_needed(dd->in_sg, dd->total) ||
omap_des_copy_needed(dd->out_sg, dd->total)) {
if (omap_des_copy_sgs(dd))
pr_err("Failed to copy SGs for unaligned cases\n");
dd->sgs_copied = 1;
Expand Down

0 comments on commit 0036eec

Please sign in to comment.