linux-stable/drivers/dma
Kevin Groeneveld 7b203ecf14 dmaengine: imx-sdma: fix init of uart scripts
commit a3ae97f4c8 upstream.

Commit b98ce2f4e3 ("dmaengine: imx-sdma: add uart rom script") broke
uart rx on imx5 when using sdma firmware from older Freescale 2.6.35
kernel. In this case reading addr->uartXX_2_mcu_addr was going out of
bounds of the firmware memory and corrupting the uart script addresses.

Simply adding a bounds check before accessing addr->uartXX_2_mcu_addr
does not work as the uartXX_2_mcu_addr members are now beyond the size
of the older firmware and the uart addresses would never be populated
in that case. There are other ways to fix this but overall the logic
seems clearer to me to revert the uartXX_2_mcu_ram_addr structure
entries back to uartXX_2_mcu_addr, change the newer entries to
uartXX_2_mcu_rom_addr and update the logic accordingly.

I have tested this patch on:
1. An i.MX53 system with sdma firmware from Freescale 2.6.35 kernel.
   Without this patch uart rx is broken in this scenario, with the
   patch uart rx is restored.
2. An i.MX6D system with no external sdma firmware. uart is okay with
   or without this patch.
3. An i.MX8MM system using current sdma-imx7d.bin firmware from
   linux-firmware. uart is okay with or without this patch and I
   confirmed the rom version of the uart script is being used which was
   the intention and reason for commit b98ce2f4e3 ("dmaengine:
   imx-sdma: add uart rom script") in the first place.

Fixes: b98ce2f4e3 ("dmaengine: imx-sdma: add uart rom script")
Cc: stable@vger.kernel.org
Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20220410223118.15086-1-kgroeneveld@lenbrook.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-27 14:41:12 +02:00
..
bestcomm dmaengine: bestcomm: fix system boot lockups 2021-10-18 11:43:12 +05:30
dw dmaengine: dw: switch from 'pci_' to 'dma_' API 2021-10-26 10:54:32 +05:30
dw-axi-dmac dmaengine: dw-axi-dmac: Fix uninitialized variable in axi_chan_block_xfer_start() 2021-11-22 11:22:26 +05:30
dw-edma dmaengine: dw-edma: Fix unaligned 64bit access 2022-04-27 14:40:57 +02:00
fsl-dpaa2-qdma dmaengine: fsl-dpaa2-qdma: Fix spelling mistake "faile" -> "failed" 2021-08-29 19:14:20 +05:30
hsu dmaengine: hsu: switch from 'pci_' to 'dma_' API 2021-10-26 10:54:47 +05:30
idxd dmaengine: idxd: skip clearing device context when device is read-only 2022-04-27 14:41:04 +02:00
ioat dmaengine: ioatdma: use default_groups in kobj_type 2022-01-05 13:11:08 +05:30
ipu
lgm
mediatek dmaengine: mediatek:Fix PM usage reference leak of mtk_uart_apdma_alloc_chan_resources 2022-04-27 14:40:57 +02:00
ppc4xx dmaengine: ppc4xx: remove unused variable `rval' 2021-11-25 10:47:08 +05:30
ptdma dmaengine: ptdma: Fix the error handling path in pt_core_init() 2022-02-15 10:47:36 +05:30
qcom dmaengine updates for v5.17-rc1 2022-01-18 14:03:34 +02:00
sf-pdma
sh dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error" 2022-04-13 19:27:41 +02:00
ti dmaengine updates for v5.17-rc1 2022-01-18 14:03:34 +02:00
xilinx dmaengine_topic_slave_id_removal_5.17 2021-12-17 21:42:17 +05:30
Kconfig dmaengine: zynqmp_dma: enable COMPILE_TEST 2021-10-01 17:26:30 +05:30
Makefile dmaengine: ptdma: Initial driver for the AMD PTDMA 2021-08-29 19:14:20 +05:30
TODO
acpi-dma.c dmaengine: acpi: Check for errors from acpi_register_gsi() separately 2021-08-06 21:48:11 +05:30
altera-msgdma.c dmaengine: altera-msgdma: Correctly handle descriptor callbacks 2021-10-28 22:53:54 +05:30
amba-pl08x.c
at_hdmac.c
at_hdmac_regs.h
at_xdmac.c dma: at_xdmac: fix a missing check on list iterator 2022-04-27 14:41:12 +02:00
bcm-sba-raid.c
bcm2835-dma.c
dma-axi-dmac.c
dma-jz4780.c dmaengine: jz4780: Support bidirectional I/O on one channel 2021-12-17 21:39:27 +05:30
dmaengine.c dmaengine: Add core function and capability check for DMA_MEMCPY_SG 2021-11-22 11:38:05 +05:30
dmaengine.h dmaengine: dmaengine_desc_callback_valid(): Check for `callback_result` 2021-10-25 09:42:56 +05:30
dmatest.c
ep93xx_dma.c dmaengine: ep93xx: Prepare clock before using it 2021-08-02 12:27:10 +05:30
fsl-edma-common.c dmaengine: fsl-edma: support edma memcpy 2021-10-28 22:56:24 +05:30
fsl-edma-common.h dmaengine: fsl-edma: support edma memcpy 2021-10-28 22:56:24 +05:30
fsl-edma.c dmaengine: fsl-edma: support edma memcpy 2021-10-28 22:56:24 +05:30
fsl-qdma.c
fsl_raid.c
fsl_raid.h
fsldma.c
fsldma.h
hisi_dma.c dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma 2022-04-08 13:58:27 +02:00
idma64.c
idma64.h
img-mdc-dma.c
imx-dma.c dmaengine: imx-dma: configure the generic DMA type to make it work 2021-08-02 12:31:19 +05:30
imx-sdma.c dmaengine: imx-sdma: fix init of uart scripts 2022-04-27 14:41:12 +02:00
iop-adma.c
iop-adma.h
k3dma.c
lpc18xx-dmamux.c
mcf-edma.c
milbeaut-hdmac.c dmaengine: milbeaut-hdmac: Prefer kcalloc over open coded arithmetic 2021-10-25 12:12:13 +05:30
milbeaut-xdmac.c
mmp_pdma.c dmaengine: pxa/mmp: stop referencing config->slave_id 2021-12-17 11:23:56 +05:30
mmp_tdma.c
moxart-dma.c
mpc512x_dma.c
mv_xor.c
mv_xor.h
mv_xor_v2.c dmaengine: mv_xor_v2: Get rid of msi_desc abuse 2021-12-16 22:16:41 +01:00
mxs-dma.c
nbpfaxi.c
of-dma.c dmaengine: of-dma: router_xlate to return -EPROBE_DEFER if controller is not yet available 2021-07-28 12:54:50 +05:30
owl-dma.c
pch_dma.c dmaengine: pch_dma: Remove usage of the deprecated "pci-dma-compat.h" API 2022-01-08 22:16:44 +05:30
pl330.c
plx_dma.c dmaengine: switch from 'pci_' to 'dma_' API 2021-10-26 10:54:57 +05:30
pxa_dma.c dmaengine: pxa/mmp: stop referencing config->slave_id 2021-12-17 11:23:56 +05:30
s3c24xx-dma.c
sa11x0-dma.c dmaengine: sa11x0: Mark PM functions as __maybe_unused 2021-10-26 10:55:07 +05:30
sprd-dma.c dmaengine: sprd: stop referencing config->slave_id 2021-12-17 11:23:56 +05:30
st_fdma.c dmaengine: st_fdma: fix MODULE_ALIAS 2021-12-13 13:18:48 +05:30
st_fdma.h
ste_dma40.c
ste_dma40_ll.c
ste_dma40_ll.h
stm32-dma.c dmaengine: stm32-dma: avoid 64-bit division in stm32_dma_get_max_width 2021-11-09 11:20:35 +05:30
stm32-dmamux.c dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe 2022-02-15 10:58:04 +05:30
stm32-mdma.c dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK 2022-01-03 17:00:09 +05:30
sun4i-dma.c
sun6i-dma.c
tegra20-apb-dma.c dmaengine: tegra20-apb: stop checking config->slave_id 2021-12-17 11:23:38 +05:30
tegra210-adma.c dmaengine: tegra210-adma: fix pm runtime unbalance in tegra_adma_remove 2021-10-25 10:06:10 +05:30
timb_dma.c
txx9dmac.c
txx9dmac.h
uniphier-mdmac.c
uniphier-xdmac.c dmaengine: uniphier-xdmac: Fix type of address variables 2022-01-03 17:49:37 +05:30
virt-dma.c
virt-dma.h
xgene-dma.c