20 Dec, 2017

1 commit

  • [ Upstream commit 2394facb17bcace4b3c19b50202177a5d8903b64 ]

    The "intent_req_comp" variable is used without initialization which
    results in NULL pointer dereference in qcom_glink_request_intent().

    we need to initialize the completion variable before using it.

    Fixes: 27b9c5b66b23 ("rpmsg: glink: Request for intents when unavailable")
    Signed-off-by: Arun Kumar Neelakantam
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Arun Kumar Neelakantam
     

21 Nov, 2017

1 commit

  • commit 1e0d5615bbc37deb7732491798abccf8d3c3d244 upstream.

    The qcom_glink_native driver is missing a MODULE_LICENSE(), correct
    this.

    Fixes: 835764ddd9af ("rpmsg: glink: Move the common glink protocol implementation to glink_native.c")
    Reported-by: Randy Dunlap
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Bjorn Andersson
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

11 Oct, 2017

2 commits


05 Sep, 2017

2 commits

  • The new switch cases for RPM_CMD_RX_DONE, RPM_CMD_RX_DONE_W_REUSE,
    RPM_CMD_RX_INTENT_REQ_ACK, RPM_CMD_INTENT and RPM_CMD_RX_INTENT_REQ from
    4 recent commits are not setting ret and so a later non-zero check on ret
    is testing on a garbage value in ret. Fix this by initializing ret to zero.

    Detected by CoverityScan CID#1455249 ("Uninitialized scalar variable")

    Fixes: 933b45da5d1d ("rpmsg: glink: Add support for TX intents)
    Fixes: dacbb35e930f ("glink: Receive and store the remote intent buffers")
    Fixes: 27b9c5b66b23 ("rpmsg: glink: Request for intents when unavailable")
    Fixes: 88c6060f5a7f ("rpmsg: glink: Handle remote rx done command")
    Signed-off-by: Colin Ian King
    Signed-off-by: Bjorn Andersson

    Colin Ian King
     
  • In the case where glink->intentless is true and the call
    to qcom_glink_tx fails then we have a condition where ret is
    non-zero and intent is null, causing a null pointer deference
    when setting intent->in_use to false. Add an extra check to
    only dereference intent if intent is non-null.

    Detected by: CoverityScan CID#1455247 ("Explicit null dereferenced")

    Fixes: 88c6060f5a7f ("rpmsg: glink: Handle remote rx done command")
    Signed-off-by: Colin Ian King
    Signed-off-by: Bjorn Andersson

    Colin Ian King
     

01 Sep, 2017

1 commit


31 Aug, 2017

1 commit


30 Aug, 2017

19 commits

  • Once the remote side sends a rx done ack, check for the intent reuse
    information from it and suitably discard or reuse the remote passed
    intent buffers.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • While sending data, we search for suitable sized intent to map and
    simply fail if a intent is not found. Instead request for a intent of
    required size and wait till one is alloted.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • While sending data, use the remote intent id buffer of suitable size
    that was passed by remote previously.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • Just like we allocating and sending intent ids to remote, remote side
    allocates and sends us the intents as well. So save the intent ids and
    use it later while sending data targeting the appropriate intents based
    on the size.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • Preallocate local intent buffers and pass the intent ids to the remote.
    This way there are some default intents available for the remote to
    start sending data without having to wait by sending intent requests. Do
    this by adding the rpmsg announce_create ops, which gets called right
    after the rpmsg device gets probed.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • Send RX data receive ack to remote and also inform that local intent
    buffer is used and freed. This informs the remote to request for next
    set of intent buffers before doing a send operation.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • To fully read the received rx data from FIFO both the command and data
    has to be read. Currently we read command, data separately and process
    them. By adding an offset parameter to RX FIFO peak accessor, command
    and data can be read together, simplifying things. So introduce this.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • So previously on request from remote side, we allocated local intent
    buffers and passed the ids to the remote. Now when we receive data
    buffers from remote directed to that intent id, copy the data to the
    corresponding preallocated intent buffer.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • Intents are nothing but pre-allocated buffers of appropriate size that
    are allocated on the local side and communicated to the remote side and
    the remote stores the list of intent ids that it is informed.

    Later when remote side is intenting to send data, it picks up a right
    intent (based on the size) and sends the data buffer and the intent id.
    Local side receives the data and copies it to the local intent buffer.

    The whole idea is to avoid stalls on the transport for allocating
    memory, used for copy based transports.

    When the remote request to allocate buffers using CMD_RX_INTENT_REQ, we
    allocate buffers of requested size, store the buffer id locally and also
    communicate the intent id to the remote.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • The channel members lcids, rcids synchronised using the idr_lock is
    accessed in both atomic/non-atomic contexts. The readers are not
    currently synchronised. That no correct, so add the readers as well
    under the lock and use a spinlock.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • G-link supports a version number and feature flags for each transport.
    A combination of the version number and feature flags enable/disable:

    (*) G-Link software updates for each edge
    (*) Individual features for each edge

    Endpoints negotiate both the version and the supported flags when
    the transport is opened and they cannot be changed after negotiation has
    been completed.

    Each full implementation of G-Link must support a minimum of the current
    version, the previous version, and the base negotiation version called v0.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • The glink protocol supports different types of transports (shared
    memory). With the core protocol remaining the same, the way the
    transport's memory is probed and accessed is different. So add support
    for glink's smem based transports.

    Adding a new smem transport register function and the fifo accessors for
    the same.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • mbox_request_channel is done in probe, so free the channel in remove.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • The TX FIFO can be full, if the remote client has not read enough data
    (or) reading it slowly. So its nessecary to return -EAGAIN to the local
    client to enable retry.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Sricharan R
     
  • Glink protocol requires that each message is aligned on a 8 byte offset.
    This is purely a restriction from glink, so in order to support clients
    which do not adher to this, allow data packets of any size, but align
    the head index accordingly, effectively removing the alignment
    restriction.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • Move the common part of glink core protocol implementation to
    glink_native.c that can be shared with the smem based glink
    transport in the later patches.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • There is quite some code common in glink_rpm_probe that can reused for
    glink-smem based transport as well. So split the function and move the
    code to glink_native_probe that can be used later when we add the
    support for glink-smem based transport. Also reuse driver's remove as
    well.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • With the intention of reusing the glink core protocol commands and code
    across both rpm and smem based transports, the only thing different is
    way of accessing the shared-memory of the transport (FIFO). So put the
    fifo accessor's of the transport's pipe (rx/tx) behind indirections, so
    that the rest of the code can be shared.

    For this, have a qcom_glink_pipe that can be used in the common code
    containing the indirections and wrap it with glink_rpm_pipe that
    contains the transport specific members.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • Renaming the glink_rpm_xx functions and structs to qcom_glink_xx
    equivalents helps to reuse the core glink protocol while adding
    support for smem based glink transport in the later patches.

    Acked-by: Arun Kumar Neelakantam
    Signed-off-by: Sricharan R
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     

25 Aug, 2017

2 commits


27 Jul, 2017

2 commits


07 Jul, 2017

1 commit

  • Pull rpmsg updates from Bjorn Andersson:
    "This introduces the Qualcomm GLINK protocol driver and
    DeviceTree-based modalias support, as well as a number of smaller
    fixes"

    * tag 'rpmsg-v4.13' of git://github.com/andersson/remoteproc:
    rpmsg: Make modalias work for DeviceTree based devices
    rpmsg: Drop VIRTUALIZATION dependency from RPMSG_VIRTIO
    rpmsg: Don't overwrite release op of rpdev
    rpmsg: virtio_rpmsg_bus: cleanup multiple assignment to ops
    rpmsg: virtio_rpmsg_bus: fix nameservice address
    rpmsg: cleanup incorrect function in dev_err message
    rpmsg: virtio_rpmsg_bus: fix announce for devices without endpoint
    rpmsg: Introduce Qualcomm RPM glink driver
    soc: qcom: Add device tree binding for GLINK RPM
    rpmsg: Release rpmsg devices in backends

    Linus Torvalds
     

06 Jul, 2017

1 commit

  • Pull networking updates from David Miller:
    "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
    merge window:

    1) Several optimizations for UDP processing under high load from
    Paolo Abeni.

    2) Support pacing internally in TCP when using the sch_fq packet
    scheduler for this is not practical. From Eric Dumazet.

    3) Support mutliple filter chains per qdisc, from Jiri Pirko.

    4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

    5) Add batch dequeueing to vhost_net, from Jason Wang.

    6) Flesh out more completely SCTP checksum offload support, from
    Davide Caratti.

    7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
    Neira Ayuso, and Matthias Schiffer.

    8) Add devlink support to nfp driver, from Simon Horman.

    9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
    Prabhu.

    10) Add stack depth tracking to BPF verifier and use this information
    in the various eBPF JITs. From Alexei Starovoitov.

    11) Support XDP on qed device VFs, from Yuval Mintz.

    12) Introduce BPF PROG ID for better introspection of installed BPF
    programs. From Martin KaFai Lau.

    13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

    14) For loads, allow narrower accesses in bpf verifier checking, from
    Yonghong Song.

    15) Support MIPS in the BPF selftests and samples infrastructure, the
    MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
    Daney.

    16) Support kernel based TLS, from Dave Watson and others.

    17) Remove completely DST garbage collection, from Wei Wang.

    18) Allow installing TCP MD5 rules using prefixes, from Ivan
    Delalande.

    19) Add XDP support to Intel i40e driver, from Björn Töpel

    20) Add support for TC flower offload in nfp driver, from Simon
    Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
    Kicinski, and Bert van Leeuwen.

    21) IPSEC offloading support in mlx5, from Ilan Tayari.

    22) Add HW PTP support to macb driver, from Rafal Ozieblo.

    23) Networking refcount_t conversions, From Elena Reshetova.

    24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
    for tuning the TCP sockopt settings of a group of applications,
    currently via CGROUPs"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
    net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
    dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
    cxgb4: Support for get_ts_info ethtool method
    cxgb4: Add PTP Hardware Clock (PHC) support
    cxgb4: time stamping interface for PTP
    nfp: default to chained metadata prepend format
    nfp: remove legacy MAC address lookup
    nfp: improve order of interfaces in breakout mode
    net: macb: remove extraneous return when MACB_EXT_DESC is defined
    bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
    bpf: fix return in load_bpf_file
    mpls: fix rtm policy in mpls_getroute
    net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
    net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
    ...

    Linus Torvalds
     

29 Jun, 2017

1 commit


28 Jun, 2017

1 commit

  • A dependency to VIRTUALIZATION has been added to RPMSG_VIRTIO (back
    when it was named RPMSG) in v3.10 kernel in commit 397944df3290
    ("rpmsg: fix kconfig dependencies for VIRTIO") to resolve Kconfig
    warnings due to the inclusion of the virtio configuration file from
    the ARM's KVM config file. The KVM config was fixed properly in the
    subsequent release in commit 8bd4ffd6b3a9 ("ARM: kvm: don't include
    drivers/virtio/Kconfig"). So, drop this unneeded VIRTUALIZATION
    dependency from RPMSG_VIRTIO.

    Signed-off-by: Suman Anna
    Signed-off-by: Bjorn Andersson

    Suman Anna
     

27 Jun, 2017

1 commit

  • b0b03b811963 ("rpmsg: Release rpmsg devices in backends") attempted to
    correct the ownership of freeing rpmsg device memory. But the patch
    is not complete, in that the rpmsg core will overwrite the release op as
    the device is being registered.

    Fixes: b0b03b811963 ("rpmsg: Release rpmsg devices in backends")
    Reported-by: Henri Roosen
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     

26 Jun, 2017

3 commits