All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] soc: qcom: Add Qualcomm Memshare QMI service
@ 2021-03-19 17:23 nikitos.tr
  2021-03-19 17:23 ` [PATCH 1/2] dt-bindings: soc: qcom: Add bindings for Qualcomm Memshare service nikitos.tr
  2021-03-19 17:23 ` [PATCH 2/2] soc: qcom: Add Qualcomm Memshare QMI service nikitos.tr
  0 siblings, 2 replies; 7+ messages in thread
From: nikitos.tr @ 2021-03-19 17:23 UTC (permalink / raw)
  To: agross, bjorn.andersson
  Cc: robh+dt, linux-arm-msm, devicetree, linux-kernel, Nikita Travkin

From: Nikita Travkin <nikitos.tr@gmail.com>

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
subsystems.

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).

[1] https://source.codeaurora.org/quic/la/kernel/msm-3.10/tree/drivers/soc/qcom/memshare?h=LA.BR.1.2.9.1-02310-8x16.0

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

-- 
2.27.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-15 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 17:23 [PATCH 0/2] soc: qcom: Add Qualcomm Memshare QMI service nikitos.tr
2021-03-19 17:23 ` [PATCH 1/2] dt-bindings: soc: qcom: Add bindings for Qualcomm Memshare service nikitos.tr
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 nikitos.tr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.