Merge tag 'dmaengine-4.19-rc1' of git://git.infradead.org/users/vkoul/slave-dma
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Aug 2018 22:55:59 +0000 (15:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Aug 2018 22:55:59 +0000 (15:55 -0700)
Pull DMAengine updates from Vinod Koul:
 "This round brings couple of framework changes, a new driver and usual
  driver updates:

   - new managed helper for dmaengine framework registration

   - split dmaengine pause capability to pause and resume and allow
     drivers to report that individually

   - update dma_request_chan_by_mask() to handle deferred probing

   - move imx-sdma to use virt-dma

   - new driver for Actions Semi Owl family S900 controller

   - minor updates to intel, renesas, mv_xor, pl330 etc"

* tag 'dmaengine-4.19-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (46 commits)
  dmaengine: Add Actions Semi Owl family S900 DMA driver
  dt-bindings: dmaengine: Add binding for Actions Semi Owl SoCs
  dmaengine: sh: rcar-dmac: Should not stop the DMAC by rcar_dmac_sync_tcr()
  dmaengine: mic_x100_dma: use the new helper to simplify the code
  dmaengine: add a new helper dmaenginem_async_device_register
  dmaengine: imx-sdma: add memcpy interface
  dmaengine: imx-sdma: add SDMA_BD_MAX_CNT to replace '0xffff'
  dmaengine: dma_request_chan_by_mask() to handle deferred probing
  dmaengine: pl330: fix irq race with terminate_all
  dmaengine: Revert "dmaengine: mv_xor_v2: enable COMPILE_TEST"
  dmaengine: mv_xor_v2: use {lower,upper}_32_bits to configure HW descriptor address
  dmaengine: mv_xor_v2: enable COMPILE_TEST
  dmaengine: mv_xor_v2: move unmap to before callback
  dmaengine: mv_xor_v2: convert callback to helper function
  dmaengine: mv_xor_v2: kill the tasklets upon exit
  dmaengine: mv_xor_v2: explicitly freeup irq
  dmaengine: sh: rcar-dmac: Add dma_pause operation
  dmaengine: sh: rcar-dmac: add a new function to clear CHCR.DE with barrier
  dmaengine: idma64: Support dmaengine_terminate_sync()
  dmaengine: hsu: Support dmaengine_terminate_sync()
  ...

1  2 
drivers/dma/pl330.c
sound/soc/soc-generic-dmaengine-pcm.c

diff --combined drivers/dma/pl330.c
@@@ -1046,13 -1046,16 +1046,16 @@@ static bool _start(struct pl330_thread 
  
                if (_state(thrd) == PL330_STATE_KILLING)
                        UNTIL(thrd, PL330_STATE_STOPPED)
+               /* fall through */
  
        case PL330_STATE_FAULTING:
                _stop(thrd);
+               /* fall through */
  
        case PL330_STATE_KILLING:
        case PL330_STATE_COMPLETING:
                UNTIL(thrd, PL330_STATE_STOPPED)
+               /* fall through */
  
        case PL330_STATE_STOPPED:
                return _trigger(thrd);
@@@ -1779,8 -1782,6 +1782,6 @@@ static inline void _free_event(struct p
  
  static void pl330_release_channel(struct pl330_thread *thrd)
  {
-       struct pl330_dmac *pl330;
        if (!thrd || thrd->free)
                return;
  
        dma_pl330_rqcb(thrd->req[1 - thrd->lstenq].desc, PL330_ERR_ABORT);
        dma_pl330_rqcb(thrd->req[thrd->lstenq].desc, PL330_ERR_ABORT);
  
-       pl330 = thrd->dmac;
        _free_event(thrd, thrd->ev);
        thrd->free = true;
  }
@@@ -2257,13 -2256,14 +2256,14 @@@ static int pl330_terminate_all(struct d
  
        pm_runtime_get_sync(pl330->ddma.dev);
        spin_lock_irqsave(&pch->lock, flags);
        spin_lock(&pl330->lock);
        _stop(pch->thread);
-       spin_unlock(&pl330->lock);
        pch->thread->req[0].desc = NULL;
        pch->thread->req[1].desc = NULL;
        pch->thread->req_running = -1;
+       spin_unlock(&pl330->lock);
        power_down = pch->active;
        pch->active = false;
  
@@@ -3033,7 -3033,7 +3033,7 @@@ pl330_probe(struct amba_device *adev, c
        pd->src_addr_widths = PL330_DMA_BUSWIDTHS;
        pd->dst_addr_widths = PL330_DMA_BUSWIDTHS;
        pd->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 -      pd->residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
 +      pd->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
        pd->max_burst = ((pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) ?
                         1 : PL330_MAX_BURST);
  
@@@ -1,8 -1,17 +1,8 @@@
 -/*
 - *  Copyright (C) 2013, Analog Devices Inc.
 - *    Author: Lars-Peter Clausen <lars@metafoo.de>
 - *
 - *  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, or (at your
 - *  option) any later version.
 - *
 - *  You should have received a copy of the GNU General Public License along
 - *  with this program; if not, write to the Free Software Foundation, Inc.,
 - *  675 Mass Ave, Cambridge, MA 02139, USA.
 - *
 - */
 +// SPDX-License-Identifier: GPL-2.0+
 +//
 +//  Copyright (C) 2013, Analog Devices Inc.
 +//    Author: Lars-Peter Clausen <lars@metafoo.de>
 +
  #include <linux/module.h>
  #include <linux/init.h>
  #include <linux/dmaengine.h>
@@@ -147,7 -156,7 +147,7 @@@ static int dmaengine_pcm_set_runtime_hw
  
        ret = dma_get_slave_caps(chan, &dma_caps);
        if (ret == 0) {
-               if (dma_caps.cmd_pause)
+               if (dma_caps.cmd_pause && dma_caps.cmd_resume)
                        hw.info |= SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME;
                if (dma_caps.residue_granularity <= DMA_RESIDUE_GRANULARITY_SEGMENT)
                        hw.info |= SNDRV_PCM_INFO_BATCH;
                        case 32:
                        case 64:
                                if (addr_widths & (1 << (bits / 8)))
 -                                      hw.formats |= (1LL << i);
 +                                      hw.formats |= pcm_format_to_bits(i);
                                break;
                        default:
                                /* Unsupported types */
@@@ -334,7 -343,7 +334,7 @@@ static snd_pcm_uframes_t dmaengine_pcm_
  
  static int dmaengine_copy_user(struct snd_pcm_substream *substream,
                               int channel, unsigned long hwoff,
 -                             void *buf, unsigned long bytes)
 +                             void __user *buf, unsigned long bytes)
  {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_component *component =
        int ret;
  
        if (is_playback)
 -              if (copy_from_user(dma_ptr, (void __user *)buf, bytes))
 +              if (copy_from_user(dma_ptr, buf, bytes))
                        return -EFAULT;
  
        if (process) {
 -              ret = process(substream, channel, hwoff,
 -                            (void __user *)buf, bytes);
 +              ret = process(substream, channel, hwoff, (__force void *)buf, bytes);
                if (ret < 0)
                        return ret;
        }
  
        if (!is_playback)
 -              if (copy_to_user((void __user *)buf, dma_ptr, bytes))
 +              if (copy_to_user(buf, dma_ptr, bytes))
                        return -EFAULT;
  
        return 0;