1. 19 Jan, 2024 9 commits
    • Vinod Koul's avatar
      dmaengine: fsl-qdma: increase size of 'irq_name' · 6386f6c9
      Vinod Koul authored
      We seem to have hit warnings of 'output may be truncated' which is fixed
      by increasing the size of 'irq_name'
      
      drivers/dma/fsl-qdma.c: In function ‘fsl_qdma_irq_init’:
      drivers/dma/fsl-qdma.c:824:46: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]
        824 |                 sprintf(irq_name, "qdma-queue%d", i);
            |                                              ^~
      drivers/dma/fsl-qdma.c:824:35: note: directive argument in the range [-2147483641, 2147483646]
        824 |                 sprintf(irq_name, "qdma-queue%d", i);
            |                                   ^~~~~~~~~~~~~~
      drivers/dma/fsl-qdma.c:824:17: note: ‘sprintf’ output between 12 and 22 bytes into a destination of size 20
        824 |                 sprintf(irq_name, "qdma-queue%d", i);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      6386f6c9
    • Vinod Koul's avatar
      dmaengine: shdma: increase size of 'dev_id' · 40429024
      Vinod Koul authored
      We seem to have hit warnings of 'output may be truncated' which is fixed
      by increasing the size of 'dev_id'
      
      drivers/dma/sh/shdmac.c: In function ‘sh_dmae_probe’:
      drivers/dma/sh/shdmac.c:541:34: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
        541 |                          "sh-dmae%d.%d", pdev->id, id);
            |                                  ^~
      In function ‘sh_dmae_chan_probe’,
          inlined from ‘sh_dmae_probe’ at drivers/dma/sh/shdmac.c:845:9:
      drivers/dma/sh/shdmac.c:541:26: note: directive argument in the range [0, 2147483647]
        541 |                          "sh-dmae%d.%d", pdev->id, id);
            |                          ^~~~~~~~~~~~~~
      drivers/dma/sh/shdmac.c:541:26: note: directive argument in the range [0, 19]
      drivers/dma/sh/shdmac.c:540:17: note: ‘snprintf’ output between 11 and 21 bytes into a destination of size 16
        540 |                 snprintf(sh_chan->dev_id, sizeof(sh_chan->dev_id),
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        541 |                          "sh-dmae%d.%d", pdev->id, id);
            |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      40429024
    • Jan Kuliga's avatar
    • Lad Prabhakar's avatar
      dmaengine: usb-dmac: Avoid format-overflow warning · 62b68a88
      Lad Prabhakar authored
      gcc points out that the fix-byte buffer might be too small:
      drivers/dma/sh/usb-dmac.c: In function 'usb_dmac_probe':
      drivers/dma/sh/usb-dmac.c:720:34: warning: '%u' directive writing between 1 and 10 bytes into a region of size 3 [-Wformat-overflow=]
        720 |         sprintf(pdev_irqname, "ch%u", index);
            |                                  ^~
      In function 'usb_dmac_chan_probe',
          inlined from 'usb_dmac_probe' at drivers/dma/sh/usb-dmac.c:814:9:
      drivers/dma/sh/usb-dmac.c:720:31: note: directive argument in the range [0, 4294967294]
        720 |         sprintf(pdev_irqname, "ch%u", index);
            |                               ^~~~~~
      drivers/dma/sh/usb-dmac.c:720:9: note: 'sprintf' output between 4 and 13 bytes into a destination of size 5
        720 |         sprintf(pdev_irqname, "ch%u", index);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Maximum number of channels for USB-DMAC as per the driver is 1-99 so use
      u8 instead of unsigned int/int for DMAC channel indexing and make the
      pdev_irqname string long enough to avoid the warning.
      
      While at it use scnprintf() instead of sprintf() to make the code more
      robust.
      Signed-off-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/20240110222210.193479-1-prabhakar.mahadev-lad.rj@bp.renesas.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      62b68a88
    • Lad Prabhakar's avatar
      dmaengine: sh: rz-dmac: Avoid format-overflow warning · c4d6dcb3
      Lad Prabhakar authored
      The max channel count for RZ DMAC is 16, hence use u8 instead of unsigned
      int and make the pdev_irqname string long enough to avoid the warning.
      
      This fixes the below issue:
      drivers/dma/sh/rz-dmac.c: In function ‘rz_dmac_probe’:
      drivers/dma/sh/rz-dmac.c:770:34: warning: ‘%u’ directive writing between 1 and 10 bytes into a region of size 3 [-Wformat-overflow=]
        770 |         sprintf(pdev_irqname, "ch%u", index);
            |                                  ^~
      In function ‘rz_dmac_chan_probe’,
          inlined from ‘rz_dmac_probe’ at drivers/dma/sh/rz-dmac.c:910:9:
      drivers/dma/sh/rz-dmac.c:770:31: note: directive argument in the range [0, 4294967294]
        770 |         sprintf(pdev_irqname, "ch%u", index);
            |                               ^~~~~~
      drivers/dma/sh/rz-dmac.c:770:9: note: ‘sprintf’ output between 4 and 13 bytes into a destination of size 5
        770 |         sprintf(pdev_irqname, "ch%u", index);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      While at it use scnprintf() instead of sprintf() to make the code
      more robust.
      Signed-off-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/20240110222717.193719-1-prabhakar.mahadev-lad.rj@bp.renesas.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      c4d6dcb3
    • Randy Dunlap's avatar
      dmaengine: imx-sdma: fix Excess kernel-doc warnings · 98373a21
      Randy Dunlap authored
      Fix warnings of "Excess struct member" by removing those lines.
      They are extraneous.
      
      imx-sdma.c:467: warning: Excess struct member 'context_loaded' description in 'sdma_channel'
      imx-sdma.c:467: warning: Excess struct member 'bd_pool' description in 'sdma_channel'
      imx-sdma.c:500: warning: Excess struct member 'script_addrs' description in 'sdma_firmware_header'
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Vinod Koul <vkoul@kernel.org>
      Cc: dmaengine@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20240119032832.4051-1-rdunlap@infradead.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      98373a21
    • Nathan Chancellor's avatar
      dmaengine: xilinx: xdma: Fix initialization location of desc in xdma_channel_isr() · 620a7e4c
      Nathan Chancellor authored
      Clang warns (or errors with CONFIG_WERROR=y):
      
        drivers/dma/xilinx/xdma.c:894:3: error: variable 'desc' is uninitialized when used here [-Werror,-Wuninitialized]
          894 |                 desc->error = true;
              |                 ^~~~
      
      The initialization of desc was moved too far forward, move it back so
      that this assignment does not result in a potential crash at runtime
      while clearing up the warning.
      
      Closes: https://github.com/ClangBuiltLinux/linux/issues/1972
      Fixes: 2f8f90cd ("dmaengine: xilinx: xdma: Implement interleaved DMA transfers")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20231222-dma-xilinx-xdma-clang-fixes-v1-2-84a18ff184d2@kernel.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      620a7e4c
    • Nathan Chancellor's avatar
      dmaengine: xilinx: xdma: Fix operator precedence in xdma_prep_interleaved_dma() · fe0d495e
      Nathan Chancellor authored
      Clang warns (or errors with CONFIG_WERROR=y):
      
        drivers/dma/xilinx/xdma.c:757:68: error: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Werror,-Wparentheses]
          757 |                 src_addr += dmaengine_get_src_icg(xt, &xt->sgl[i]) + xt->src_inc ?
              |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
        drivers/dma/xilinx/xdma.c:757:68: note: place parentheses around the '+' expression to silence this warning
          757 |                 src_addr += dmaengine_get_src_icg(xt, &xt->sgl[i]) + xt->src_inc ?
              |                                                                                  ^
              |                             (                                                   )
        drivers/dma/xilinx/xdma.c:757:68: note: place parentheses around the '?:' expression to evaluate it first
          757 |                 src_addr += dmaengine_get_src_icg(xt, &xt->sgl[i]) + xt->src_inc ?
              |                                                                                  ^
              |                                                                      (
          758 |                                                               xt->sgl[i].size : 0;
              |
              |                                                                                  )
        drivers/dma/xilinx/xdma.c:759:68: error: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Werror,-Wparentheses]
          759 |                 dst_addr += dmaengine_get_dst_icg(xt, &xt->sgl[i]) + xt->dst_inc ?
              |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
        drivers/dma/xilinx/xdma.c:759:68: note: place parentheses around the '+' expression to silence this warning
          759 |                 dst_addr += dmaengine_get_dst_icg(xt, &xt->sgl[i]) + xt->dst_inc ?
              |                                                                                  ^
              |                             (                                                   )
        drivers/dma/xilinx/xdma.c:759:68: note: place parentheses around the '?:' expression to evaluate it first
          759 |                 dst_addr += dmaengine_get_dst_icg(xt, &xt->sgl[i]) + xt->dst_inc ?
              |                                                                                  ^
              |                                                                      (
          760 |                                                               xt->sgl[i].size : 0;
              |
              |                                                                                  )
      
      The src_inc and dst_inc members of 'struct dma_interleaved_template' are
      booleans, so it does not make sense for the addition to happen first.
      Wrap the conditional operator in parantheses so it is evaluated first.
      
      Closes: https://github.com/ClangBuiltLinux/linux/issues/1971
      Fixes: 2f8f90cd ("dmaengine: xilinx: xdma: Implement interleaved DMA transfers")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20231222-dma-xilinx-xdma-clang-fixes-v1-1-84a18ff184d2@kernel.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      fe0d495e
    • Vinod Koul's avatar
      Merge tag 'dmaengine-6.8-rc1' into fixes · b93216d3
      Vinod Koul authored
      dmaengine updates for v6.8
      
       New support:
        - Loongson LS2X APB DMA controller
        - sf-pdma: mpfs-pdma support
        - Qualcomm X1E80100 GPI dma controller support
      
       Updates:
        - Xilinx XDMA updates to support interleaved DMA transfers
        - TI PSIL threads for AM62P and J722S and cfg register regions description
        - axi-dmac Improving the cyclic DMA transfers
        - Tegra Support dma-channel-mask property
        - Remaining platform remove callback returning void conversions
      b93216d3
  2. 22 Dec, 2023 8 commits
  3. 21 Dec, 2023 22 commits
  4. 11 Dec, 2023 1 commit