milos-linux/drivers/i2c/busses
Carlos Song 695fcefd4a
i2c: imx-lpi2c: fix resource leaks switching to devm_dma_request_chan()
The LPI2C driver requests DMA channels using dma_request_chan(), but
never releases them in lpi2c_imx_remove(), resulting in DMA channel
leaks every time the driver is unloaded.

Additionally, when lpi2c_dma_init() successfully requests the TX DMA
channel but fails to request the RX DMA channel, the probe falls back
to PIO mode and completes successfully. Since probe succeeds, the devres
framework will not trigger any cleanup, leaving the TX DMA channel and
the memory allocated for the dma structure held for the lifetime of the
device even though DMA is never used.

Switch to devm_dma_request_chan() to let the device core manage DMA
channel lifetime automatically. Wrap all allocations within a devres
group so that devres_release_group() can release all partially acquired
resources when DMA init fails and probe continues in PIO mode.

Fixes: a09c8b3f90 ("i2c: imx-lpi2c: add eDMA mode support for LPI2C")
Signed-off-by: Carlos Song <carlos.song@nxp.com>
Cc: <stable@vger.kernel.org> # v6.14+
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260520093323.2882070-1-carlos.song@oss.nxp.com
2026-06-09 10:13:09 +02:00
..
i2c-acorn.c
i2c-ali15x3.c
i2c-ali1535.c
i2c-ali1563.c
i2c-altera.c
i2c-amd-asf-plat.c
i2c-amd-mp2-pci.c i2c: amd-mp2: clean up amd_mp2_find_device() 2026-01-16 13:45:05 +01:00
i2c-amd-mp2-plat.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-amd-mp2.h i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-amd756.c
i2c-amd8111.c i2c: amd8111: switch to devm_ functions 2026-02-07 01:20:04 +01:00
i2c-aspeed.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-at91-core.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-at91-master.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-at91-slave.c
i2c-at91.h
i2c-au1550.c
i2c-axxia.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-bcm-iproc.c i2c: bcm-iproc: Fix Wvoid-pointer-to-enum-cast warning 2025-12-17 00:28:43 +01:00
i2c-bcm-kona.c
i2c-bcm2835.c i2c: busses: bcm2835: convert from round_rate() to determine_rate() 2025-10-27 14:17:14 +01:00
i2c-brcmstb.c
i2c-cadence.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-cbus-gpio.c
i2c-ccgx-ucsi.c
i2c-ccgx-ucsi.h
i2c-cgbc.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-cht-wc.c i2c: Switch to irq_domain_create_linear() 2025-05-16 21:06:09 +02:00
i2c-cp2615.c i2c-for-7.1-rc1-part1 2026-04-18 09:44:22 -07:00
i2c-cpm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-cros-ec-tunnel.c i2c: cros-ec-tunnel: defer probe if parent EC is not present 2025-04-13 21:33:44 +02:00
i2c-davinci.c i2c: davinci: fix division by zero on missing clock-frequency 2026-05-27 01:07:05 +02:00
i2c-designware-amdisp.c i2c: designware: amdisp: Fix resume-probe race condition issue 2026-03-27 13:51:21 +01:00
i2c-designware-amdpsp.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-designware-baytrail.c
i2c-designware-common.c i2c: designware: Support of controller with IC_EMPTYFIFO_HOLD_MASTER disabled 2026-02-04 02:16:22 +01:00
i2c-designware-core.h i2c: designware: Support of controller with IC_EMPTYFIFO_HOLD_MASTER disabled 2026-02-04 02:16:22 +01:00
i2c-designware-master.c i2c: designware: Support of controller with IC_EMPTYFIFO_HOLD_MASTER disabled 2026-02-04 02:16:22 +01:00
i2c-designware-pcidrv.c i2c: designware: Fix an error handling path in i2c_dw_pci_probe() 2025-05-14 17:28:24 +02:00
i2c-designware-platdrv.c i2c: designware: Add a new ACPI HID for GOOG5000 I2C controller 2026-03-27 14:18:35 +01:00
i2c-designware-slave.c i2c: designware: Enable mode swapping 2026-01-22 14:43:51 +01:00
i2c-digicolor.c
i2c-diolan-u2c.c i2c: diolan-u2c: drop redundant device reference 2026-03-09 12:58:56 +01:00
i2c-dln2.c
i2c-eg20t.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-elektor.c
i2c-emev2.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-exynos5.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-fsi.c i2c: fsi: Fix a potential leak in fsi_i2c_probe() 2026-03-19 23:45:06 +01:00
i2c-gpio.c
i2c-gxp.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-highlander.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-hisi.c
i2c-hix5hd2.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-hydra.c
i2c-i801.c i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock" 2026-03-04 12:44:14 +01:00
i2c-ibm_iic.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-ibm_iic.h
i2c-icy.c
i2c-img-scb.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-imx-lpi2c.c i2c: imx-lpi2c: fix resource leaks switching to devm_dma_request_chan() 2026-06-09 10:13:09 +02:00
i2c-imx.c i2c: imx: fix clock and pinctrl state inconsistency in runtime PM 2026-06-08 19:43:05 +02:00
i2c-iop3xx.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-iop3xx.h
i2c-isch.c
i2c-ismt.c i2c: ismt: Use non-hybrid PCI devres API 2025-05-19 22:23:57 +02:00
i2c-jz4780.c
i2c-k1.c i2c: spacemit: introduce pio for k1 2026-04-09 18:33:55 +02:00
i2c-keba.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-kempld.c
i2c-ljca.c
i2c-lpc2k.c i2c: lpc2k: Add check for clk_enable() 2025-05-19 22:23:54 +02:00
i2c-ls2x.c
i2c-mchp-pci1xxxx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-meson.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-microchip-corei2c.c i2c: microchip-core: re-fix fake detections w/ i2cdetect 2025-07-01 18:37:38 +02:00
i2c-mlxbf.c i2c: mlxbf: Use HZ_PER_KHZ in the driver 2026-01-14 08:33:14 +01:00
i2c-mlxcpld.c
i2c-mpc.c
i2c-mt65xx.c i2c: mediatek: add bus regulator control for power saving 2026-04-15 00:54:34 +02:00
i2c-mt7621.c
i2c-mv64xxx.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-mxs.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-nct6694.c i2c: Add Nuvoton NCT6694 I2C support 2025-09-16 14:41:57 +01:00
i2c-nforce2.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-nomadik.c i2c: nomadik: Use HZ_PER_GHZ constant instead of plain number 2026-01-13 18:34:29 +01:00
i2c-npcm7xx.c i2c: npcm7xx: Use NULL instead of 0 for pointer 2026-03-20 00:12:10 +01:00
i2c-nvidia-gpu.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-ocores.c i2c: ocores: Use read_poll_timeout_atomic to avoid false poll timeouts 2026-03-27 14:53:25 +01:00
i2c-octeon-core.c i2c: octeon: add block-mode i2c operations 2025-05-19 22:23:55 +02:00
i2c-octeon-core.h i2c: octeon: add block-mode i2c operations 2025-05-19 22:23:55 +02:00
i2c-octeon-platdrv.c
i2c-omap.c i2c: omap: switch to new generic helper for getting selected mux-state 2026-03-09 13:44:45 +01:00
i2c-opal.c
i2c-owl.c
i2c-parport.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-pasemi-core.c i2c: pasemi: Log bus reset causes 2025-05-19 22:23:57 +02:00
i2c-pasemi-core.h
i2c-pasemi-pci.c i2c: pasemi: Sort includes alphabetically 2025-05-19 22:23:55 +02:00
i2c-pasemi-platform.c
i2c-pca-isa.c i2c: rename wait_for_completion callback to wait_for_completion_cb 2025-10-04 18:52:58 +02:00
i2c-pca-platform.c i2c: rename wait_for_completion callback to wait_for_completion_cb 2025-10-04 18:52:58 +02:00
i2c-piix4.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-piix4.h
i2c-pnx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-powermac.c i2c: powermac: convert of_node usage to fwnode 2025-05-20 22:49:21 +02:00
i2c-pxa-pci.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-pxa.c i2c: pxa: handle 'Early Bus Busy' condition on Armada 3700 2026-04-15 00:13:33 +02:00
i2c-qcom-cci.c i2c: qcom-cci: Fix NULL pointer dereference in cci_remove() 2026-06-08 20:31:46 +02:00
i2c-qcom-geni.c i2c: qcom-geni: Avoid extra TX DMA TRE for single read message in GPI mode 2026-04-10 22:27:10 +02:00
i2c-qup.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-rcar.c i2c: rcar: Fix Wvoid-pointer-to-enum-cast warning 2025-12-17 00:28:50 +01:00
i2c-riic.c i2c: riic: fix refcount leak in riic_i2c_resume_noirq() 2026-06-08 17:35:03 +02:00
i2c-rk3x.c i2c: rk3x: Use HZ_PER_GHZ constant instead of plain number 2026-01-13 18:34:33 +01:00
i2c-robotfuzz-osif.c i2c: robotfuzz-osif: drop redundant device reference 2026-03-09 12:54:03 +01:00
i2c-rtl9300.c i2c: rtl9300: add RTL9607C i2c controller support 2026-04-02 00:09:34 +02:00
i2c-rzv2m.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-s3c2410.c i2c: s3c24xx: check the size of the SMBUS message before using it 2026-03-25 18:13:39 +01:00
i2c-scmi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-sh7760.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-sh_mobile.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-sibyte.c
i2c-simtec.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-sis96x.c
i2c-sis630.c
i2c-sis5595.c
i2c-sprd.c i2c: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-14 13:51:07 +02:00
i2c-st.c i2c: st: Use HZ_PER_GHZ constant instead of plain number 2026-01-13 18:34:38 +01:00
i2c-stm32.c i2c: stm32: Omit two variable reassignments in stm32_i2c_dma_request() 2025-10-27 14:17:15 +01:00
i2c-stm32.h
i2c-stm32f4.c
i2c-stm32f7.c i2c: stm32f7: fix timing computation ignoring i2c-analog-filter 2026-06-08 19:56:04 +02:00
i2c-sun6i-p2wi.c
i2c-synquacer.c i2c: synquacer: Use HZ_PER_GHZ constant instead of plain number 2026-01-13 18:34:43 +01:00
i2c-taos-evm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-tegra-bpmp.c
i2c-tegra.c i2c: tegra: Fix NOIRQ suspend/resume 2026-06-08 21:21:42 +02:00
i2c-thunderx-pcidrv.c i2c: thunderx: Use non-hybrid PCI devres API 2025-05-19 22:23:57 +02:00
i2c-tiny-usb.c i2c: tiny-usb: drop redundant device reference 2026-03-09 12:59:09 +01:00
i2c-uniphier-f.c i2c: uniphier(-f): Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-uniphier.c i2c: uniphier: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-usbio.c i2c: usbio: Add ACPI device-id for NVL platforms 2026-04-10 23:08:42 +02:00
i2c-versatile.c
i2c-via.c i2c: via: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-viai2c-common.c
i2c-viai2c-common.h
i2c-viai2c-wmt.c i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe function 2025-05-23 10:02:27 +02:00
i2c-viai2c-zhaoxin.c
i2c-viapro.c i2c: viapro: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-viperboard.c i2c: busses: Fix some spelling errors 2025-09-25 23:49:08 +02:00
i2c-virtio.c i2c: virtio: mark device ready before registering the adapter 2026-05-30 15:56:07 +02:00
i2c-xgene-slimpro.c i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe function 2025-05-23 10:02:27 +02:00
i2c-xiic.c i2c: xiic: skip input clock setup on non-OF systems 2026-04-02 01:28:03 +02:00
i2c-xlp9xx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
Kconfig i2c-for-7.1-rc1-part1 2026-04-18 09:44:22 -07:00
Makefile i2c: designware: Remove useless driver specific option for I2C target 2025-12-27 21:13:55 +01:00
scx200_acb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00