android_kernel_xiaomi_sm8450/drivers/remoteproc
Mark-PK Tsai 0f77129416 FROMLIST: remoteproc: Fix dma_mem leak after rproc_shutdown
Release dma coherent memory before rvdev is free in
rproc_rvdev_release().

Below is the kmemleak report:
unreferenced object 0xffffff8051c1a980 (size 128):
  comm "sh", pid 4895, jiffies 4295026604 (age 15481.896s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000003a0f3ec0>] dma_declare_coherent_memory+0x44/0x11c
    [<00000000ad243164>] rproc_add_virtio_dev+0xb8/0x20c
    [<00000000d219c8e9>] rproc_vdev_do_start+0x18/0x24
    [<00000000e694b468>] rproc_start+0x22c/0x3e0
    [<000000000b938941>] rproc_boot+0x4a4/0x860
    [<000000003c4dc532>] state_store.52856+0x10c/0x1b8
    [<00000000df2297ac>] dev_attr_store+0x34/0x84
    [<0000000083a53bdb>] sysfs_kf_write+0x60/0xbc
    [<000000008ed830df>] kernfs_fop_write+0x198/0x458
    [<0000000072b9ad06>] __vfs_write+0x50/0x210
    [<00000000377d7469>] vfs_write+0xe4/0x1a8
    [<00000000c3fc594e>] ksys_write+0x78/0x144
    [<000000009aef6f4b>] __arm64_sys_write+0x1c/0x28
    [<0000000003496a98>] el0_svc_common+0xc8/0x22c
    [<00000000ea3fe7a3>] el0_svc_compat_handler+0x1c/0x28
    [<00000000d1a85a4e>] el0_svc_compat+0x8/0x24

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>

Bug: 233721768
Link: https://lore.kernel.org/lkml/20220422062436.14384-3-mark-pk.tsai@mediatek.com/
Change-Id: I77ba09a8cb86d90f6498e6a9e9747aa5c155c7da
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
(cherry picked from commit 5eee510aa3aa92fd8409cfcc29bda06cc9e4fe37)
2022-05-31 17:47:14 +00:00
..
da8xx_remoteproc.c
imx_rproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
ingenic_rproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
Kconfig
keystone_remoteproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
Makefile
mtk_common.h
mtk_scp_ipi.c
mtk_scp.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
omap_remoteproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
omap_remoteproc.h
qcom_common.c
qcom_common.h
qcom_pil_info.c remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided 2022-01-20 09:17:50 +01:00
qcom_pil_info.h
qcom_q6v5_adsp.c This is the 5.10.110 stable release 2022-04-18 17:41:18 +02:00
qcom_q6v5_mss.c remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region 2022-04-08 14:40:26 +02:00
qcom_q6v5_pas.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
qcom_q6v5_wcss.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
qcom_q6v5.c
qcom_q6v5.h
qcom_sysmon.c
qcom_wcnss_iris.c
qcom_wcnss.c This is the 5.10.110 stable release 2022-04-18 17:41:18 +02:00
qcom_wcnss.h
remoteproc_cdev.c remoteproc: core: Fix cdev remove and rproc del 2021-07-20 16:05:48 +02:00
remoteproc_core.c FROMLIST: remoteproc: Fix dma_mem leak after rproc_shutdown 2022-05-31 17:47:14 +00:00
remoteproc_coredump.c UPSTREAM: remoteproc: Fix the wrong default value of is_iomem 2022-02-11 17:30:25 -08:00
remoteproc_debugfs.c UPSTREAM: remoteproc: Fix count check in rproc_coredump_write() 2022-05-13 15:07:09 +00:00
remoteproc_elf_helpers.h
remoteproc_elf_loader.c UPSTREAM: remoteproc: Fix the wrong default value of is_iomem 2022-02-11 17:30:25 -08:00
remoteproc_internal.h FROMLIST: remoteproc: core: Export the rproc coredump APIs 2021-06-29 14:29:41 +00:00
remoteproc_sysfs.c UPSTREAM: remoteproc: Add a rproc_set_firmware() API 2022-01-04 14:15:08 +05:30
remoteproc_virtio.c
st_remoteproc.c
st_slim_rproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
stm32_rproc.c
ti_k3_dsp_remoteproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00
ti_k3_r5_remoteproc.c This is the 5.10.52 stable release 2021-07-20 16:36:53 +02:00
ti_sci_proc.h
wkup_m3_rproc.c BACKPORT: FROMGIT: remoteproc: add is_iomem to da_to_va 2021-05-07 07:12:41 -07:00