28 May, 2016

1 commit

  • Most users of IS_ERR_VALUE() in the kernel are wrong, as they
    pass an 'int' into a function that takes an 'unsigned long'
    argument. This happens to work because the type is sign-extended
    on 64-bit architectures before it gets converted into an
    unsigned type.

    However, anything that passes an 'unsigned short' or 'unsigned int'
    argument into IS_ERR_VALUE() is guaranteed to be broken, as are
    8-bit integers and types that are wider than 'unsigned long'.

    Andrzej Hajda has already fixed a lot of the worst abusers that
    were causing actual bugs, but it would be nice to prevent any
    users that are not passing 'unsigned long' arguments.

    This patch changes all users of IS_ERR_VALUE() that I could find
    on 32-bit ARM randconfig builds and x86 allmodconfig. For the
    moment, this doesn't change the definition of IS_ERR_VALUE()
    because there are probably still architecture specific users
    elsewhere.

    Almost all the warnings I got are for files that are better off
    using 'if (err)' or 'if (err < 0)'.
    The only legitimate user I could find that we get a warning for
    is the (32-bit only) freescale fman driver, so I did not remove
    the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
    For 9pfs, I just worked around one user whose calling conventions
    are so obscure that I did not dare change the behavior.

    I was using this definition for testing:

    #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
    unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))

    which ends up making all 16-bit or wider types work correctly with
    the most plausible interpretation of what IS_ERR_VALUE() was supposed
    to return according to its users, but also causes a compile-time
    warning for any users that do not pass an 'unsigned long' argument.

    I suggested this approach earlier this year, but back then we ended
    up deciding to just fix the users that are obviously broken. After
    the initial warning that caused me to get involved in the discussion
    (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
    asked me to send the whole thing again.

    [ Updated the 9p parts as per Al Viro - Linus ]

    Signed-off-by: Arnd Bergmann
    Cc: Andrzej Hajda
    Cc: Andrew Morton
    Link: https://lkml.org/lkml/2016/1/7/363
    Link: https://lkml.org/lkml/2016/5/27/486
    Acked-by: Srinivas Kandagatla # For nvmem part
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

20 May, 2016

1 commit

  • Pull dmaengine updates from Vinod Koul:
    "This time round the update brings in following changes:

    - new tegra driver for ADMA device

    - support for Xilinx AXI Direct Memory Access Engine and Xilinx AXI
    Central Direct Memory Access Engine and few updates to this driver

    - new cyclic capability to sun6i and few updates

    - slave-sg support in bcm2835

    - updates to many drivers like designware, hsu, mv_xor, pxa, edma,
    qcom_hidma & bam"

    * tag 'dmaengine-4.7-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (84 commits)
    dmaengine: ioatdma: disable relaxed ordering for ioatdma
    dmaengine: of_dma: approximate an average distribution
    dmaengine: core: Use IS_ENABLED() instead of checking for built-in or module
    dmaengine: edma: Re-evaluate errors when ccerr is triggered w/o error event
    dmaengine: qcom_hidma: add support for object hierarchy
    dmaengine: qcom_hidma: add debugfs hooks
    dmaengine: qcom_hidma: implement lower level hardware interface
    dmaengine: vdma: Add clock support
    Documentation: DT: vdma: Add clock support for dmas
    dmaengine: vdma: Add config structure to differentiate dmas
    MAINTAINERS: Update Tegra DMA maintainers
    dmaengine: tegra-adma: Add support for Tegra210 ADMA
    Documentation: DT: Add binding documentation for NVIDIA ADMA
    dmaengine: vdma: Add Support for Xilinx AXI Central Direct Memory Access Engine
    Documentation: DT: vdma: update binding doc for AXI CDMA
    dmaengine: vdma: Add Support for Xilinx AXI Direct Memory Access Engine
    Documentation: DT: vdma: update binding doc for AXI DMA
    dmaengine: vdma: Rename xilinx_vdma_ prefix to xilinx_dma
    dmaengine: slave means at least one of DMA_SLAVE, DMA_CYCLIC
    dmaengine: mv_xor: Allow selecting mv_xor for mvebu only compatible SoC
    ...

    Linus Torvalds
     

17 May, 2016

12 commits


14 May, 2016

7 commits

  • ioatdma by default is in snoop mode. Relaxed ordering according to spec
    does not do anything in snoop mode. However, it causes hang or significant
    performance degrade when tested with NTB. Disabling in the driver due to
    some BIOS do not configure it correctly.

    Signed-off-by: Dave Jiang
    Signed-off-by: Vinod Koul

    Dave Jiang
     
  • Currently the following DT description would result in dmac0 always
    being tried first and dmac1 second if dmac0 was unavailable. This
    results in heavier use of dmac0 then of dmac1. This patch adds an
    approximate average distribution over the two nodes lessening the load
    of anyone of them.

    i2c6: i2c@e60b0000 {
    ...
    dmas = , ,
    , ;
    dma-names = "tx", "rx", "tx", "rx";
    ...
    };

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Niklas Söderlund
    Suggested-by: Arnd Bergmann
    Signed-off-by: Vinod Koul

    Niklas Söderlund
     
  • The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
    built-in or as a module, use that macro instead of open coding the same.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Vinod Koul

    Javier Martinez Canillas
     
  • When the ccerr handler is called but the error registers indicate no error
    events we need to command eDMA to re-evaluate the errors. Otherwise we can
    receive flood of error interrupts.

    Reported-by: Roger Quadros
    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     
  • In order to create a relationship model between the channels and the
    management object, we are adding support for object hierarchy to the
    drivers. This patch simplifies the userspace application development.
    We will not have to traverse different firmware paths based on device
    tree or ACPI based kernels.

    No matter what flavor of kernel is used, objects will be represented as
    platform devices.

    The new layout is as follows:

    hidmam_10: hidma-mgmt@0x5A000000 {
    compatible = "qcom,hidma-mgmt-1.0";
    ...

    hidma_10: hidma@0x5a010000 {
    compatible = "qcom,hidma-1.0";
    ...
    }
    }

    The hidma_mgmt_init detects each instance of the hidma-mgmt-1.0 objects
    in device tree and calls into the channel driver to create platform devices
    for each child of the management object.

    Signed-off-by: Sinan Kaya
    Signed-off-by: Vinod Koul

    Sinan Kaya
     
  • Add debugfs hooks for debugging the execution behavior of the DMA
    channel. The debugfs hooks get initialized by the probe function and
    uninitialized by the remove function.

    A stats file is created in debugfs. The stats file will show the
    information about each HIDMA channel as well as each asynchronous job
    queued and completed at a given time.

    Signed-off-by: Sinan Kaya
    Signed-off-by: Vinod Koul

    Sinan Kaya
     
  • This patch implements the hardware hooks for the HIDMA channel driver.

    The main functions of interest are:
    - hidma_ll_init
    - hidma_ll_request
    - hidma_ll_queue_request
    - hidma_ll_hw_start

    OS layer calls the hidma_ll_init function during probe to set up the
    hardware. At this moment, the number of supported descriptors are also
    given. On each request, a descriptor is allocated from the free pool and
    filled in with the transfer parameters. Multiple requests can be queued
    into the hardware via the OS interface. When client is ready for requests
    to be executed, start method is called.

    Completions are delivered via callbacks via tasklet.

    Signed-off-by: Sinan Kaya
    Signed-off-by: Vinod Koul

    Sinan Kaya
     

13 May, 2016

3 commits


12 May, 2016

4 commits


03 May, 2016

8 commits

  • Armada 3700 SoC uses the mv_xor driver but don't select anymore the
    PLAT_ORION symbol. This commit extends the dependency of the mv_xor
    driver to the more modern SoCs only compatible with ARCH_MVEBU, which
    allows using it with the Armada 3700 SoC.

    In the same time it also add the COMPILE_TEST dependency allowing a wider
    test coverage.

    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Vinod Koul

    Gregory CLEMENT
     
  • Armada 3700 SoC comprise a single XOR engine compliant with the ones used
    in older Marvell SoC's like Armada XP or 38x. The only thing that needs
    modification is the Mbus configuration, which has to be done on two
    levels: global and in device. The first one is inherited from the
    bootloader. The latter can be opened in a default way, leaving
    arbitration to the bus controller. Hence filled mbus_dram_target_info
    structure is not needed.

    Patch "dmaengine: mv_xor: optimize performance by using a subset
    of the XOR channels" introduced limitation for using XOR engines and
    channels vs number of available CPU's. Those constraints do not however
    fit Armada 3700 architecture with two possible CPU's and single,
    dual-channel engine. Hence in this commit an adjustment for setting
    maximum available channels is added.

    This patch enables XOR access to DRAM by opening default window to 4GB
    space with specific attribute.

    Signed-off-by: Marcin Wojtas
    Signed-off-by: Gregory CLEMENT
    Acked-by: Rob Herring
    Signed-off-by: Vinod Koul

    Marcin Wojtas
     
  • Currently the main difference between legacy XOR engine and newer one, is
    the way the engine modes are setup (either in the descriptor or through
    the controller registers). In order to be able to take into account new
    generation of the XOR engine for the ARM64 SoC, we need to identify them
    by type, and then depending to the type the engine setup will be
    selected.

    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Vinod Koul

    Gregory CLEMENT
     
  • Fix two warnings which appear when building for 64 bits target:

    drivers/dma/mv_xor.c: In function ‘mv_xor_prep_dma_xor’:
    drivers/dma/mv_xor.c:480:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 6 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
    "%s src_cnt: %d len: %u dest %pad flags: %ld\n",
    ^
    drivers/dma/mv_xor.c: In function ‘mv_xor_probe’:
    drivers/dma/mv_xor.c:1223:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    op_in_desc = (int)of_id->data;
    ^

    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Vinod Koul

    Gregory CLEMENT
     
  • Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch
    that makes this transformation is as follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression d,e;
    statement S;
    @@

    d =
    - dma_pool_alloc
    + dma_pool_zalloc
    (...);
    if (!d) S
    - memset(d, 0, sizeof(*d));
    //

    Signed-off-by: Julia Lawall
    Acked-by: Sören Brinkmann
    Signed-off-by: Vinod Koul

    Julia Lawall
     
  • Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch
    that makes this transformation is as follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression d,e;
    statement S;
    @@

    d =
    - dma_pool_alloc
    + dma_pool_zalloc
    (...);
    if (!d) S
    - memset(d, 0, sizeof(*d));
    //

    Signed-off-by: Julia Lawall
    Acked-by: Li Yang
    Signed-off-by: Vinod Koul

    Julia Lawall
     
  • Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch
    that makes this transformation is as follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression d,e;
    statement S;
    @@

    d =
    - dma_pool_alloc
    + dma_pool_zalloc
    (...);
    if (!d) S
    - memset(d, 0, sizeof(*d));
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Vinod Koul

    Julia Lawall
     
  • Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch
    that makes this transformation is as follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression d,e;
    statement S;
    @@

    d =
    - dma_pool_alloc
    + dma_pool_zalloc
    (...);
    if (!d) S
    - memset(d, 0, sizeof(*d));
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Vinod Koul

    Julia Lawall
     

02 May, 2016

4 commits