05 Sep, 2019

5 commits


09 Aug, 2019

2 commits

  • Use devm_platform_ioremap_resource() to simplify the code a bit.
    This is detected by coccinelle.

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Signed-off-by: Herbert Xu

    YueHaibing
     
  • We don't need dev_err() messages when platform_get_irq() fails now that
    platform_get_irq() prints an error message itself when something goes
    wrong. Let's remove these prints with a simple semantic patch.

    //
    @@
    expression ret;
    struct platform_device *E;
    @@

    ret =
    (
    platform_get_irq(E, ...)
    |
    platform_get_irq_byname(E, ...)
    );

    if ( \( ret < 0 \| ret

    While we're here, remove braces on if statements that only have one
    statement (manually).

    Cc: Greg Kroah-Hartman
    Cc: Herbert Xu
    Cc: "David S. Miller"
    Cc:
    Signed-off-by: Stephen Boyd
    Signed-off-by: Herbert Xu

    Stephen Boyd
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 24 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190528170026.162703968@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


25 Apr, 2019

1 commit

  • The flags field in 'struct shash_desc' never actually does anything.
    The only ostensibly supported flag is CRYPTO_TFM_REQ_MAY_SLEEP.
    However, no shash algorithm ever sleeps, making this flag a no-op.

    With this being the case, inevitably some users who can't sleep wrongly
    pass MAY_SLEEP. These would all need to be fixed if any shash algorithm
    actually started sleeping. For example, the shash_ahash_*() functions,
    which wrap a shash algorithm with the ahash API, pass through MAY_SLEEP
    from the ahash API to the shash API. However, the shash functions are
    called under kmap_atomic(), so actually they're assumed to never sleep.

    Even if it turns out that some users do need preemption points while
    hashing large buffers, we could easily provide a helper function
    crypto_shash_update_large() which divides the data into smaller chunks
    and calls crypto_shash_update() and cond_resched() for each chunk. It's
    not necessary to have a flag in 'struct shash_desc', nor is it necessary
    to make individual shash algorithms aware of this at all.

    Therefore, remove shash_desc::flags, and document that the
    crypto_shash_*() functions can be called from any context.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

08 Jan, 2019

1 commit

  • We already need to zero out memory for dma_alloc_coherent(), as such
    using dma_zalloc_coherent() is superflous. Phase it out.

    This change was generated with the following Coccinelle SmPL patch:

    @ replace_dma_zalloc_coherent @
    expression dev, size, data, handle, flags;
    @@

    -dma_zalloc_coherent(dev, size, handle, flags)
    +dma_alloc_coherent(dev, size, handle, flags)

    Suggested-by: Christoph Hellwig
    Signed-off-by: Luis Chamberlain
    [hch: re-ran the script on the latest tree]
    Signed-off-by: Christoph Hellwig

    Luis Chamberlain
     

07 Jul, 2018

1 commit

  • At over 4000 #includes, is the 9th most
    #included header file in the Linux kernel. It does not need
    , so drop that header and explicitly add
    to source files that need it.

    4146 #include

    After this patch, there are 225 files that use ,
    for a reduction of around 3900 times that
    does not have to be read & parsed.

    225 #include

    This patch was build-tested on 20 different arch-es.

    It also makes these drivers SubmitChecklist#1 compliant.

    Signed-off-by: Randy Dunlap
    Reported-by: kbuild test robot # drivers/media/platform/vimc/
    Reported-by: kbuild test robot # drivers/pinctrl/pinctrl-u300.c
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

03 Nov, 2017

1 commit


22 Sep, 2017

2 commits


18 Jul, 2017

1 commit


19 Jun, 2017

1 commit


10 Jun, 2017

1 commit


23 May, 2017

1 commit


16 Mar, 2017

8 commits

  • This patch refines data structures, which are used to control engine's
    data path, to make it more efficient. Hence current change are:

    - gathers the broken pieces of structures 'mtk_aes_ct''mtk_aes_tfm'
    into struct mtk_aes_info hence avoiding additional DMA-mapping.

    - adds 'keymode' in struct mtk_aes_base_ctx. When .setkey() callback is
    called, we store keybit setting in keymode. Doing so, there is no need
    to check keylen second time in mtk_aes_info_init() / mtk_aes_gcm_info_init().

    Besides, this patch also removes unused macro definitions and adds helper
    inline function to write security information(key, IV,...) to info->state.

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • This patch adds mtk_aes_gcm_tag_verify() which is used to compare
    authenticated tag.

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • This patch fixes how errors should be handled by mtk_aes_complete().

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • This patch adds 'queue_task' to dequeue crypto requset. This will help to
    avoid directly calling mtk_aes_handle_queue() / mtk_sha_handle_queue()
    from done tasklet or error handler.

    In order to avoid confusion, the new code properly renames DMA completion
    "task" to "done_task".

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • This patch replaces cmd_pos/res_pos with pointer cmd_next/res_next.

    In old code, we must to add one to shift ring to the next segment, and
    then use this value to caculate current offset from ring base for each
    DMA operation. Now these pointers helps us to simplify flow, so we just
    need to move pointers and check the boundaries of ring.

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • This is a transitional patch. It merges mtk_sha_xmit() and mtk_sha_xmit2()
    to make transmit function more generic.
    In addition, res->buf and cryp->tmp_dma in mtk_sha_xmit() are useless, since
    crypto engine writes the result digests into ctx->tfm.digest instead of
    res->buf. It's better to remove it.

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • Dummy patch to add MTK_* prefix to ring enum and fix incorrect annotations.

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     
  • This patch removes redundant task that used to handle interrupt
    from ring manager, so that the same task/handler can be shared.
    It also uses aes->id and sha-id to distinguish interrupt sources.

    Signed-off-by: Ryder Lee
    Signed-off-by: Herbert Xu

    Ryder Lee
     

23 Jan, 2017

8 commits


13 Jan, 2017

3 commits

  • Fixes the following sparse warning:

    drivers/crypto/mediatek/mtk-platform.c:585:27: warning:
    symbol 'of_crypto_id' was not declared. Should it be static?

    Signed-off-by: Wei Yongjun
    Signed-off-by: Herbert Xu

    Wei Yongjun
     
  • After I enabled COMPILE_TEST for non-ARM targets, I ran into these
    warnings:

    crypto/mediatek/mtk-aes.c: In function 'mtk_aes_info_map':
    crypto/mediatek/mtk-aes.c:224:28: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=]
    dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info));
    crypto/mediatek/mtk-sha.c:344:28: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=]
    crypto/mediatek/mtk-sha.c:550:21: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=]

    The correct format for size_t is %zu, so use that in all three
    cases.

    Fixes: 785e5c616c84 ("crypto: mediatek - Add crypto driver support for some MediaTek chips")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Herbert Xu

    Arnd Bergmann
     
  • In the case where keylen
    Signed-off-by: Herbert Xu

    Colin Ian King
     

27 Dec, 2016

1 commit