09 Oct, 2022

4 commits

  • The workqueue may execute late even after remoteproc is stopped or
    stopping, some resources (rpmsg device and endpoint) have been
    released, then rproc_vq_interrupt() access these resources will cause
    kennel dump.

    Call trace:
    virtqueue_add_split+0x1ac/0x560
    virtqueue_add_inbuf+0x4c/0x60
    rpmsg_recv_done+0x15c/0x294
    vring_interrupt+0x6c/0xa4
    rproc_vq_interrupt+0x30/0x50
    imx_dsp_rproc_vq_work+0x24/0x40 [imx_dsp_rproc]
    process_one_work+0x1d0/0x354
    worker_thread+0x13c/0x470
    kthread+0x154/0x160
    ret_from_fork+0x10/0x20

    Add mutex protection in imx_dsp_rproc_vq_work(), if the state is
    not running, then just skip calling rproc_vq_interrupt().

    Also the flush workqueue operation can't be added in rproc stop
    for same reason.

    Signed-off-by: Shengjiu Wang
    Tested-by: Ming Zhou

    Shengjiu Wang
     
  • Because ATT_IOMEM is not set for DRAM region, so when loading elf
    sections to DRAM area, the loader use memcpy/memset, not
    memcpy_toio/memset_io. memcpy/memset to a region mapped with ioremap
    will trigger dump. So use ioremap_wc for the DRAM region.

    And only the TCM area has hardware limitation that need ioremap mapping.
    To other areas such as DRAM region, ioremap_wc is better.

    Signed-off-by: Peng Fan
    Reviewed-by: Ye Li

    Peng Fan
     
  • Merge the continous TCM area, then support loading larger elf section.

    Signed-off-by: Peng Fan
    Reviewed-by: Ye Li

    Peng Fan
     
  • According to reference mannual, the M33 DRAM view of 0x[C,D]0000000 maps
    to A55 0xC0000000, so correct it.

    Signed-off-by: Peng Fan
    Reviewed-by: Ye Li

    Peng Fan
     

27 Sep, 2022

1 commit

  • This is the 5.15.70 stable release

    * tag 'v5.15.70': (2444 commits)
    Linux 5.15.70
    ALSA: hda/sigmatel: Fix unused variable warning for beep power change
    cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6ul.dtsi
    arch/arm/mm/mmu.c
    arch/arm64/boot/dts/freescale/imx8mp-evk.dts
    drivers/gpu/drm/imx/dcss/dcss-kms.c
    drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
    drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/soc/fsl/Kconfig
    drivers/soc/imx/gpcv2.c
    drivers/usb/dwc3/host.c
    net/dsa/slave.c
    sound/soc/fsl/imx-card.c

    Jason Liu
     

17 Aug, 2022

5 commits

  • [ Upstream commit 47c04e00eff86a81cd357c3feed04c86089bcb85 ]

    The SSCTL service comes up after a finite time when the remote Q6 comes
    out of reset. Any graceful shutdowns requested during this period will
    be a NOP and abrupt tearing down of the glink channel might lead to pending
    transactions on the remote Q6 side and will ultimately lead to a fatal
    error. Fix this by waiting for the SSCTL service when a graceful shutdown
    is requested.

    Fixes: 1fb82ee806d1 ("remoteproc: qcom: Introduce sysmon")
    Reviewed-by: Matthias Kaehlcke
    Signed-off-by: Sibi Sankar
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/1657022900-2049-7-git-send-email-quic_sibis@quicinc.com
    Signed-off-by: Sasha Levin

    Sibi Sankar
     
  • [ Upstream commit 7b6ece968fca4ec9e42d34caff7e06dc84c45717 ]

    Client drivers need to check if coredump is enabled for the rproc before
    continuing with coredump generation. This change adds a check in the PAS
    driver.

    Fixes: 8ed8485c4f05 ("remoteproc: qcom: Add capability to collect minidumps")
    Signed-off-by: Siddharth Gupta
    Signed-off-by: Sibi Sankar
    Reviewed-by: Konrad Dybcio
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/1657022900-2049-5-git-send-email-quic_sibis@quicinc.com
    Signed-off-by: Sasha Levin

    Siddharth Gupta
     
  • [ Upstream commit bed0adac1ded4cb486ba19a3a7e730fbd9a1c9c6 ]

    The wcnss_get_irq function is expected to return a value > 0 in the
    event that an IRQ is succssfully obtained, but it instead returns 0.
    This causes the stop and ready IRQs to never actually be used despite
    being defined in the device-tree. This patch fixes that.

    Fixes: aed361adca9f ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
    Signed-off-by: Sireesh Kodali
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220526141740.15834-2-sireeshkodali1@gmail.com
    Signed-off-by: Sasha Levin

    Sireesh Kodali
     
  • [ Upstream commit 61afafe8b938bc74841cf4b1a73dd08b9d287c5a ]

    of_parse_phandle() returns a node pointer with refcount
    incremented, we should use of_node_put() on it when not needed anymore.
    This function has two paths missing of_node_put().

    Fixes: 6e962bfe56b9 ("remoteproc: imx_rproc: add missing of_node_put")
    Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver")
    Signed-off-by: Miaoqian Lin
    Link: https://lore.kernel.org/r/20220512045558.7142-1-linmq006@gmail.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Sasha Levin

    Miaoqian Lin
     
  • [ Upstream commit fa220c05d282e7479abe08b54e3bdffd06c25e97 ]

    Every iteration of for_each_available_child_of_node() decrements
    the reference count of the previous node.
    When breaking early from a for_each_available_child_of_node() loop,
    we need to explicitly call of_node_put() on the child node.
    Add missing of_node_put() to avoid refcount leak.

    Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem")
    Signed-off-by: Miaoqian Lin
    Acked-by: Suman Anna
    Link: https://lore.kernel.org/r/20220605083334.23942-1-linmq006@gmail.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Sasha Levin

    Miaoqian Lin
     

09 Aug, 2022

1 commit


04 Aug, 2022

1 commit

  • sizeof(struct device) and sizeof(struct device_link) should not be used,
    because priv->pm_devices is type struct device **, priv->pm_devices_link
    is type struct device_link **.
    There is no issue now, because sizeof(struct device) and
    sizeof(struct device_link) are larger than sizeof(*priv->pm_devices)
    and sizeof(*priv->pm_devices_link).

    Reviewed-by: Ye Li
    Signed-off-by: Peng Fan

    Peng Fan
     

24 Jul, 2022

1 commit

  • There is case that after remoteproc start remote processor[M4], the M4
    runs slow and before M4 finish its own rpmsg framework initialization,
    linux sends out vring kick message, then M4 firmware drops the kick
    message. Some NXP released Cortex-M[x] images has such limitation that
    it requires linux sends out vring kick message after M4 firmware finish
    its rpmsg framework initialization.

    Reviewed-by: Jacky Bai
    Reviewed-by: Ye Li
    Signed-off-by: Peng Fan

    Peng Fan
     

06 Jul, 2022

1 commit

  • i.MX93 features a Cortex-M33 core which could be kicked by ROM/Bootloader
    /Linux. Similar with i.MX8MN/P, we use SMC to trap into Arm Trusted
    Firmware to start/stop the M33 core.

    Signed-off-by: Peng Fan
    Link: https://lore.kernel.org/r/20220429005346.2108279-3-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Reviewed-by: Ye Li
    Reviewed-by: Jacky Bai

    Peng Fan
     

30 Jun, 2022

2 commits

  • This is the 5.15.50 stable release

    * tag 'v5.15.50': (1395 commits)
    Linux 5.15.50
    arm64: mm: Don't invalidate FROM_DEVICE buffers at start of DMA transfer
    serial: core: Initialize rs485 RTS polarity already on probe
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/bus/fsl-mc/fsl-mc-bus.c
    drivers/crypto/caam/ctrl.c
    drivers/pci/controller/dwc/pci-imx6.c
    drivers/spi/spi-fsl-qspi.c
    drivers/tty/serial/fsl_lpuart.c
    include/uapi/linux/dma-buf.h

    Jason Liu
     
  • This is the 5.15.41 stable release

    * tag 'v5.15.41': (1977 commits)
    Linux 5.15.41
    usb: gadget: uvc: allow for application to cleanly shutdown
    usb: gadget: uvc: rename function to be more consistent
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
    arch/arm64/configs/defconfig
    drivers/clk/imx/clk-imx8qxp-lpcg.c
    drivers/dma/imx-sdma.c
    drivers/gpu/drm/bridge/nwl-dsi.c
    drivers/mailbox/imx-mailbox.c
    drivers/net/phy/at803x.c
    drivers/tty/serial/fsl_lpuart.c
    security/keys/trusted-keys/trusted_core.c

    Jason Liu
     

15 Jun, 2022

1 commit

  • [ Upstream commit 58b7c856519fe946620ee68dd0c37bd3c695484a ]

    Resource table is used by Linux to get information published by
    remote processor. It should be not be used for memory allocation, so
    not create rproc mem entry.

    Fixes: b29b4249f8f0 ("remoteproc: imx_rproc: add i.MX specific parse fw hook")
    Signed-off-by: Peng Fan
    Link: https://lore.kernel.org/r/20220415025737.1561976-1-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Sasha Levin

    Peng Fan
     

27 Apr, 2022

1 commit


21 Apr, 2022

2 commits

  • There is no mutex protection of these state checking for 'stop'
    and 'detach' which can't guarantee there is no another instance
    is trying to do same operation.

    Consider two instances case:
    Instance1: echo stop > /sys/class/remoteproc/remoteproc0/state
    Instance2: echo stop > /sys/class/remoteproc/remoteproc0/state

    The issue is that the instance2 case may success, Or it
    may fail with -EINVAL, which is uncertain.

    So move this state checking in rproc_cdev_write() and
    state_store() for 'stop', 'detach' operation to
    'rproc_shutdown' , 'rproc_detach' function under the mutex
    protection.

    Signed-off-by: Shengjiu Wang
    Link: https://lore.kernel.org/r/1648434012-16655-3-git-send-email-shengjiu.wang@nxp.com
    Signed-off-by: Mathieu Poirier

    Shengjiu Wang
     
  • There is no mutex protection of the state checking before rproc_boot(),
    which can't guarantee there is no another instance is trying to do
    same operation.

    Consider two instances case:
    Instance1: echo start > /sys/class/remoteproc/remoteproc0/state
    Instance2: echo start > /sys/class/remoteproc/remoteproc0/state
    ...
    Instance2: echo stop > /sys/class/remoteproc/remoteproc0/state
    ...
    Instance1: echo stop > /sys/class/remoteproc/remoteproc0/state

    The one issue is that the instance2 case may success when 'start'
    happens at same time as instance1, then rproc->power = 2; Or it
    may fail with -BUSY, then rproc->power = 1; which is uncertain.

    The another issue is for 'stop' operation, if the rproc->power = 1,
    when instance2 'stop' the remoteproc the instance1 will be
    impacted for it still needs the service at that time.

    The reference counter rproc->power is used to manage state
    changing and there is mutex protection in each operation
    function for multi instance case.

    So remove this state checking in rproc_cdev_write() and
    state_store() for 'start' operation, just let reference
    counter rproc->power to manage the behaviors.

    Signed-off-by: Shengjiu Wang
    Link: https://lore.kernel.org/r/1648434012-16655-2-git-send-email-shengjiu.wang@nxp.com
    Signed-off-by: Mathieu Poirier

    Shengjiu Wang
     

08 Apr, 2022

4 commits

  • [ Upstream commit 07a5dcc4bed9d7cae54adf5aa10ff9f037a3204b ]

    The device_node pointer is returned by of_parse_phandle() or
    of_get_child_by_name() with refcount incremented.
    We should use of_node_put() on it when done.

    This function only call of_node_put(node) when of_address_to_resource
    succeeds, missing error cases.

    Fixes: 278d744c46fd ("remoteproc: qcom: Fix potential device node leaks")
    Fixes: 051fb70fd4ea ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5")
    Signed-off-by: Miaoqian Lin
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220308064522.13804-1-linmq006@gmail.com
    Signed-off-by: Sasha Levin

    Miaoqian Lin
     
  • [ Upstream commit 8f90161a66bc3d6b9fe8dde4d9028d20eae1b62a ]

    The device_node pointer is returned by of_parse_phandle() with refcount
    incremented. We should use of_node_put() on it when done.

    Fixes: aed361adca9f ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
    Signed-off-by: Miaoqian Lin
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220308063102.10049-1-linmq006@gmail.com
    Signed-off-by: Sasha Levin

    Miaoqian Lin
     
  • [ Upstream commit 505b5b1616e200042999de715dbe7c1e2735cd65 ]

    The device_node pointer is returned by of_parse_phandle() with refcount
    incremented. We should use of_node_put() on it when done.

    Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
    Signed-off-by: Miaoqian Lin
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220308031219.4718-1-linmq006@gmail.com
    Signed-off-by: Sasha Levin

    Miaoqian Lin
     
  • commit f89672cc3681952f2d06314981a6b45f8b0045d1 upstream.

    Check count for 0, to avoid a potential underflow. Make the check the
    same as the one in rproc_recovery_write().

    Fixes: 3afdc59e4390 ("remoteproc: Add coredump debugfs entry")
    Signed-off-by: Alistair Delva
    Cc: Rishabh Bhatnagar
    Cc: stable@vger.kernel.org
    Cc: Ohad Ben-Cohen
    Cc: Bjorn Andersson
    Cc: Mathieu Poirier
    Cc: Sibi Sankar
    Cc: linux-remoteproc@vger.kernel.org
    Cc: kernel-team@android.com
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220119232139.1125908-1-adelva@google.com
    Signed-off-by: Greg Kroah-Hartman

    Alistair Delva
     

11 Mar, 2022

1 commit

  • This is the 5.15.27 stable release

    * tag 'v5.15.27': (3069 commits)
    Linux 5.15.27
    hamradio: fix macro redefine warning
    KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
    arch/arm64/boot/dts/freescale/imx8mq.dtsi
    drivers/dma-buf/heaps/cma_heap.c
    drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
    drivers/gpu/drm/mxsfb/mxsfb_kms.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/rpmsg/rpmsg_char.c
    drivers/soc/imx/gpcv2.c
    drivers/thermal/imx_thermal.c

    Jason Liu
     

27 Jan, 2022

1 commit

  • commit 4da96175014be67c846fd274eace08066e525d75 upstream.

    'priv->workqueue' is destroyed in the error handling path of the probe but
    not in the remove function.

    Add the missing call to release some resources.

    Cc: stable
    Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox")
    Signed-off-by: Christophe JAILLET
    Reviewed-by: Peng Fan
    Tested-by: Peng Fan
    Link: https://lore.kernel.org/r/d28ca94a4031bd7297d47c2164e18885a5a6ec19.1634366546.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Greg Kroah-Hartman

    Christophe JAILLET
     

20 Jan, 2022

2 commits

  • commit dd585d9bfbf06fd08a6326c82978be1f06e7d1bd upstream.

    Add missing power-domain "mxc" required by CDSP PAS remoteproc on SM8350
    SoC.

    Fixes: e8b4e9a21af7 ("remoteproc: qcom: pas: Add SM8350 PAS remoteprocs")
    Signed-off-by: Sibi Sankar
    Cc: stable@vger.kernel.org
    Tested-by: Bjorn Andersson
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/1624559605-29847-1-git-send-email-sibis@codeaurora.org
    Signed-off-by: Greg Kroah-Hartman

    Sibi Sankar
     
  • commit fdc12231d885119cc2e2b4f3e0fbba3155f37a56 upstream.

    If the string passed into qcom_pil_info_store() isn't as long as
    PIL_RELOC_NAME_LEN we'll try to copy the string assuming the length is
    PIL_RELOC_NAME_LEN to the io space and go beyond the bounds of the
    string. Let's only copy as many byes as the string is long, ignoring the
    NUL terminator.

    This fixes the following KASAN error:

    BUG: KASAN: global-out-of-bounds in __memcpy_toio+0x124/0x140
    Read of size 1 at addr ffffffd35086e386 by task rmtfs/2392

    CPU: 2 PID: 2392 Comm: rmtfs Tainted: G W 5.16.0-rc1-lockdep+ #10
    Hardware name: Google Lazor (rev3+) with KB Backlight (DT)
    Call trace:
    dump_backtrace+0x0/0x410
    show_stack+0x24/0x30
    dump_stack_lvl+0x7c/0xa0
    print_address_description+0x78/0x2bc
    kasan_report+0x160/0x1a0
    __asan_report_load1_noabort+0x44/0x50
    __memcpy_toio+0x124/0x140
    qcom_pil_info_store+0x298/0x358 [qcom_pil_info]
    q6v5_start+0xdf0/0x12e0 [qcom_q6v5_mss]
    rproc_start+0x178/0x3a0
    rproc_boot+0x5f0/0xb90
    state_store+0x78/0x1bc
    dev_attr_store+0x70/0x90
    sysfs_kf_write+0xf4/0x118
    kernfs_fop_write_iter+0x208/0x300
    vfs_write+0x55c/0x804
    ksys_pwrite64+0xc8/0x134
    __arm64_compat_sys_aarch32_pwrite64+0xc4/0xdc
    invoke_syscall+0x78/0x20c
    el0_svc_common+0x11c/0x1f0
    do_el0_svc_compat+0x50/0x60
    el0_svc_compat+0x5c/0xec
    el0t_32_sync_handler+0xc0/0xf0
    el0t_32_sync+0x1a4/0x1a8

    The buggy address belongs to the variable:
    .str.59+0x6/0xffffffffffffec80 [qcom_q6v5_mss]

    Memory state around the buggy address:
    ffffffd35086e280: 00 00 00 00 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
    ffffffd35086e300: 00 02 f9 f9 f9 f9 f9 f9 00 00 00 06 f9 f9 f9 f9
    >ffffffd35086e380: 06 f9 f9 f9 05 f9 f9 f9 00 00 00 00 00 06 f9 f9
    ^
    ffffffd35086e400: f9 f9 f9 f9 01 f9 f9 f9 04 f9 f9 f9 00 00 01 f9
    ffffffd35086e480: f9 f9 f9 f9 00 00 00 00 00 00 00 01 f9 f9 f9 f9

    Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM")
    Signed-off-by: Stephen Boyd
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20211117065454.4142936-1-swboyd@chromium.org
    Signed-off-by: Greg Kroah-Hartman

    Stephen Boyd
     

23 Dec, 2021

2 commits


03 Dec, 2021

1 commit

  • There is a mismatch with upstream that community kernel not have
    dual m4 core support, so the initial flag starts from bit0. After
    support i.MX8QM, the lower sixteen bits is for core identification,
    such as i.MX8QM has dual cortex-M4 core. Higer bits for flags.

    So correct ATT_IOMEM to BIT(30)

    Reviewed-by: Ye Li
    Signed-off-by: Peng Fan

    Peng Fan
     

01 Dec, 2021

1 commit

  • This is the 5.15.5 stable release

    * tag 'v5.15.5': (1261 commits)
    Linux 5.15.5
    ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()
    ALSA: hda: hdac_ext_stream: fix potential locking issues
    ...

    Conflicts:
    arch/powerpc/platforms/85xx/Makefile
    drivers/crypto/caam/caampkc.c
    drivers/gpu/drm/bridge/nwl-dsi.c
    drivers/gpu/drm/imx/imx-drm-core.c
    drivers/remoteproc/imx_rproc.c
    drivers/soc/imx/gpcv2.c
    include/linux/rpmsg.h

    Jason Liu
     

30 Nov, 2021

1 commit

  • * rpmsg/next: (27 commits)
    MLK-25649-7 rpmsg: imx: Add support for identifying SCU wakeup source from sysfs
    MLK-25649-6 remoteproc: imx_proc: Add support for identifying SCU wakeup source from sysfs
    MPSDK-172 remoteproc: imx_rproc: Re-building communication channels when a remote crashes
    LF-4258 remoteproc: imx_rproc: use rsc_va for resource table
    LF-4245-2 remoteproc: imx_rproc: use correct resoruce table address
    ...

    Dong Aisheng
     

19 Nov, 2021

6 commits

  • commit e90547d59d4e29e269e22aa6ce590ed0b41207d2 upstream.

    Usually the dash '-' is preferred in node name.
    So far, not dts in upstream kernel, so we just update node name
    in driver.

    Cc: Bjorn Andersson
    Cc: Mathieu Poirier
    Fixes: 5e4c1243071d ("remoteproc: imx_rproc: support remote cores booted before Linux Kernel")
    Reviewed-and-tested-by: Peng Fan
    Signed-off-by: Dong Aisheng
    Signed-off-by: Peng Fan
    Cc: stable
    Link: https://lore.kernel.org/r/20210910090621.3073540-6-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Dong Aisheng
     
  • commit afe670e23af91d8a74a8d7049f6e0984bbf6ea11 upstream.

    vdev regions are typically named vdev0buffer, vdev0ring0, vdev0ring1 and
    etc. Change to strncmp to cover them all.

    Fixes: 8f2d8961640f ("remoteproc: imx_rproc: ignore mapping vdev regions")
    Reviewed-and-tested-by: Peng Fan
    Signed-off-by: Dong Aisheng
    Signed-off-by: Peng Fan
    Cc: stable
    Link: https://lore.kernel.org/r/20210910090621.3073540-5-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Dong Aisheng
     
  • commit 970675f61bf5761d7e5326f6e4df995ecdba5e11 upstream.

    Currently the is_iomem is a random value in the stack which may
    be default to true even on those platforms that not use iomem to
    store firmware.

    Cc: Bjorn Andersson
    Cc: Mathieu Poirier
    Fixes: 40df0a91b2a5 ("remoteproc: add is_iomem to da_to_va")
    Reviewed-and-tested-by: Peng Fan
    Signed-off-by: Dong Aisheng
    Signed-off-by: Peng Fan
    Cc: stable
    Link: https://lore.kernel.org/r/20210910090621.3073540-3-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Dong Aisheng
     
  • commit 24acbd9dc934f5d9418a736c532d3970a272063e upstream.

    It seems luckliy work on i.MX platform, but it is wrong.
    Need use memcpy_toio, not memcpy_fromio.

    Fixes: 40df0a91b2a5 ("remoteproc: add is_iomem to da_to_va")
    Tested-by: Dong Aisheng (i.MX8MQ)
    Reported-by: kernel test robot
    Reported-by: Dong Aisheng
    Signed-off-by: Peng Fan
    Cc: stable
    Link: https://lore.kernel.org/r/20210910090621.3073540-2-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Peng Fan
     
  • [ Upstream commit 0374a4ea7269645c46c3eb288526ea072fa19e79 ]

    If 'copy_dma_range_map() fails, the memory allocated for 'rvdev' will leak.
    Move the 'copy_dma_range_map()' call after the device registration so
    that 'rproc_rvdev_release()' can be called to free some resources.

    Also, branch to the error handling path if 'copy_dma_range_map()' instead
    of a direct return to avoid some other leaks.

    Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset")
    Signed-off-by: Christophe JAILLET
    Reviewed-by: Jim Quinlan
    Reviewed-by: Mathieu Poirier
    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/e6d0dad6620da4fdf847faa903f79b735d35f262.1630755377.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     
  • [ Upstream commit 91bb26637353f35241f5472eedf3202ebe13e2e5 ]

    is_iomem was introduced in the commit 40df0a91b2a5 ("remoteproc: add
    is_iomem to da_to_va"), but the driver seemed missed to provide the io
    type correctly.
    This patch updates remoteproc driver to indicate the TCM on IMX are io
    memories. Without the change, remoteproc kick will fail.

    Cc: Bjorn Andersson
    Cc: Mathieu Poirier
    Cc: Peng Fan
    Reviewed-and-tested-by: Peng Fan
    Fixes: 79806d32d5aa ("remoteproc: imx_rproc: support i.MX8MN/P")
    Signed-off-by: Dong Aisheng
    Signed-off-by: Peng Fan
    stable
    Link: https://lore.kernel.org/r/20210910090621.3073540-4-peng.fan@oss.nxp.com
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Sasha Levin

    Dong Aisheng
     

02 Nov, 2021

1 commit