1. 17 Aug, 2018 9 commits
  2. 09 Aug, 2018 2 commits
  3. 31 Jul, 2018 1 commit
    • Yoshihiro Shimoda's avatar
      dmaengine: sh: rcar-dmac: Should not stop the DMAC by rcar_dmac_sync_tcr() · 218c2104
      Yoshihiro Shimoda authored
      rcar_dmac_chan_get_residue() should not stop the DMAC, because
      the commit 538603c6 ("dmaengine: sh: rcar-dmac: avoid to write
      CHCR.TE to 1 if TCR is set to 0") had fixed unexpected re-transferring
      issue. But it had caused the next issue which might stop the cyclic
      mode transferring. Thus, for example R-Car sound might be stopped
      suddenly.
      
      According to the commit 73a47bd0 ("dmaengine: rcar-dmac: use TCRB
      instead of TCR for residue"), the purpose of clearing CHCR.DE bit is
      flushing buffered data to calculate the exact residue.
      
      Such the "exact" residue had been required by sh-sci driver. sh-sci
      driver is calling dmaengine_pause() to stop transferring, and get
      "exact" residue. Otherwise, it might receive extra data during
      getting residue without pausing.
      
      In rx_timer_fn() of sh-sci driver:
      	dmaengine_tx_status();		/* For checking roughly */
       	dmaengine_pause();
      	dmaengine_tx_status();		/* For getting residue */
      	dmaengine_terminate_all();
      
      But, unfortunately the rcar-dmac driver didn't support dmaengine_pause()
      at that time. So, the sh-sci driver cannot get the "exact" residue
      without stopping the transferring, because rcar-dmac is buffering data
      inside.
      
      Because of these backgrounds, rcar-dmac had been cleared/set CHCR.DE
      bit in rcar_dmac_chan_get_residue() to synchronizing data and getting
      "exact" residue.
      
      However, rcar-dmac driver has rcar_dmac_chan_pause() now, and clearing
      CHCR.DE bit in rcar_dmac_chan_get_residue() doesn't need anymore.
      So, this patch removes the rcar_dmac_sync_tcr().
      
      Fixes: 73a47bd0 ("dmaengine: rcar-dmac: use TCRB instead of TCR for residue")
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Tested-by: default avatarHiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      218c2104
  4. 30 Jul, 2018 2 commits
  5. 25 Jul, 2018 3 commits
  6. 20 Jul, 2018 5 commits
  7. 11 Jul, 2018 2 commits
  8. 10 Jul, 2018 3 commits
  9. 09 Jul, 2018 5 commits
    • Benjamin Gaignard's avatar
      dmaengine: stm32: replace "%p" with "%pK" · 90ec93cb
      Benjamin Gaignard authored
      The format specifier "%p" can leak kernel addresses.
      Use "%pK" instead.
      Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@st.com>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      90ec93cb
    • Marek Szyprowski's avatar
      dmaengine: add support for reporting pause and resume separately · d8095f94
      Marek Szyprowski authored
      'cmd_pause' DMA channel capability means that respective DMA engine
      supports both pausing and resuming given DMA channel. However, in some
      cases it is important to know if DMA channel can be paused without the
      need to resume it. This is a typical requirement for proper residue
      reading on transfer timeout in UART drivers. There are also some DMA
      engines with limited hardware, which doesn't really support resuming.
      
      Reporting pause and resume capabilities separately allows UART drivers to
      properly check for the really required capabilities and operate in DMA
      mode also in systems with limited DMA hardware. On the other hand drivers,
      which rely on full channel suspend/resume support, should now check for
      both 'pause' and 'resume' features.
      
      Existing clients of dma_get_slave_caps() have been checked and the only
      driver which rely on proper channel resuming is soc-generic-dmaengine-pcm
      driver, which has been updated to check the newly added capability.
      Existing 'cmd_pause' now only indicates that DMA engine support pausing
      given DMA channel.
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      d8095f94
    • Kuninori Morimoto's avatar
      dmaengine: rcar-dmac: clear channel register when error · e919417b
      Kuninori Morimoto authored
      We need to clear channel register in error case as recovery.
      The channel is already stopped in such case, thus we don't need to call
      rcar_dmac_chan_halt() before clearing.
      
      rcar_dmac_chan_halt() will clear and confirm DE bit.
      But it will be failed because channel is already stopped in error case.
      In other words, we shouldn't call it then.
      Reported-by: default avatarHiroki Negishi <hiroki.negishi.bx@renesas.com>
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Reviewed-by: default avatarHiroki Negishi <hiroki.negishi.bx@renesas.com>
      Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      e919417b
    • Geert Uytterhoeven's avatar
      dmaengine: rcar-dmac: Disable interrupts while stopping channels · 45c9a603
      Geert Uytterhoeven authored
      During system reboot or halt, with lockdep enabled:
      
          ================================
          WARNING: inconsistent lock state
          4.18.0-rc1-salvator-x-00002-g9203dbec #41 Tainted: G        W
          --------------------------------
          inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
          reboot/2779 [HC0[0]:SC0[0]:HE1:SE1] takes:
          0000000098ae4ad3 (&(&rchan->lock)->rlock){?.-.}, at: rcar_dmac_shutdown+0x58/0x6c
          {IN-HARDIRQ-W} state was registered at:
            lock_acquire+0x208/0x238
            _raw_spin_lock+0x40/0x54
            rcar_dmac_isr_channel+0x28/0x200
            __handle_irq_event_percpu+0x1c0/0x3c8
            handle_irq_event_percpu+0x34/0x88
            handle_irq_event+0x48/0x78
            handle_fasteoi_irq+0xc4/0x12c
            generic_handle_irq+0x18/0x2c
            __handle_domain_irq+0xa8/0xac
            gic_handle_irq+0x78/0xbc
            el1_irq+0xec/0x1c0
            arch_cpu_idle+0xe8/0x1bc
            default_idle_call+0x2c/0x30
            do_idle+0x144/0x234
            cpu_startup_entry+0x20/0x24
            rest_init+0x27c/0x290
            start_kernel+0x430/0x45c
          irq event stamp: 12177
          hardirqs last  enabled at (12177): [<ffffff800881d804>] _raw_spin_unlock_irq+0x2c/0x4c
          hardirqs last disabled at (12176): [<ffffff800881d638>] _raw_spin_lock_irq+0x1c/0x60
          softirqs last  enabled at (11948): [<ffffff8008081da8>] __do_softirq+0x160/0x4ec
          softirqs last disabled at (11935): [<ffffff80080ec948>] irq_exit+0xa0/0xfc
      
          other info that might help us debug this:
           Possible unsafe locking scenario:
      
      	   CPU0
      	   ----
            lock(&(&rchan->lock)->rlock);
            <Interrupt>
      	lock(&(&rchan->lock)->rlock);
      
           *** DEADLOCK ***
      
          3 locks held by reboot/2779:
           #0: 00000000bfabfa74 (reboot_mutex){+.+.}, at: sys_reboot+0xdc/0x208
           #1: 00000000c75d8c3a (&dev->mutex){....}, at: device_shutdown+0xc8/0x1c4
           #2: 00000000ebec58ec (&dev->mutex){....}, at: device_shutdown+0xd8/0x1c4
      
          stack backtrace:
          CPU: 6 PID: 2779 Comm: reboot Tainted: G        W         4.18.0-rc1-salvator-x-00002-g9203dbec #41
          Hardware name: Renesas Salvator-X 2nd version board based on r8a7795 ES2.0+ (DT)
          Call trace:
           dump_backtrace+0x0/0x148
           show_stack+0x14/0x1c
           dump_stack+0xb0/0xf0
           print_usage_bug.part.26+0x1c4/0x27c
           mark_lock+0x38c/0x610
           __lock_acquire+0x3fc/0x14d4
           lock_acquire+0x208/0x238
           _raw_spin_lock+0x40/0x54
           rcar_dmac_shutdown+0x58/0x6c
           platform_drv_shutdown+0x20/0x2c
           device_shutdown+0x160/0x1c4
           kernel_restart_prepare+0x34/0x3c
           kernel_restart+0x14/0x5c
           sys_reboot+0x160/0x208
           el0_svc_naked+0x30/0x34
      
      rcar_dmac_stop_all_chan() takes the channel lock while stopping a
      channel, but does not disable interrupts, leading to a deadlock when a
      DMAC interrupt comes in.  Before, the same code block was called from an
      interrupt handler, hence taking the spinlock was sufficient.
      
      Fix this by disabling local interrupts while taking the spinlock.
      
      Fixes: 9203dbec ("dmaengine: rcar-dmac: don't use DMAC error interrupt")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      45c9a603
    • Gustavo A. R. Silva's avatar
      dmaengine: nbpfaxi: Mark expected switch fall-through · 38fce264
      Gustavo A. R. Silva authored
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      38fce264
  10. 06 Jul, 2018 1 commit
  11. 02 Jul, 2018 1 commit
  12. 29 Jun, 2018 2 commits
  13. 28 Jun, 2018 1 commit
  14. 23 Jun, 2018 1 commit
  15. 19 Jun, 2018 1 commit
  16. 18 Jun, 2018 1 commit