12 Mar, 2016

1 commit


10 Feb, 2016

1 commit

  • During the crypto manager self test, a aead encryption opertation
    is carried out. This operations allocates a aead request, which is
    handed to the CAAM driver. The CAAM driver allocates and maps the
    required structures.

    During the allocation aead extended descriptor, a DMA to device
    mapping and synchronization are required. The order of this two
    operations matter, which should be map and then sync. Otherwise,
    there will be NULL pointer exception.

    This patch fix the order of this two operations, from sync-then-map
    to map-then-sync.

    Signed-off-by: Ulises Cardenas

    Ulises Cardenas
     

26 Jan, 2016

1 commit

  • Fix the DMA handle checking for the DMA maintainance.
    Should not call the dma_sync_single_for_device if the handle is NULL,
    otherwise, kernel will throw out the following complains:

    when do the following test:

    insmod ./tcrypt.ko mode=402

    Unable to handle kernel paging request at virtual address 70000000
    pgd = d8c64000
    [70000000] *pgd=00000000
    Internal error: Oops: 805 [#1] PREEMPT SMP ARM
    Modules linked in: tcrypt(+)
    CPU: 1 PID: 789 Comm: insmod Not tainted 4.1.15-01516-g116e2fc-dirty #14
    Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    task: d8b54280 ti: d8882000 task.ti: d8882000
    PC is at v7_dma_clean_range+0x20/0x38
    LR is at dma_cache_maint_page+0xc8/0x22c
    pc : [] lr : [] psr: 200b0013
    sp : d8883d08 ip : 8001e86c fp : 000004c0
    r10: 80b8b000 r9 : 80b244f8 r8 : ee557000
    r7 : 00000000 r6 : 80b8f41c r5 : 00000000 r4 : 70000000
    r3 : 0000001f r2 : 00000020 r1 : 70000000 r0 : 70000000
    Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    Control: 10c53c7d Table: 68c6404a DAC: 00000015
    Process insmod (pid: 789, stack limit = 0xd8882210)
    Stack: (0xd8883d08 to 0xd8884000)
    3d00: ef26bfe0 00000002 00000018 00000001 00000000 00000000
    3d20: ee557000 00000001 00000000 d86f0a10 00000000 d8bc2040 d8a7f5c4 8001b1a0
    3d40: 8001e86c 8001b2c8 d88a5c40 d88a5c40 80b28bc4 d8a7f400 80beec48 8057f1dc
    3d60: 00000002 00000000 00000000 00000038 00000018 80bdc1c0 68bc2128 d8a7f480
    3d80: 00000000 80068c10 600b0013 00000100 00000000 d8a7f400 00000040 00000004
    3da0: d871ca00 00000040 00000000 8057a9b0 8057a9a4 7f000d14 00000100 80068c10
    3dc0: 7f005580 d8883de4 00000100 00000004 d8a7f400 7f005e80 7f005eb0 0000000c
    3de0: d871ca00 00000040 00000100 7f0015ec 00000004 80b24648 00000000 00000000
    3e00: d8bc2000 d8bc2040 00000008 ef26fa80 00000000 00001000 68c54000 ef26ae80
    3e20: 00000000 00001000 00000000 ef270bc0 00000000 00001000 00000000 ef26db02
    3e40: 00000000 00001000 00000000 00000000 02880288 d8883e54 d8883e54 00000000
    3e60: 00000000 00000010 7f0062f8 80b27698 80b27698 d871ca00 d8882000 00000000
    3e80: 00000008 7f003124 7f0062f8 80b27698 00000010 7f0062f8 80b27698 80b27698
    3ea0: d871ca00 d8882000 00000000 7f009048 7f009000 00000000 80b27698 80009704
    3ec0: 000000d0 ef26fa80 00000000 8040003e 00000001 00000001 d8883eec ef2709c0
    3ee0: d8001f00 80b246bc 00000001 8040003e d8883f04 800905a8 00000001 00000001
    3f00: d8883f14 d8001f00 000000d0 80b23260 00000008 7f0061a0 d871c3c0 0131e008
    3f20: 0000017b 8000f684 d8882000 00000000 00000008 8008f968 00000000 00000000
    3f40: 00000003 00000000 00000003 0131e008 0000017b 800906fc f0679000 0000b857
    3f60: f0680070 f067ff25 f06840d0 0000671c 00006e8c 00000000 00000000 00000000
    3f80: 0000001f 00000020 00000017 00000014 00000012 00000000 0131e018 00000008
    3fa0: 0131e008 8000f500 0131e018 00000008 00000003 0131e008 00000000 00000000
    3fc0: 0131e018 00000008 0131e008 0000017b 00000003 00000008 0131e008 00000008
    3fe0: 7e8a6c38 7e8a6c28 0001f2c0 76f22340 600d0010 00000003 00000000 00000000
    [] (v7_dma_clean_range) from [] (dma_cache_maint_page+0xc8/0x22c)
    [] (dma_cache_maint_page) from [] (__dma_page_cpu_to_dev+0x24/0x88)
    [] (__dma_page_cpu_to_dev) from [] (ahash_update_first+0x3cc/0x6f4)
    [] (ahash_update_first) from [] (ahash_update+0xc/0x10)
    [] (ahash_update) from [] (test_ahash_cycles+0x70/0x220 [tcrypt])
    [] (test_ahash_cycles [tcrypt]) from [] (test_ahash_speed.constprop.1+0x19c/0x25c [tcrypt])
    [] (test_ahash_speed.constprop.1 [tcrypt]) from [] (do_test+0xff8/0x301c [tcrypt])
    [] (do_test [tcrypt]) from [] (tcrypt_mod_init+0x48/0xa0 [tcrypt])
    [] (tcrypt_mod_init [tcrypt]) from [] (do_one_initcall+0x80/0x1d0)
    [] (do_one_initcall) from [] (do_init_module+0x58/0x1b4)
    [] (do_init_module) from [] (SyS_finit_module+0x68/0x6c)
    [] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x3c)
    Code: e1a02312 e2423001 e1c00003 f57ff04f (ee070f3a)
    ---[ end trace 63ad5840e079f2a5 ]---

    Signed-off-by: Jason Liu

    Jason Liu
     

23 Jan, 2016

1 commit

  • Fix cherry-picked from 5ec908319ab53072d3a2188e62ed2e5d7b846951

    crypto: caam - only export the state we really need to export

    Avoid exporting lots of state by only exporting what we really require,
    which is the buffer containing the set of pending bytes to be hashed,
    number of pending bytes, the context buffer, and the function pointer
    state. This reduces down the exported state size to 216 bytes from
    576 bytes.

    Signed-off-by: Russell King
    Signed-off-by: Herbert Xu

    Russell King
     

21 Jan, 2016

36 commits