18 Sep, 2020

1 commit

  • In preparation for unconditionally passing the
    struct tasklet_struct pointer to all tasklet
    callbacks, switch to using the new tasklet_setup()
    and from_tasklet() to pass the tasklet pointer explicitly.

    Signed-off-by: Romain Perier
    Signed-off-by: Allen Pais
    Link: https://lore.kernel.org/r/20200831103542.305571-13-allen.lkml@gmail.com
    Signed-off-by: Vinod Koul

    Allen Pais
     

23 Dec, 2019

1 commit

  • In some cases we seem to submit two transactions in a row, which
    causes us to lose track of the first. If we then cancel the
    request, we may still get an interrupt, which traverses a null
    ds_run value.

    So try to avoid starting a new transaction if the ds_run value
    is set.

    While this patch avoids the null pointer crash, I've had some
    reports of the k3dma driver still getting confused, which
    suggests the ds_run/ds_done value handling still isn't quite
    right. However, I've not run into an issue recently with it
    so I think this patch is worth pushing upstream to avoid the
    crash.

    Signed-off-by: John Stultz
    [add ss tag]
    Link: https://lore.kernel.org/r/20191218190906.6641-1-john.stultz@linaro.org
    Signed-off-by: Vinod Koul

    John Stultz
     

14 Oct, 2019

1 commit


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
     

04 Feb, 2019

3 commits

  • Add dma-channel-mask as a property for k3dma, it defines
    available dma channels which a non-secure mode driver can use.

    One sample usage of this is in Hi3660 SoC. DMA channel 0 is
    reserved to lpm3, which is a coprocessor for power management. So
    as a result, any request in kernel (which runs on main processor
    and in non-secure mode) should start from at least channel 1.

    Cc: Dan Williams
    Cc: Vinod Koul
    Cc: Tanglei Han
    Cc: Zhuangluan Su
    Cc: Ryan Grachek
    Cc: Manivannan Sadhasivam
    Cc: Guodong Xu
    Cc: dmaengine@vger.kernel.org
    Signed-off-by: Li Yu
    [jstultz: Reworked to use a channel mask]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Li Yu
     
  • Axi_config controls whether DMA resources can be accessed in non-secure
    mode, such as linux kernel. The register should be set by the bootloader
    stage and depends on the device.

    Thus, this patch removes axi_config from k3dma driver.

    Cc: Dan Williams
    Cc: Vinod Koul
    Cc: Tanglei Han
    Cc: Zhuangluan Su
    Cc: Ryan Grachek
    Cc: Manivannan Sadhasivam
    Cc: dmaengine@vger.kernel.org
    Acked-by: Manivannan Sadhasivam
    Signed-off-by: Li Yu
    Signed-off-by: Guodong Xu
    [jstultz: Minor tweaks to commit message]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Li Yu
     
  • On the hi3660 hardware there are two (at least) DMA controllers,
    the DMA-P (Peripheral DMA) and the DMA-A (Audio DMA). The
    two blocks are similar, but have some slight differences. This
    resulted in the vendor implementing two separate drivers, which
    after review, they have been able to condense and re-use the
    existing k3dma driver.

    Thus, this patch adds support for the new "hisi-pcm-asp-dma-1.0"
    compatible string in the binding.

    One difference with the DMA-A controller, is that it does not
    need to initialize a clock. So we skip this by adding and using
    soc data flags.

    After above this driver will support both k3 and hisi_asp dma
    hardware.

    Cc: Dan Williams
    Cc: Vinod Koul
    Cc: Zhuangluan Su
    Cc: Ryan Grachek
    Cc: Manivannan Sadhasivam
    Cc: dmaengine@vger.kernel.org
    Acked-by: Manivannan Sadhasivam
    Signed-off-by: Youlin Wang
    Signed-off-by: Tanglei Han
    [jstultz: Reworked to use of_match_data, commit msg improvements]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Youlin Wang
     

07 Oct, 2018

2 commits


28 Jun, 2018

1 commit


13 Jun, 2018

1 commit

  • The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
    This patch replaces cases of:

    devm_kzalloc(handle, a * b, gfp)

    with:
    devm_kcalloc(handle, a * b, gfp)

    as well as handling cases of:

    devm_kzalloc(handle, a * b * c, gfp)

    with:

    devm_kzalloc(handle, array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    devm_kcalloc(handle, array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    devm_kzalloc(handle, 4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    Some manual whitespace fixes were needed in this patch, as Coccinelle
    really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    expression HANDLE;
    type TYPE;
    expression THING, E;
    @@

    (
    devm_kzalloc(HANDLE,
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression HANDLE;
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    expression HANDLE;
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    expression HANDLE;
    identifier SIZE, COUNT;
    @@

    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression HANDLE;
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression HANDLE;
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    expression HANDLE;
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression HANDLE;
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression HANDLE;
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
    |
    devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2, ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

05 Dec, 2017

1 commit


25 Aug, 2017

3 commits

  • Commit 36387a2b1f62b5c087c5fe6f0f7b23b94f722ad7 ("k3dma: Fix
    memory handling in preparation for cyclic mode") adds few
    calls to ON_WARN_ONCE() to track the use of ds_run/ds_done.

    After the two fixes:
    - dmaengine: k3dma: fix non-cyclic mode
    - dmaengine: k3dma: fix re-free of the same descriptor
    the behaviour of ds_run/ds_done is properly fixed.
    The remaining ON_WARN_ONCE() are never triggered and can be
    removed.

    Signed-off-by: Antonio Borneo
    Signed-off-by: Vinod Koul

    Antonio Borneo
     
  • Commit 36387a2b1f62b5c087c5fe6f0f7b23b94f722ad7 ("k3dma: Fix
    memory handling in preparation for cyclic mode") adds code
    to free the descriptor in ds_done.

    In cyclic mode, ds_done is never used and it's always NULL,
    so the added code is not executed.

    In non-cyclic mode, ds_done is used as a flag: when not NULL
    it signals that the descriptor has been consumed. No need to
    free it because it would be free by vchan_complete().

    The fix takes back the code changed by the commit above:
    - remove the free on the descriptor;
    - initialize ds_done to NULL for the next run.

    Signed-off-by: Antonio Borneo
    Signed-off-by: Vinod Koul

    Antonio Borneo
     
  • Commit 36387a2b1f62b5c087c5fe6f0f7b23b94f722ad7 ("k3dma: Fix
    memory handling in preparation for cyclic mode") broke the
    logic around ds_run/ds_done in case of non-cyclic DMA.

    This went unnoticed as the only user of k3dma was the i2s
    audio driver but, with a patch set to enable dma on SPI, the
    issue popped out.

    The fix re-applies the initialization to ds_run/ds_done in
    k3_dma_start_txd() that were removed by the commit above.

    Also, one of the calls to k3_dma_start_txd() is triggered by
    (ds_done != NULL), so remove the noisy and useless call to
    WARN_ON_ONCE().

    Signed-off-by: Antonio Borneo
    Signed-off-by: Vinod Koul

    Antonio Borneo
     

08 Dec, 2016

1 commit


07 Sep, 2016

1 commit

  • The newly added k3_dma_prep_dma_cyclic function has some debug output
    that uses incorrect typecasts, some of which cause a warning like:

    drivers/dma/k3dma.c: In function 'k3_dma_prep_dma_cyclic':
    drivers/dma/k3dma.c:589:671: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

    In general, we have to print 'dma_addr_t' values using special
    '%pad' format to get the correct behavior on kernels that have
    a 64-bit dma_addr_t type but 32-bit pointers.

    Similarly, printing size_t values should be done using the %z
    modifier to get the correct behavior on 64-bit kernels.

    Signed-off-by: Arnd Bergmann
    Fixes: a7e08fa6cc78 ("k3dma: Add cyclic mode for audio")
    Signed-off-by: Vinod Koul

    Arnd Bergmann
     

31 Aug, 2016

6 commits

  • Currently the k3dma driver doesn't offer the cyclic mode
    necessary for handling audio.

    This patch adds it.

    Cc: Zhangfei Gao
    Cc: Krzysztof Kozlowski
    Cc: Maxime Ripard
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: Mark Brown
    Cc: Andy Green
    Acked-by: Zhangfei Gao
    Signed-off-by: Andy Green
    [jstultz: Forward ported to mainline, removed a few
    bits of logic that didn't seem to have much effect]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Andy Green
     
  • With cyclic mode, the shared virt-dma logic doesn't actually
    manage the descriptor state, nor the calling of the descriptor
    free callback. This results in leaking a desc structure every
    time we start an audio transfer.

    Thus we must manage it ourselves. The k3dma driver already keeps
    track of the active and finished descriptors via ds_run and ds_done
    pointers, so cleanup how we handle those two values, so when we
    tear down everything in terminate_all, call free_desc on the ds_run
    and ds_done pointers if they are not null.

    NOTE: HiKey doesn't use the non-cyclic dma modes, so I'm not been
    able to test those modes. But with this patch we no longer leak
    the desc structures.

    Cc: Zhangfei Gao
    Cc: Krzysztof Kozlowski
    Cc: Maxime Ripard
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: Mark Brown
    Cc: Andy Green
    Acked-by: Zhangfei Gao
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    John Stultz
     
  • After lots of debugging on an occasional DMA ERR issue, I realized
    that the desc structures which we point the dma hardware are being
    allocated out of regular memory. This means when we fill the desc
    structures, that data doesn't always get flushed out to memory by
    the time we start the dma transfer, resulting in the dma engine getting
    some null values, resulting in a DMA ERR on the first irq.

    Thus, this patch adopts mechanism similar to the zx296702_dma of
    allocating the desc structures from a dma pool, so the memory caching
    rules are properly set to avoid this issue.

    Cc: Zhangfei Gao
    Cc: Krzysztof Kozlowski
    Cc: Maxime Ripard
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: Mark Brown
    Cc: Andy Green
    Acked-by: Zhangfei Gao
    Signed-off-by: John Stutlz
    Signed-off-by: Vinod Koul

    John Stultz
     
  • As it was before, as soon as the DMAC IP felt there was an error
    he would return IRQ_NONE since no actual transfer had completed.

    After spinning on that for 100K interrupts, Linux yanks the IRQ with
    a "nobody cared" error.

    This patch lets it handle the interrupt and keep the IRQ alive.

    Cc: Zhangfei Gao
    Cc: Krzysztof Kozlowski
    Cc: Maxime Ripard
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: Mark Brown
    Cc: Andy Green
    Acked-by: Zhangfei Gao
    Signed-off-by: Andy Green
    [jstultz: Forward ported to mainline]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Andy Green
     
  • The offsets for ERR1 and ERR2 are wrong actually.
    That's why you can never clear an error.

    Cc: Zhangfei Gao
    Cc: Krzysztof Kozlowski
    Cc: Maxime Ripard
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: Mark Brown
    Cc: Andy Green
    Acked-by: Zhangfei Gao
    Signed-off-by: Andy Green
    [jstultz: Forward ported to mainline]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Andy Green
     
  • Max burst len is a 4-bit field, but at the moment it's clipped with
    a 5-bit constant... reduce it to that which can be expressed

    Cc: Zhangfei Gao
    Cc: Krzysztof Kozlowski
    Cc: Maxime Ripard
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: Mark Brown
    Cc: Andy Green
    Acked-by: Zhangfei Gao
    Signed-off-by: Andy Green
    [jstultz: Forward ported to mainline]
    Signed-off-by: John Stultz
    Signed-off-by: Vinod Koul

    Andy Green
     

28 Jul, 2016

1 commit


24 Jul, 2016

1 commit


16 Jul, 2016

1 commit

  • dmaengine device should explicitly call devm_free_irq() when using
    devm_request_irq().

    The irq is still ON when devices remove is executed and irq should be
    quiesced before remove is completed.

    Signed-off-by: Vinod Koul
    Acked-by: Zhangfei Gao

    Vinod Koul
     

22 Jun, 2016

1 commit


05 Aug, 2015

1 commit

  • Most drivers need to set constraints on the buffer alignment for async tx
    operations. However, even though it is documented, some drivers either use
    a defined constant that is not matching what the alignment variable expects
    (like DMA_BUSWIDTH_* constants) or fill the alignment in bytes instead of
    power of two.

    Add a new enum for these alignments that matches what the framework
    expects, and convert the drivers to it.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Vinod Koul

    Maxime Ripard
     

19 Mar, 2015

3 commits


13 Jan, 2015

2 commits

  • Commit db08425ebd51f ("dmaengine: k3: Split device_control") introduced
    two new helper functions, which unfortunately have the same names
    as the existing suspend/resume functions, resulting in a build error
    when CONFIG_PM_SLEEP is enabled:

    drivers/dma/k3dma.c:823:12: error: conflicting types for 'k3_dma_resume'
    static int k3_dma_resume(struct device *dev)
    ^
    drivers/dma/k3dma.c:625:12: note: previous definition of 'k3_dma_resume' was here
    static int k3_dma_resume(struct dma_chan *chan)
    ^

    Signed-off-by: Arnd Bergmann
    Fixes: db08425ebd51f ("dmaengine: k3: Split device_control")
    Reported-by: Mark Brown
    Signed-off-by: Vinod Koul

    Arnd Bergmann
     
  • While splitting device control in db08425ebd51 ("dmaengine: k3:
    Split device_control") new function with the same 'k3_dma_resume' name
    was added, leading to build error:

    drivers/dma/k3dma.c:823:12: error: conflicting types for ‘k3_dma_resume’
    drivers/dma/k3dma.c:625:12: note: previous definition of ‘k3_dma_resume’ was here

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Vinod Koul

    Krzysztof Kozlowski
     

22 Dec, 2014

1 commit

  • Split the device_control callback of the Hisilicon K3 DMA driver to make use
    of the newly introduced callbacks, that will eventually be used to retrieve
    slave capabilities.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Vinod Koul

    Maxime Ripard
     

17 Nov, 2014

1 commit

  • Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
    build warning when CONFIG_PM_SLEEP is not selected. This is because
    sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
    the CONFIG_PM_SLEEP is enabled.

    drivers/dma/k3dma.c:790:12: warning: 'k3_dma_suspend' defined but not used [-Wunused-function]
    drivers/dma/k3dma.c:806:12: warning: 'k3_dma_resume' defined but not used [-Wunused-function]

    Signed-off-by: Jingoo Han
    Acked-by: Zhangfei Gao
    Signed-off-by: Vinod Koul

    Jingoo Han
     

06 Nov, 2014

2 commits

  • There is no need to init .owner field.

    Based on the patch from Peter Griffin
    "mmc: remove .owner field for drivers using module_platform_driver"

    This patch removes the superflous .owner field for drivers which
    use the module_platform_driver API, as this is overriden in
    platform_driver_register anyway."

    Signed-off-by: Kiran Padwal
    [for nvidia]
    Acked-by: Thierry Reding
    Signed-off-by: Vinod Koul

    Kiran Padwal
     
  • chanctnt is already filled by dma_async_device_register, which uses the channel
    list to know how much channels there is.

    Since it's already filled, we can safely remove it from the drivers' probe
    function.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Vinod Koul

    Maxime Ripard
     

20 Jan, 2014

1 commit

  • Fix sparse warnings:
    drivers/dma/k3dma.c:480:20: warning: Using plain integer as NULL pointer
    drivers/dma/k3dma.c:820:1: warning: symbol 'k3_dma_pmops' was not declared. Should it be static?

    Signed-off-by: Zhangfei Gao
    Signed-off-by: Vinod Koul

    Zhangfei Gao
     

25 Oct, 2013

1 commit


13 Oct, 2013

1 commit