18 Jan, 2021

1 commit


14 Dec, 2020

8 commits

  • To fix build issues of:
    error: implicit declaration of function ‘kmalloc’
    error: implicit declaration of function ‘kfree’

    Signed-off-by: Li Yang

    Li Yang
     
  • Cope with upstream API change from commit
    4bdc0d676("remove ioremap_nocache and devm_ioremap_nocache")

    Signed-off-by: Li Yang

    Li Yang
     
  • Add the rpmsg tty demo for iMX AMP platforms.
    Use the "echo > /dev/*RPMSG*", after insmod the module.

    Signed-off-by: Richard Zhu
    Acked-by: Fugang Duan

    Richard Zhu
     
  • - Enable the tx_block mechanism to make sure that every transmission is
    complete when mailbox is used.
    - Refine the data exchange in the rpmsg_rx_callback and some info
    messages and codes comments.

    Signed-off-by: Robin Gong
    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • Add partition reset notify if m4 reset so that rpmsg channel
    could re-create again while m4 come back.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • - Clean up the codes, move the tx/rx mailbox initializations into one
    function.
    - Fix the mu msg data exchange bug.
    - Fix to stop autoload pingpong test module.

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • - extend the rpmsg support for imx8qm/imx7ulp/imx7d/imx6sx

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • Based on "virtio_rpmsg_bus" driver, This patch-set is used to set up
    the communication mechanism between A core and M core on i.MX AMP SOCs.

    Add the initial imx rpmsg support glue driver and one pingpong demo,
    demonstrated the data transactions between A core and remote M core.
    Distributed framework is used in IMX RPMSG implementation, refer to the
    following requirements:
    - The CAN functions contained in M core and RTOS should be ready and
    complete functional in 50ms after AMP system is turned on.
    - Partition reset. System wouldn't be stalled by the exceptions (e.x
    the reset triggered by the system hang) occurred at the other side.
    And the RPMSG mechanism should be recovered automactilly after the
    partition reset is completed.
    In this scenario, the M core and RTOS would be kicked off by bootloader
    firstly, then A core and Linux would be loaded later. Both M core/RTOS
    and A core/Linux are running independly.

    One physical memory region used to store the vring is mandatory required
    to pre-reserved and well-knowned by both A core and M core

    Signed-off-by: Richard Zhu

    Richard Zhu
     

27 Oct, 2020

1 commit


23 Oct, 2020

1 commit

  • Pull rpmsg updates from Bjorn Andersson:
    "This introduces rpmsg_char support for GLINK and fixes a few issues"

    * tag 'rpmsg-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc:
    rpmsg: glink: Expose rpmsg name attr for glink
    rpmsg: glink: Add support for rpmsg glink chrdev
    rpmsg: Guard against null endpoint ops in destroy
    rpmsg: glink: Use complete_all for open states
    rpmsg: virtio: fix compilation warning for virtio_rpmsg_channel description
    rpmsg: Avoid double-free in mtk_rpmsg_register_device
    rpmsg: smd: Fix a kobj leak in in qcom_smd_parse_edge()

    Linus Torvalds
     

30 Sep, 2020

1 commit

  • RPMSG unifies various transports that provide IPC to a remote proc.
    Some of these transports require some set of side band signalling in
    order to meet the specifications of the protocol they implement.

    The GLINK native transport supports the tty serial signals to start
    communication with modems that expect to receive the DTR serial signal.

    Extend the rpmsg core with an interface to send and receive sideband
    signals for the transports that need it.

    Bug: 161128971
    Link: https://lore.kernel.org/lkml/1593182819-30747-2-git-send-email-deesin@codeaurora.org/
    Change-Id: I54539d8ddce1bfaec9016c2bec9b5a1372601995
    Signed-off-by: Chris Lew
    (cherry picked from commit 6839fc80fe1f6564eb6a0fc0fd081d459ec6c61b)

    Chris Lew
     

15 Sep, 2020

7 commits

  • Expose the name field as an attr so clients listening to uevents for
    rpmsg can identify the edge the events correspond to.

    Signed-off-by: Chris Lew
    Signed-off-by: Arun Kumar Neelakantam
    Signed-off-by: Deepak Kumar Singh
    Link: https://lore.kernel.org/r/1593017121-7953-5-git-send-email-deesin@codeaurora.org
    Signed-off-by: Bjorn Andersson

    Chris Lew
     
  • RPMSG provides a char device interface to userspace. Probe the rpmsg
    chrdev channel to enable the rpmsg_ctrl device creation on glink
    transports.

    Signed-off-by: Chris Lew
    Signed-off-by: Arun Kumar Neelakantam
    Signed-off-by: Deepak Kumar Singh
    Link: https://lore.kernel.org/r/1593017121-7953-4-git-send-email-deesin@codeaurora.org
    Signed-off-by: Bjorn Andersson

    Deepak Kumar Singh
     
  • In RPMSG GLINK the chrdev device will allocate an ept as part of the
    rpdev creation. This device will not register endpoint ops even though
    it has an allocated ept. Protect against the case where the device is
    being destroyed.

    Signed-off-by: Chris Lew
    Signed-off-by: Arun Kumar Neelakantam
    Signed-off-by: Deepak Kumar Singh
    Link: https://lore.kernel.org/r/1593017121-7953-3-git-send-email-deesin@codeaurora.org
    Signed-off-by: Bjorn Andersson

    Chris Lew
     
  • The open_req and open_ack completion variables are the state variables
    to represet a remote channel as open. Use complete_all so there are no
    races with waiters and using completion_done.

    Signed-off-by: Chris Lew
    Signed-off-by: Arun Kumar Neelakantam
    Signed-off-by: Deepak Kumar Singh
    Link: https://lore.kernel.org/r/1593017121-7953-2-git-send-email-deesin@codeaurora.org
    Signed-off-by: Bjorn Andersson

    Chris Lew
     
  • Complete the virtio_rpmsg_channel structure description to fix a
    compilation warning with W=1 option:

    drivers/rpmsg/virtio_rpmsg_bus.c:95: warning: Cannot understand
    * @vrp: the remote processor this channel belongs to

    Reviewed-by: Mathieu Poirier
    Signed-off-by: Arnaud Pouliquen
    Link: https://lore.kernel.org/r/20200731074850.3262-1-arnaud.pouliquen@st.com
    Signed-off-by: Bjorn Andersson

    Arnaud Pouliquen
     
  • If rpmsg_register_device fails, it will call
    mtk_rpmsg_release_device which already frees mdev.

    Fixes: 7017996951fd ("rpmsg: add rpmsg support for mt8183 SCP.")
    Signed-off-by: Nicolas Boichat
    Reviewed-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20200903080547.v3.1.I56cf27cd59f4013bd074dc622c8b8248b034a4cc@changeid
    Signed-off-by: Bjorn Andersson

    Nicolas Boichat
     
  • We need to call of_node_put(node) on the error paths for this function.

    Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/20200908071841.GA294938@mwanda
    Signed-off-by: Bjorn Andersson

    Dan Carpenter
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

22 Jul, 2020

1 commit

  • According to the VirtIO 1.0 spec data, sent over virtual queues must
    be in little-endian format. Update the RPMsg VirtIO implementation
    to enforce that but let legacy configurations continue use native
    endianness.

    Acked-by: Michael S. Tsirkin
    Signed-off-by: Guennadi Liakhovetski
    Reviewed-by: Mathieu Poirier
    Tested-by: Arnaud Pouliquen
    Link: https://lore.kernel.org/r/20200721085638.GA3815@ubuntu
    Signed-off-by: Bjorn Andersson

    Guennadi Liakhovetski
     

09 Jun, 2020

2 commits

  • Pull remoteproc updates from Bjorn Andersson:
    "This introduces device managed versions of functions used to register
    remoteproc devices, add support for remoteproc driver specific
    resource control, enables remoteproc drivers to specify ELF class and
    machine for coredumps. It integrates pm_runtime in the core for
    keeping resources active while the remote is booted and holds a wake
    source while recoverying a remote processor after a firmware crash.

    It refactors the remoteproc device's allocation path to simplify the
    logic, fix a few cleanup bugs and to not clone const strings onto the
    heap. Debugfs code is simplifies using the DEFINE_SHOW_ATTRIBUTE and a
    zero-length array is replaced with flexible-array.

    A new remoteproc driver for the JZ47xx VPU is introduced, the Qualcomm
    SM8250 gains support for audio, compute and sensor remoteprocs and the
    Qualcomm SC7180 modem support is cleaned up and improved.

    The Qualcomm glink subsystem-restart driver is merged into the main
    glink driver, the Qualcomm sysmon driver is extended to properly
    notify remote processors about all other remote processors' state
    transitions"

    * tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: (43 commits)
    remoteproc: Fix an error code in devm_rproc_alloc()
    MAINTAINERS: Add myself as reviewer for Ingenic rproc driver
    remoteproc: ingenic: Added remoteproc driver
    remoteproc: Add support for runtime PM
    dt-bindings: Document JZ47xx VPU auxiliary processor
    remoteproc: wcss: Fix arguments passed to qcom_add_glink_subdev()
    remoteproc: Fix and restore the parenting hierarchy for vdev
    remoteproc: Fall back to using parent memory pool if no dedicated available
    remoteproc: Replace zero-length array with flexible-array
    remoteproc: wcss: add support for rpmsg communication
    remoteproc: core: Prevent system suspend during remoteproc recovery
    remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
    remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use
    remoteproc: qcom_q6v5_mss: Drop accesses to MPSS PERPH register space
    dt-bindings: remoteproc: qcom: Replace halt-nav with spare-regs
    remoteproc: qcom: pas: Add SM8250 PAS remoteprocs
    dt-bindings: remoteproc: qcom: pas: Add SM8250 remoteprocs
    remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region
    dt-bindings: remoteproc: qcom: Use memory-region to reference memory
    remoteproc: qcom: pas: Add SC7180 Modem support
    ...

    Linus Torvalds
     
  • Pull rpmsg updates from Bjorn Andersson:
    "This replaces a zero-length array with flexible-array and fixes a typo
    in a comment in the rpmsg core"

    * tag 'rpmsg-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc:
    rpmsg: Replace zero-length array with flexible-array
    rpmsg: fix a comment typo for rpmsg_device_match()

    Linus Torvalds
     

13 May, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    sizeof(flexible-array-member) triggers a warning because flexible array
    members have incomplete type[1]. There are some instances of code in
    which the sizeof operator is being incorrectly/erroneously applied to
    zero-length arrays and the result is zero. Such instances may be hiding
    some bugs. So, this work (flexible-array member conversions) will also
    help to get completely rid of those sorts of issues.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200507191948.GA16053@embeddedor
    Signed-off-by: Bjorn Andersson

    Gustavo A. R. Silva
     

08 May, 2020

1 commit

  • In all but the very special case of a system with _only_ glink_rpm,
    GLINK is dependent on glink_ssr, so move it to rpmsg and combine it with
    qcom_glink_native in the new qcom_glink kernel module.

    Acked-by: Chris Lew
    Acked-by: Rishabh Bhatnagar
    Link: https://lore.kernel.org/r/20200423003736.2027371-4-bjorn.andersson@linaro.org
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     

17 Apr, 2020

2 commits


21 Jan, 2020

1 commit


02 Dec, 2019

1 commit

  • Pull rpmsg updates from Bjorn Andersson:
    "This contains a number of bug fixes to the GLINK transport driver, an
    off-by-one in the GLINK smem driver and a memory leak fix in the rpmsg
    char driver"

    * tag 'rpmsg-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc:
    rpmsg: Fix Kconfig indentation
    rpmsg: char: Simplify 'rpmsg_eptdev_release()'
    rpmsg: glink: Free pending deferred work on remove
    rpmsg: glink: Don't send pending rx_done during remove
    rpmsg: glink: Fix rpmsg_register_device err handling
    rpmsg: glink: Put an extra reference during cleanup
    rpmsg: glink: Fix use after free in open_ack TIMEOUT case
    rpmsg: glink: Fix reuse intents memory leak issue
    rpmsg: glink: Set tail pointer to 0 at end of FIFO
    rpmsg: char: release allocated memory

    Linus Torvalds
     

22 Nov, 2019

1 commit

  • Adjust indentation from spaces to tab (+optional two spaces) as in
    coding style with command like:
    $ sed -e 's/^ /\t/' -i */Kconfig

    Signed-off-by: Krzysztof Kozlowski
    Link: https://lore.kernel.org/r/20191120133945.13938-1-krzk@kernel.org
    Signed-off-by: Bjorn Andersson

    Krzysztof Kozlowski
     

09 Nov, 2019

1 commit


23 Oct, 2019

1 commit

  • The .ioctl and .compat_ioctl file operations have the same prototype so
    they can both point to the same function, which works great almost all
    the time when all the commands are compatible.

    One exception is the s390 architecture, where a compat pointer is only
    31 bit wide, and converting it into a 64-bit pointer requires calling
    compat_ptr(). Most drivers here will never run in s390, but since we now
    have a generic helper for it, it's easy enough to use it consistently.

    I double-checked all these drivers to ensure that all ioctl arguments
    are used as pointers or are ignored, but are not interpreted as integer
    values.

    Acked-by: Jason Gunthorpe
    Acked-by: Daniel Vetter
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Greg Kroah-Hartman
    Acked-by: David Sterba
    Acked-by: Darren Hart (VMware)
    Acked-by: Jonathan Cameron
    Acked-by: Bjorn Andersson
    Acked-by: Dan Williams
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

17 Oct, 2019

6 commits

  • By just cancelling the deferred rx worker during GLINK instance teardown
    any pending deferred commands are leaked, so free them.

    Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
    Cc: stable@vger.kernel.org
    Acked-by: Chris Lew
    Tested-by: Srinivas Kandagatla
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • Attempting to transmit rx_done messages after the GLINK instance is
    being torn down will cause use after free and memory leaks. So cancel
    the intent_work and free up the pending intents.

    With this there are no concurrent accessors of the channel left during
    qcom_glink_native_remove() and there is therefor no need to hold the
    spinlock during this operation - which would prohibit the use of
    cancel_work_sync() in the release function. So remove this.

    Fixes: 1d2ea36eead9 ("rpmsg: glink: Add rx done command")
    Cc: stable@vger.kernel.org
    Acked-by: Chris Lew
    Tested-by: Srinivas Kandagatla
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • The device release function is set before registering with rpmsg. If
    rpmsg registration fails, the framework will call device_put(), which
    invokes the release function. The channel create logic does not need to
    free rpdev if rpmsg_register_device() fails and release is called.

    Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
    Cc: stable@vger.kernel.org
    Tested-by: Srinivas Kandagatla
    Signed-off-by: Chris Lew
    Signed-off-by: Bjorn Andersson

    Chris Lew
     
  • In a remote processor crash scenario, there is no guarantee the remote
    processor sent close requests before it went into a bad state. Remove
    the reference that is normally handled by the close command in the
    so channel resources can be released.

    Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
    Cc: stable@vger.kernel.org
    Tested-by: Srinivas Kandagatla
    Signed-off-by: Chris Lew
    Reported-by: Srinivas Kandagatla
    Signed-off-by: Bjorn Andersson

    Chris Lew
     
  • Extra channel reference put when remote sending OPEN_ACK after timeout
    causes use-after-free while handling next remote CLOSE command.

    Remove extra reference put in timeout case to avoid use-after-free.

    Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
    Cc: stable@vger.kernel.org
    Tested-by: Srinivas Kandagatla
    Signed-off-by: Arun Kumar Neelakantam
    Signed-off-by: Bjorn Andersson

    Arun Kumar Neelakantam
     
  • Memory allocated for re-usable intents are not freed during channel
    cleanup which causes memory leak in system.

    Check and free all re-usable memory to avoid memory leak.

    Fixes: 933b45da5d1d ("rpmsg: glink: Add support for TX intents")
    Cc: stable@vger.kernel.org
    Acked-By: Chris Lew
    Tested-by: Srinivas Kandagatla
    Signed-off-by: Arun Kumar Neelakantam
    Reported-by: Srinivas Kandagatla
    Signed-off-by: Bjorn Andersson

    Arun Kumar Neelakantam
     

12 Oct, 2019

1 commit

  • When wrapping around the FIFO, the remote expects the tail pointer to
    be reset to 0 on the edge case where the tail equals the FIFO length.

    Fixes: caf989c350e8 ("rpmsg: glink: Introduce glink smem based transport")
    Cc: stable@vger.kernel.org
    Signed-off-by: Chris Lew
    Signed-off-by: Bjorn Andersson

    Chris Lew
     

05 Oct, 2019

1 commit