archive mirror
 help / color / mirror / Atom feed
	Nikita Travkin <>
Subject: [PATCH 0/2] soc: qcom: Add Qualcomm Memshare QMI service
Date: Fri, 19 Mar 2021 22:23:19 +0500	[thread overview]
Message-ID: <> (raw)

From: Nikita Travkin <>

This series adds memshare QMI service.
It receives messages from other subsystems (like modem subsystem) and
answers with a message that contains the memory address of the allocated
region. This is used on many msm8916 based devices for location service
which requests 2 MB region when the modem starts. If the memory isn't
provided, GPS doesn't work. Newer platforms may also use it in other

The driver implements:
 - legacy alloc/free messages (known to be used by Samsung A2015 devices)
 - generic alloc/free messages (used on most msm8916 devices)
 - query_size message (sent by at least one modem firmware for msm8916)

Downstream driver [1] seems to use dynamic memory allocation but it
uses concept of "Guaranteed Memory" which means that the region is
allocated on driver probe and not released even after "free" request.
It also seems to support memory allocation "on demand" without prior
client description.

My driver implements "guaranteed" allocation using reserved-memory regions
and does not allow allocation for any request that was not described in
the device tree. It also additionally checks that qrtr node that sent
the message is correct (to prevent, for example, processing messages sent
from userspace).

memshare_qmi_msg.c/h files are mostly copied from [1] (query_size was
added from later version of the driver) and cleaned up. Those files keep
copyright line from the originals.

This driver is tested to work on multiple msm8916 devices, including
devices that have dts upstream (with an exception of mtp; db410c doesn't
use it).


Nikita Travkin (2):
  dt-bindings: soc: qcom: Add bindings for Qualcomm Memshare service
  soc: qcom: Add Qualcomm Memshare QMI service

 .../bindings/soc/qcom/qcom,memshare.yaml      | 109 ++++
 drivers/soc/qcom/Kconfig                      |   8 +
 drivers/soc/qcom/Makefile                     |   2 +
 drivers/soc/qcom/memshare.c                   | 501 ++++++++++++++++++
 drivers/soc/qcom/memshare_qmi_msg.c           | 370 +++++++++++++
 drivers/soc/qcom/memshare_qmi_msg.h           | 228 ++++++++
 include/dt-bindings/soc/qcom,memshare.h       |  10 +
 7 files changed, 1228 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,memshare.yaml
 create mode 100644 drivers/soc/qcom/memshare.c
 create mode 100644 drivers/soc/qcom/memshare_qmi_msg.c
 create mode 100644 drivers/soc/qcom/memshare_qmi_msg.h
 create mode 100644 include/dt-bindings/soc/qcom,memshare.h


             reply	other threads:[~2021-03-19 17:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 17:23 [this message]
2021-03-19 17:23 ` [PATCH 1/2] dt-bindings: soc: qcom: Add bindings for Qualcomm Memshare service
2021-03-30 14:40   ` Rob Herring
2021-04-10  8:05     ` Nikita Travkin
2021-04-14  3:15       ` Bjorn Andersson
2021-04-15 12:03         ` Nikita Travkin
2021-03-19 17:23 ` [PATCH 2/2] soc: qcom: Add Qualcomm Memshare QMI service

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).