1. 07 3月, 2019 1 次提交
  2. 28 2月, 2019 3 次提交
  3. 28 9月, 2018 4 次提交
  4. 09 7月, 2018 1 次提交
  5. 09 3月, 2018 2 次提交
  6. 15 2月, 2018 1 次提交
  7. 18 1月, 2018 1 次提交
  8. 29 11月, 2017 1 次提交
  9. 03 11月, 2017 2 次提交
  10. 24 3月, 2017 3 次提交
  11. 09 3月, 2017 1 次提交
    • K
      crypto: s5p-sss - Fix spinlock recursion on LRW(AES) · 28b62b14
      Krzysztof Kozlowski 提交于
      Running TCRYPT with LRW compiled causes spinlock recursion:
      
          testing speed of async lrw(aes) (lrw(ecb-aes-s5p)) encryption
          tcrypt: test 0 (256 bit key, 16 byte blocks): 19007 operations in 1 seconds (304112 bytes)
          tcrypt: test 1 (256 bit key, 64 byte blocks): 15753 operations in 1 seconds (1008192 bytes)
          tcrypt: test 2 (256 bit key, 256 byte blocks): 14293 operations in 1 seconds (3659008 bytes)
          tcrypt: test 3 (256 bit key, 1024 byte blocks): 11906 operations in 1 seconds (12191744 bytes)
          tcrypt: test 4 (256 bit key, 8192 byte blocks):
          BUG: spinlock recursion on CPU#1, irq/84-10830000/89
           lock: 0xeea99a68, .magic: dead4ead, .owner: irq/84-10830000/89, .owner_cpu: 1
          CPU: 1 PID: 89 Comm: irq/84-10830000 Not tainted 4.11.0-rc1-00001-g897ca6d0800d #559
          Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
          [<c010e1ec>] (unwind_backtrace) from [<c010ae1c>] (show_stack+0x10/0x14)
          [<c010ae1c>] (show_stack) from [<c03449c0>] (dump_stack+0x78/0x8c)
          [<c03449c0>] (dump_stack) from [<c015de68>] (do_raw_spin_lock+0x11c/0x120)
          [<c015de68>] (do_raw_spin_lock) from [<c0720110>] (_raw_spin_lock_irqsave+0x20/0x28)
          [<c0720110>] (_raw_spin_lock_irqsave) from [<c0572ca0>] (s5p_aes_crypt+0x2c/0xb4)
          [<c0572ca0>] (s5p_aes_crypt) from [<bf1d8aa4>] (do_encrypt+0x78/0xb0 [lrw])
          [<bf1d8aa4>] (do_encrypt [lrw]) from [<bf1d8b00>] (encrypt_done+0x24/0x54 [lrw])
          [<bf1d8b00>] (encrypt_done [lrw]) from [<c05732a0>] (s5p_aes_complete+0x60/0xcc)
          [<c05732a0>] (s5p_aes_complete) from [<c0573440>] (s5p_aes_interrupt+0x134/0x1a0)
          [<c0573440>] (s5p_aes_interrupt) from [<c01667c4>] (irq_thread_fn+0x1c/0x54)
          [<c01667c4>] (irq_thread_fn) from [<c0166a98>] (irq_thread+0x12c/0x1e0)
          [<c0166a98>] (irq_thread) from [<c0136a28>] (kthread+0x108/0x138)
          [<c0136a28>] (kthread) from [<c0107778>] (ret_from_fork+0x14/0x3c)
      
      Interrupt handling routine was calling req->base.complete() under
      spinlock.  In most cases this wasn't fatal but when combined with some
      of the cipher modes (like LRW) this caused recursion - starting the new
      encryption (s5p_aes_crypt()) while still holding the spinlock from
      previous round (s5p_aes_complete()).
      
      Beside that, the s5p_aes_interrupt() error handling path could execute
      two completions in case of error for RX and TX blocks.
      
      Rewrite the interrupt handling routine and the completion by:
      
      1. Splitting the operations on scatterlist copies from
         s5p_aes_complete() into separate s5p_sg_done(). This still should be
         done under lock.
         The s5p_aes_complete() now only calls req->base.complete() and it has
         to be called outside of lock.
      
      2. Moving the s5p_aes_complete() out of spinlock critical sections.
         In interrupt service routine s5p_aes_interrupts(), it appeared in few
         places, including error paths inside other functions called from ISR.
         This code was not so obvious to read so simplify it by putting the
         s5p_aes_complete() only within ISR level.
      Reported-by: NNathan Royce <nroycea+kernel@gmail.com>
      Cc: <stable@vger.kernel.org> # v4.10.x: 07de4bc8 crypto: s5p-sss - Fix completing
      Cc: <stable@vger.kernel.org> # v4.10.x
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      28b62b14
  12. 08 3月, 2017 1 次提交
  13. 31 5月, 2016 1 次提交
  14. 28 4月, 2016 1 次提交
  15. 25 4月, 2016 2 次提交
    • K
      crypto: s5p-sss - Fix missed interrupts when working with 8 kB blocks · 79152e8d
      Krzysztof Kozlowski 提交于
      The tcrypt testing module on Exynos5422-based Odroid XU3/4 board failed on
      testing 8 kB size blocks:
      
      	$ sudo modprobe tcrypt sec=1 mode=500
      	testing speed of async ecb(aes) (ecb-aes-s5p) encryption
      	test 0 (128 bit key, 16 byte blocks): 21971 operations in 1 seconds (351536 bytes)
      	test 1 (128 bit key, 64 byte blocks): 21731 operations in 1 seconds (1390784 bytes)
      	test 2 (128 bit key, 256 byte blocks): 21932 operations in 1 seconds (5614592 bytes)
      	test 3 (128 bit key, 1024 byte blocks): 21685 operations in 1 seconds (22205440 bytes)
      	test 4 (128 bit key, 8192 byte blocks):
      
      This was caused by a race issue of missed BRDMA_DONE ("Block cipher
      Receiving DMA") interrupt. Device starts processing the data in DMA mode
      immediately after setting length of DMA block: receiving (FCBRDMAL) or
      transmitting (FCBTDMAL). The driver sets these lengths from interrupt
      handler through s5p_set_dma_indata() function (or xxx_setdata()).
      
      However the interrupt handler was first dealing with receive buffer
      (dma-unmap old, dma-map new, set receive block length which starts the
      operation), then with transmit buffer and finally was clearing pending
      interrupts (FCINTPEND). Because of the time window between setting
      receive buffer length and clearing pending interrupts, the operation on
      receive buffer could end already and driver would miss new interrupt.
      
      User manual for Exynos5422 confirms in example code that setting DMA
      block lengths should be the last operation.
      
      The tcrypt hang could be also observed in following blocked-task dmesg:
      
      INFO: task modprobe:258 blocked for more than 120 seconds.
            Not tainted 4.6.0-rc4-next-20160419-00005-g9eac8b7b7753-dirty #42
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      modprobe        D c06b09d8     0   258    256 0x00000000
      [<c06b09d8>] (__schedule) from [<c06b0f24>] (schedule+0x40/0xac)
      [<c06b0f24>] (schedule) from [<c06b49f8>] (schedule_timeout+0x124/0x178)
      [<c06b49f8>] (schedule_timeout) from [<c06b17fc>] (wait_for_common+0xb8/0x144)
      [<c06b17fc>] (wait_for_common) from [<bf0013b8>] (test_acipher_speed+0x49c/0x740 [tcrypt])
      [<bf0013b8>] (test_acipher_speed [tcrypt]) from [<bf003e8c>] (do_test+0x2240/0x30ec [tcrypt])
      [<bf003e8c>] (do_test [tcrypt]) from [<bf008048>] (tcrypt_mod_init+0x48/0xa4 [tcrypt])
      [<bf008048>] (tcrypt_mod_init [tcrypt]) from [<c010177c>] (do_one_initcall+0x3c/0x16c)
      [<c010177c>] (do_one_initcall) from [<c0191ff0>] (do_init_module+0x5c/0x1ac)
      [<c0191ff0>] (do_init_module) from [<c0185610>] (load_module+0x1a30/0x1d08)
      [<c0185610>] (load_module) from [<c0185ab0>] (SyS_finit_module+0x8c/0x98)
      [<c0185ab0>] (SyS_finit_module) from [<c01078c0>] (ret_fast_syscall+0x0/0x3c)
      
      Fixes: a49e490c ("crypto: s5p-sss - add S5PV210 advanced crypto engine support")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      79152e8d
    • K
      crypto: s5p-sss - Use common BIT macro · 5e00c604
      Krzysztof Kozlowski 提交于
      The BIT() macro is obvious and well known, so prefer to use it instead
      of crafted own macro.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5e00c604
  16. 20 4月, 2016 2 次提交
  17. 05 4月, 2016 3 次提交
  18. 25 1月, 2016 2 次提交
  19. 20 10月, 2014 1 次提交
  20. 13 5月, 2014 1 次提交
    • A
      crypto: s5p-sss - fix multiplatform build · 56b28446
      Arnd Bergmann 提交于
      As we are preparing to enable multiplatform support on EXYNOS,
      we can no longer include mach/*.h or plat/*.h headers from device
      drivers.
      
      The s5p-sss driver was just enabled for EXYNOS when it used to
      be used only on s5pv210, and it includes two samsung platform
      specific header files for historic reasons. Fortunately, it no
      longer actually needs them, so we can remove the #includes and
      avoid the problem
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
      Cc: Tomasz Figa <t.figa@samsung.com>
      Cc: <linux-samsung-soc@vger.kernel.org>
      Cc: Vladimir Zapolskiy <vz@mleia.com>
      Reviewed-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      56b28446
  21. 08 5月, 2014 6 次提交