Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1474677pxb; Fri, 24 Sep 2021 05:30:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn9w2E9Z0CE/G54CmCcNV2rAQwQR+aq8qGe4ibeoc4Z3x0Cnxrt/pLGW0E21vQbqyKf/xm X-Received: by 2002:a05:6e02:1a28:: with SMTP id g8mr8479947ile.158.1632486617268; Fri, 24 Sep 2021 05:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632486617; cv=none; d=google.com; s=arc-20160816; b=RwVT14LGyGf9Qvpto7+5DyTR0wz17BEdR9c9ACYrywvLMLkrEGSEHfWtGqGKhwasr0 npSgNE3x3BHXh/BD5Jf5lNzZR8ChjIgSXrLsSgpYGWH2OyNw+vrK+SsAnEi2ghaFhkFS tPYenYohGD+RsMA34ZOrxnof9nxRzcWqAU1dzSEIj0yi/bsDuL8kYjJhvSXKy2BARKrb SnOmmP75WsY97xb5Cf1d3whwwQwRuWSSPtE480r9qiyxzHTKXs07sEf3lyJCXnCamHAG hhwZUxAswVPuNIjWUH0Oqnln8QhHdk4vU/gHnLx0lqsCEEjzWzY+tvAsFDvOrLDTNHRk 64bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=Vssc4HncWcwhRFCbvgK9O+2lXOlnc9aZF+kgxkaXVUU=; b=hWdJ6/Y/gWaFOOgpGMQlLQtQTX4PS+0L/yPzZUQbcsNfoEE9CgV3Es7XR8+YgDkVlP SM/ZVXlxl5vGURKyfcUZRrQa6slvJ0LbcKniflP7f3emgpMyBlr/jObb1y0mnBJj2Vlu ULbUfm9wO03vgZzW/bKi/12jUt2SubO3SDqJbiIP+2hyb7v45T6285QwrDZvpNN4A/6E dem2o4vM28K9LSqMbq8Eccjt4joJOVWZr98TitMJdCp0FX8A54hfaQIobzkPm/6kICCo zmRfGAWfY53l/8ORL3SHTy2aGzl2po7tBETmwaFnfql3VZ+B9QmDHHHmW/EcHVWXFYN5 +MZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si11088056ilv.38.2021.09.24.05.30.04; Fri, 24 Sep 2021 05:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343583AbhIXMVN (ORCPT + 99 others); Fri, 24 Sep 2021 08:21:13 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:15766 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245562AbhIXMVE (ORCPT ); Fri, 24 Sep 2021 08:21:04 -0400 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 24 Sep 2021 05:19:31 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 24 Sep 2021 05:19:30 -0700 X-QCInternal: smtphost Received: from ekangupt-linux.qualcomm.com ([10.204.67.11]) by ironmsg02-blr.qualcomm.com with ESMTP; 24 Sep 2021 17:49:15 +0530 Received: by ekangupt-linux.qualcomm.com (Postfix, from userid 2319895) id 5ED4D4314; Fri, 24 Sep 2021 17:49:14 +0530 (IST) From: Jeya R To: linux-arm-msm@vger.kernel.org, srinivas.kandagatla@linaro.org Cc: Jeya R , 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 Message-Id: <1632485951-13473-4-git-send-email-jeyr@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1632485951-13473-1-git-send-email-jeyr@codeaurora.org> References: <1632485951-13473-1-git-send-email-jeyr@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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