All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeya R <jeyr@codeaurora.org>
To: linux-arm-msm@vger.kernel.org, srinivas.kandagatla@linaro.org
Cc: Jeya R <jeyr@codeaurora.org>,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	fastrpc.upstream@qti.qualcomm.com
Subject: [PATCH 3/4] misc: fastrpc: Set channel as secure
Date: Fri, 24 Sep 2021 17:49:10 +0530	[thread overview]
Message-ID: <1632485951-13473-4-git-send-email-jeyr@codeaurora.org> (raw)
In-Reply-To: <1632485951-13473-1-git-send-email-jeyr@codeaurora.org>

Set channel as secure based on domain ID and secure domain DT property.
All DSP domains other than CDSP are set as secure by default and for
CDSP domain, secure flag is set if property is added to DT file.

Signed-off-by: Jeya R <jeyr@codeaurora.org>
---
 drivers/misc/fastrpc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 07c41a5..631713d 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -216,6 +216,7 @@ struct fastrpc_channel_ctx {
 	struct miscdevice miscdev;
 	struct miscdevice securedev;
 	struct kref refcount;
+	bool secure;
 };
 
 struct fastrpc_user {
@@ -1646,6 +1647,12 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 	if (!data)
 		return -ENOMEM;
 
+	if (domain_id != CDSP_DOMAIN_ID)
+		data->secure = true;
+	else
+		data->secure = of_property_read_bool(rdev->of_node,
+				"qcom,secure-domain");
+
 	data->miscdev.minor = MISC_DYNAMIC_MINOR;
 	data->miscdev.name = devm_kasprintf(rdev, GFP_KERNEL, "fastrpc-%s",
 					    domains[domain_id]);
-- 
2.7.4


  parent reply	other threads:[~2021-09-24 12:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 12:19 [PATCH 0/4] Add secure domains support Jeya R
2021-09-24 12:19 ` [PATCH 1/4] dt-bindings: devicetree documentation for secure domain Jeya R
2021-09-29 14:06   ` Srinivas Kandagatla
2021-09-24 12:19 ` [PATCH 2/4] misc: fastrpc: Add secure device node support Jeya R
2021-09-24 12:19 ` Jeya R [this message]
2021-09-29 14:07   ` [PATCH 3/4] misc: fastrpc: Set channel as secure Srinivas Kandagatla
2021-09-24 12:19 ` [PATCH 4/4] misc: fastrpc: reject non-secure node for secure domain Jeya R
2021-09-29 14:06   ` Srinivas Kandagatla
2021-09-29 14:06 ` [PATCH 0/4] Add secure domains support Srinivas Kandagatla

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1632485951-13473-4-git-send-email-jeyr@codeaurora.org \
    --to=jeyr@codeaurora.org \
    --cc=fastrpc.upstream@qti.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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