linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/4] Add support for gdsp remoteproc on sa8775p
@ 2025-07-14  5:41 Ling Xu
  2025-07-14  5:41 ` [PATCH v7 1/4] dt-bindings: misc: qcom,fastrpc: Add GDSP label Ling Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Ling Xu @ 2025-07-14  5:41 UTC (permalink / raw)
  To: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh
  Cc: quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm, dri-devel,
	linux-kernel, Ling Xu

The fastrpc driver has support for 5 types of remoteprocs. There are
some products which support GDSP remoteprocs. GDSP is General Purpose
DSP where tasks can be offloaded. Add fastrpc nodes and task offload
support for GDSP. Also strict domain IDs for domain.
Patch [v6]: https://lore.kernel.org/linux-arm-msm/20250709054728.1272480-1-quic_lxu5@quicinc.com/

Changes in v7:
  - Edit commit message.
Changes in v6:
  - Edit commit message.
  - Remove unused definition.
Changes in v5:
  - Edit commit message and add sapce before comment end.
  - Move domain definitions back to driver.
Changes in v4:
  - Split patch and change to common syntax.
Changes in v3:
  - Restrict domain IDs to represent a domain.
Changes in v2:
  - Add GPDSP labels in dt-bindings.

Ling Xu (4):
  dt-bindings: misc: qcom,fastrpc: Add GDSP label
  arm64: dts: qcom: sa8775p: add GDSP fastrpc-compute-cb nodes
  misc: fastrpc: Cleanup the domain names
  misc: fastrpc: add support for gdsp remoteproc

 .../bindings/misc/qcom,fastrpc.yaml           |  2 +
 arch/arm64/boot/dts/qcom/sa8775p.dtsi         | 57 +++++++++++++++++++
 drivers/misc/fastrpc.c                        | 54 ++++++++----------
 include/uapi/misc/fastrpc.h                   |  2 +-
 4 files changed, 85 insertions(+), 30 deletions(-)

-- 
2.34.1


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

* [PATCH v7 1/4] dt-bindings: misc: qcom,fastrpc: Add GDSP label
  2025-07-14  5:41 [PATCH v7 0/4] Add support for gdsp remoteproc on sa8775p Ling Xu
@ 2025-07-14  5:41 ` Ling Xu
  2025-07-14  5:41 ` [PATCH v7 2/4] arm64: dts: qcom: sa8775p: add GDSP fastrpc-compute-cb nodes Ling Xu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Ling Xu @ 2025-07-14  5:41 UTC (permalink / raw)
  To: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh
  Cc: quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm, dri-devel,
	linux-kernel, Ling Xu, Krzysztof Kozlowski

There are some products which support GDSP remoteprocs. GDSP is General
Purpose DSP where tasks can be offloaded. There are 2 GDSPs named gdsp0
and gdsp1. Add "gdsp0" and "gdsp1" as the new supported labels for GDSP
fastrpc domains.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
---
 Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml
index 0840a3d92513..3f6199fc9ae6 100644
--- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml
+++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml
@@ -27,6 +27,8 @@ properties:
       - sdsp
       - cdsp
       - cdsp1
+      - gdsp0
+      - gdsp1
 
   memory-region:
     maxItems: 1
-- 
2.34.1


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

* [PATCH v7 2/4] arm64: dts: qcom: sa8775p: add GDSP fastrpc-compute-cb nodes
  2025-07-14  5:41 [PATCH v7 0/4] Add support for gdsp remoteproc on sa8775p Ling Xu
  2025-07-14  5:41 ` [PATCH v7 1/4] dt-bindings: misc: qcom,fastrpc: Add GDSP label Ling Xu
@ 2025-07-14  5:41 ` Ling Xu
  2025-07-14  5:41 ` [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names Ling Xu
  2025-07-14  5:41 ` [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc Ling Xu
  3 siblings, 0 replies; 12+ messages in thread
From: Ling Xu @ 2025-07-14  5:41 UTC (permalink / raw)
  To: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh
  Cc: quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm, dri-devel,
	linux-kernel, Ling Xu, Dmitry Baryshkov, Konrad Dybcio

Add GDSP0 and GDSP1 fastrpc compute-cb nodes for sa8775p SoC.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 57 +++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
index fed34717460f..5ebc058931ad 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
@@ -6080,6 +6080,34 @@ IPCC_MPROC_SIGNAL_GLINK_QMP
 
 				label = "gpdsp0";
 				qcom,remote-pid = <17>;
+
+				fastrpc {
+					compatible = "qcom,fastrpc";
+					qcom,glink-channels = "fastrpcglink-apps-dsp";
+					label = "gdsp0";
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					compute-cb@1 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <1>;
+						iommus = <&apps_smmu 0x38a1 0x0>;
+						dma-coherent;
+					};
+
+					compute-cb@2 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <2>;
+						iommus = <&apps_smmu 0x38a2 0x0>;
+						dma-coherent;
+					};
+					compute-cb@3 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <3>;
+						iommus = <&apps_smmu 0x38a3 0x0>;
+						dma-coherent;
+					};
+				};
 			};
 		};
 
@@ -6123,6 +6151,35 @@ IPCC_MPROC_SIGNAL_GLINK_QMP
 
 				label = "gpdsp1";
 				qcom,remote-pid = <18>;
+
+				fastrpc {
+					compatible = "qcom,fastrpc";
+					qcom,glink-channels = "fastrpcglink-apps-dsp";
+					label = "gdsp1";
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					compute-cb@1 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <1>;
+						iommus = <&apps_smmu 0x38c1 0x0>;
+						dma-coherent;
+					};
+
+					compute-cb@2 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <2>;
+						iommus = <&apps_smmu 0x38c2 0x0>;
+						dma-coherent;
+					};
+
+					compute-cb@3 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <3>;
+						iommus = <&apps_smmu 0x38c3 0x0>;
+						dma-coherent;
+					};
+				};
 			};
 		};
 
-- 
2.34.1


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

* [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names
  2025-07-14  5:41 [PATCH v7 0/4] Add support for gdsp remoteproc on sa8775p Ling Xu
  2025-07-14  5:41 ` [PATCH v7 1/4] dt-bindings: misc: qcom,fastrpc: Add GDSP label Ling Xu
  2025-07-14  5:41 ` [PATCH v7 2/4] arm64: dts: qcom: sa8775p: add GDSP fastrpc-compute-cb nodes Ling Xu
@ 2025-07-14  5:41 ` Ling Xu
  2025-07-14  9:51   ` Dmitry Baryshkov
  2025-07-16 19:28   ` Bjorn Andersson
  2025-07-14  5:41 ` [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc Ling Xu
  3 siblings, 2 replies; 12+ messages in thread
From: Ling Xu @ 2025-07-14  5:41 UTC (permalink / raw)
  To: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh
  Cc: quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm, dri-devel,
	linux-kernel, Ling Xu, Srinivas Kandagatla

Currently the domain ids are added for each instance of domains, this is
totally not scalable approach. Clean this mess and create domain ids for
only domains not its instances.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
---
 drivers/misc/fastrpc.c      | 50 ++++++++++++++++---------------------
 include/uapi/misc/fastrpc.h |  2 +-
 2 files changed, 22 insertions(+), 30 deletions(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 378923594f02..85b6eb16b616 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -27,8 +27,6 @@
 #define MDSP_DOMAIN_ID (1)
 #define SDSP_DOMAIN_ID (2)
 #define CDSP_DOMAIN_ID (3)
-#define CDSP1_DOMAIN_ID (4)
-#define FASTRPC_DEV_MAX		5 /* adsp, mdsp, slpi, cdsp, cdsp1 */
 #define FASTRPC_MAX_SESSIONS	14
 #define FASTRPC_MAX_VMIDS	16
 #define FASTRPC_ALIGN		128
@@ -106,8 +104,6 @@
 
 #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscdev)
 
-static const char *domains[FASTRPC_DEV_MAX] = { "adsp", "mdsp",
-						"sdsp", "cdsp", "cdsp1" };
 struct fastrpc_phy_page {
 	u64 addr;		/* physical address */
 	u64 size;		/* size of contiguous region */
@@ -1723,7 +1719,6 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,
 	uint32_t attribute_id = cap->attribute_id;
 	uint32_t *dsp_attributes;
 	unsigned long flags;
-	uint32_t domain = cap->domain;
 	int err;
 
 	spin_lock_irqsave(&cctx->lock, flags);
@@ -1741,7 +1736,7 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,
 	err = fastrpc_get_info_from_dsp(fl, dsp_attributes, FASTRPC_MAX_DSP_ATTRIBUTES);
 	if (err == DSP_UNSUPPORTED_API) {
 		dev_info(&cctx->rpdev->dev,
-			 "Warning: DSP capabilities not supported on domain: %d\n", domain);
+			 "Warning: DSP capabilities not supported\n");
 		kfree(dsp_attributes);
 		return -EOPNOTSUPP;
 	} else if (err) {
@@ -1769,17 +1764,6 @@ static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp)
 		return  -EFAULT;
 
 	cap.capability = 0;
-	if (cap.domain >= FASTRPC_DEV_MAX) {
-		dev_err(&fl->cctx->rpdev->dev, "Error: Invalid domain id:%d, err:%d\n",
-			cap.domain, err);
-		return -ECHRNG;
-	}
-
-	/* Fastrpc Capablities does not support modem domain */
-	if (cap.domain == MDSP_DOMAIN_ID) {
-		dev_err(&fl->cctx->rpdev->dev, "Error: modem not supported %d\n", err);
-		return -ECHRNG;
-	}
 
 	if (cap.attribute_id >= FASTRPC_MAX_DSP_ATTRIBUTES) {
 		dev_err(&fl->cctx->rpdev->dev, "Error: invalid attribute: %d, err: %d\n",
@@ -2255,6 +2239,20 @@ static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ct
 	return err;
 }
 
+static int fastrpc_get_domain_id(const char *domain)
+{
+	if (!strncmp(domain, "adsp", 4))
+		return ADSP_DOMAIN_ID;
+	else if (!strncmp(domain, "cdsp", 4))
+		return CDSP_DOMAIN_ID;
+	else if (!strncmp(domain, "mdsp", 4))
+		return MDSP_DOMAIN_ID;
+	else if (!strncmp(domain, "sdsp", 4))
+		return SDSP_DOMAIN_ID;
+
+	return -EINVAL;
+}
+
 static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 {
 	struct device *rdev = &rpdev->dev;
@@ -2272,15 +2270,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 		return err;
 	}
 
-	for (i = 0; i < FASTRPC_DEV_MAX; i++) {
-		if (!strcmp(domains[i], domain)) {
-			domain_id = i;
-			break;
-		}
-	}
+	domain_id = fastrpc_get_domain_id(domain);
 
 	if (domain_id < 0) {
-		dev_info(rdev, "FastRPC Invalid Domain ID %d\n", domain_id);
+		dev_info(rdev, "FastRPC Domain %s not supported\n", domain);
 		return -EINVAL;
 	}
 
@@ -2330,21 +2323,20 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 	case ADSP_DOMAIN_ID:
 	case MDSP_DOMAIN_ID:
 	case SDSP_DOMAIN_ID:
-		/* Unsigned PD offloading is only supported on CDSP and CDSP1 */
+		/* Unsigned PD offloading is only supported on CDSP */
 		data->unsigned_support = false;
-		err = fastrpc_device_register(rdev, data, secure_dsp, domains[domain_id]);
+		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
 		if (err)
 			goto err_free_data;
 		break;
 	case CDSP_DOMAIN_ID:
-	case CDSP1_DOMAIN_ID:
 		data->unsigned_support = true;
 		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
-		err = fastrpc_device_register(rdev, data, true, domains[domain_id]);
+		err = fastrpc_device_register(rdev, data, true, domain);
 		if (err)
 			goto err_free_data;
 
-		err = fastrpc_device_register(rdev, data, false, domains[domain_id]);
+		err = fastrpc_device_register(rdev, data, false, domain);
 		if (err)
 			goto err_deregister_fdev;
 		break;
diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h
index f33d914d8f46..c6e2925f47e6 100644
--- a/include/uapi/misc/fastrpc.h
+++ b/include/uapi/misc/fastrpc.h
@@ -134,7 +134,7 @@ struct fastrpc_mem_unmap {
 };
 
 struct fastrpc_ioctl_capability {
-	__u32 domain;
+	__u32 unused; /* deprecated, ignored by the kernel */
 	__u32 attribute_id;
 	__u32 capability;   /* dsp capability */
 	__u32 reserved[4];
-- 
2.34.1


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

* [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc
  2025-07-14  5:41 [PATCH v7 0/4] Add support for gdsp remoteproc on sa8775p Ling Xu
                   ` (2 preceding siblings ...)
  2025-07-14  5:41 ` [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names Ling Xu
@ 2025-07-14  5:41 ` Ling Xu
  2025-07-14  9:45   ` Dmitry Baryshkov
  2025-07-16 19:31   ` Bjorn Andersson
  3 siblings, 2 replies; 12+ messages in thread
From: Ling Xu @ 2025-07-14  5:41 UTC (permalink / raw)
  To: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh
  Cc: quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm, dri-devel,
	linux-kernel, Ling Xu

Some platforms (like sa8775p) feature one or more GPDSPs (General
Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide
a FastRPC implementation, allowing code execution in both signed and
unsigned protection domains. Extend the checks to allow domain names
starting with "gdsp" (possibly followed by an index).

Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
---
 drivers/misc/fastrpc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 85b6eb16b616..d05969de406e 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -27,6 +27,7 @@
 #define MDSP_DOMAIN_ID (1)
 #define SDSP_DOMAIN_ID (2)
 #define CDSP_DOMAIN_ID (3)
+#define GDSP_DOMAIN_ID (4)
 #define FASTRPC_MAX_SESSIONS	14
 #define FASTRPC_MAX_VMIDS	16
 #define FASTRPC_ALIGN		128
@@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
 		return MDSP_DOMAIN_ID;
 	else if (!strncmp(domain, "sdsp", 4))
 		return SDSP_DOMAIN_ID;
+	else if (!strncmp(domain, "gdsp", 4))
+		return GDSP_DOMAIN_ID;
 
 	return -EINVAL;
 }
@@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 	case ADSP_DOMAIN_ID:
 	case MDSP_DOMAIN_ID:
 	case SDSP_DOMAIN_ID:
-		/* Unsigned PD offloading is only supported on CDSP */
+		/* Unsigned PD offloading is only supported on CDSP and GDSP */
 		data->unsigned_support = false;
 		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
 		if (err)
 			goto err_free_data;
 		break;
 	case CDSP_DOMAIN_ID:
+	case GDSP_DOMAIN_ID:
 		data->unsigned_support = true;
 		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
 		err = fastrpc_device_register(rdev, data, true, domain);
-- 
2.34.1


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

* Re: [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc
  2025-07-14  5:41 ` [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc Ling Xu
@ 2025-07-14  9:45   ` Dmitry Baryshkov
  2025-07-16 19:31   ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2025-07-14  9:45 UTC (permalink / raw)
  To: Ling Xu
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel

On Mon, Jul 14, 2025 at 11:11:33AM +0530, Ling Xu wrote:
> Some platforms (like sa8775p) feature one or more GPDSPs (General
> Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide
> a FastRPC implementation, allowing code execution in both signed and
> unsigned protection domains. Extend the checks to allow domain names
> starting with "gdsp" (possibly followed by an index).
> 
> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
> ---
>  drivers/misc/fastrpc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names
  2025-07-14  5:41 ` [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names Ling Xu
@ 2025-07-14  9:51   ` Dmitry Baryshkov
  2025-07-16 19:28   ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2025-07-14  9:51 UTC (permalink / raw)
  To: Ling Xu
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, andersson, konradybcio,
	arnd, gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel, Srinivas Kandagatla

On Mon, Jul 14, 2025 at 11:11:32AM +0530, Ling Xu wrote:
> Currently the domain ids are added for each instance of domains, this is
> totally not scalable approach. Clean this mess and create domain ids for
> only domains not its instances.
> 
> Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
> ---
>  drivers/misc/fastrpc.c      | 50 ++++++++++++++++---------------------
>  include/uapi/misc/fastrpc.h |  2 +-
>  2 files changed, 22 insertions(+), 30 deletions(-)

Please separate uAPI+fastrpc_get_dsp_info() changes to a separate patch.

-- 
With best wishes
Dmitry

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

* Re: [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names
  2025-07-14  5:41 ` [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names Ling Xu
  2025-07-14  9:51   ` Dmitry Baryshkov
@ 2025-07-16 19:28   ` Bjorn Andersson
  2025-07-17  2:23     ` Ling Xu
  1 sibling, 1 reply; 12+ messages in thread
From: Bjorn Andersson @ 2025-07-16 19:28 UTC (permalink / raw)
  To: Ling Xu
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, konradybcio, arnd,
	gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel, Srinivas Kandagatla

On Mon, Jul 14, 2025 at 11:11:32AM +0530, Ling Xu wrote:
> Currently the domain ids are added for each instance of domains, this is
> totally not scalable approach.

This sentence only makes sense for people in your team or participants
of some recent meeting or (private) mail thread of yours. When providing
you problem description [1], do so in a way that it makes sense to
people outside that bubble - and yourself next month.

[1] https://docs.kernel.org/process/submitting-patches.html#describe-your-changes

> Clean this mess and create domain ids for
> only domains not its instances.
> 

Is the "mess" that the domain is part of the ioctl, or is the mess that
the names of the domains are defined in an array and you prefer them to
be listed out in code (fastrpc_get_domain_id())?

> Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
> ---
>  drivers/misc/fastrpc.c      | 50 ++++++++++++++++---------------------
>  include/uapi/misc/fastrpc.h |  2 +-
>  2 files changed, 22 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 378923594f02..85b6eb16b616 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -27,8 +27,6 @@
>  #define MDSP_DOMAIN_ID (1)
>  #define SDSP_DOMAIN_ID (2)
>  #define CDSP_DOMAIN_ID (3)
> -#define CDSP1_DOMAIN_ID (4)
> -#define FASTRPC_DEV_MAX		5 /* adsp, mdsp, slpi, cdsp, cdsp1 */
>  #define FASTRPC_MAX_SESSIONS	14
>  #define FASTRPC_MAX_VMIDS	16
>  #define FASTRPC_ALIGN		128
> @@ -106,8 +104,6 @@
>  
>  #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscdev)
>  
> -static const char *domains[FASTRPC_DEV_MAX] = { "adsp", "mdsp",
> -						"sdsp", "cdsp", "cdsp1" };
>  struct fastrpc_phy_page {
>  	u64 addr;		/* physical address */
>  	u64 size;		/* size of contiguous region */
> @@ -1723,7 +1719,6 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,
>  	uint32_t attribute_id = cap->attribute_id;
>  	uint32_t *dsp_attributes;
>  	unsigned long flags;
> -	uint32_t domain = cap->domain;
>  	int err;
>  
>  	spin_lock_irqsave(&cctx->lock, flags);
> @@ -1741,7 +1736,7 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,
>  	err = fastrpc_get_info_from_dsp(fl, dsp_attributes, FASTRPC_MAX_DSP_ATTRIBUTES);
>  	if (err == DSP_UNSUPPORTED_API) {
>  		dev_info(&cctx->rpdev->dev,
> -			 "Warning: DSP capabilities not supported on domain: %d\n", domain);
> +			 "Warning: DSP capabilities not supported\n");
>  		kfree(dsp_attributes);
>  		return -EOPNOTSUPP;
>  	} else if (err) {
> @@ -1769,17 +1764,6 @@ static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp)
>  		return  -EFAULT;
>  
>  	cap.capability = 0;
> -	if (cap.domain >= FASTRPC_DEV_MAX) {
> -		dev_err(&fl->cctx->rpdev->dev, "Error: Invalid domain id:%d, err:%d\n",
> -			cap.domain, err);
> -		return -ECHRNG;
> -	}
> -
> -	/* Fastrpc Capablities does not support modem domain */
> -	if (cap.domain == MDSP_DOMAIN_ID) {
> -		dev_err(&fl->cctx->rpdev->dev, "Error: modem not supported %d\n", err);
> -		return -ECHRNG;
> -	}
>  
>  	if (cap.attribute_id >= FASTRPC_MAX_DSP_ATTRIBUTES) {
>  		dev_err(&fl->cctx->rpdev->dev, "Error: invalid attribute: %d, err: %d\n",
> @@ -2255,6 +2239,20 @@ static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ct
>  	return err;
>  }
>  
> +static int fastrpc_get_domain_id(const char *domain)
> +{
> +	if (!strncmp(domain, "adsp", 4))
> +		return ADSP_DOMAIN_ID;
> +	else if (!strncmp(domain, "cdsp", 4))
> +		return CDSP_DOMAIN_ID;
> +	else if (!strncmp(domain, "mdsp", 4))
> +		return MDSP_DOMAIN_ID;
> +	else if (!strncmp(domain, "sdsp", 4))
> +		return SDSP_DOMAIN_ID;
> +

The removed code performs a string compare and you replace this with a
string prefix compare, but there's no motivation given to why this is
done.

I'm also wondering why cdsp1 is now in CDSP_DOMAIN_ID, is that
intentional? Was it wrong before? If so, that change should be done
alone and with a Fixes: 

Regards,
Bjorn

> +	return -EINVAL;
> +}
> +
>  static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>  {
>  	struct device *rdev = &rpdev->dev;
> @@ -2272,15 +2270,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>  		return err;
>  	}
>  
> -	for (i = 0; i < FASTRPC_DEV_MAX; i++) {
> -		if (!strcmp(domains[i], domain)) {
> -			domain_id = i;
> -			break;
> -		}
> -	}
> +	domain_id = fastrpc_get_domain_id(domain);
>  
>  	if (domain_id < 0) {
> -		dev_info(rdev, "FastRPC Invalid Domain ID %d\n", domain_id);
> +		dev_info(rdev, "FastRPC Domain %s not supported\n", domain);
>  		return -EINVAL;
>  	}
>  
> @@ -2330,21 +2323,20 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>  	case ADSP_DOMAIN_ID:
>  	case MDSP_DOMAIN_ID:
>  	case SDSP_DOMAIN_ID:
> -		/* Unsigned PD offloading is only supported on CDSP and CDSP1 */
> +		/* Unsigned PD offloading is only supported on CDSP */
>  		data->unsigned_support = false;
> -		err = fastrpc_device_register(rdev, data, secure_dsp, domains[domain_id]);
> +		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>  		if (err)
>  			goto err_free_data;
>  		break;
>  	case CDSP_DOMAIN_ID:
> -	case CDSP1_DOMAIN_ID:
>  		data->unsigned_support = true;
>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
> -		err = fastrpc_device_register(rdev, data, true, domains[domain_id]);
> +		err = fastrpc_device_register(rdev, data, true, domain);
>  		if (err)
>  			goto err_free_data;
>  
> -		err = fastrpc_device_register(rdev, data, false, domains[domain_id]);
> +		err = fastrpc_device_register(rdev, data, false, domain);
>  		if (err)
>  			goto err_deregister_fdev;
>  		break;
> diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h
> index f33d914d8f46..c6e2925f47e6 100644
> --- a/include/uapi/misc/fastrpc.h
> +++ b/include/uapi/misc/fastrpc.h
> @@ -134,7 +134,7 @@ struct fastrpc_mem_unmap {
>  };
>  
>  struct fastrpc_ioctl_capability {
> -	__u32 domain;
> +	__u32 unused; /* deprecated, ignored by the kernel */
>  	__u32 attribute_id;
>  	__u32 capability;   /* dsp capability */
>  	__u32 reserved[4];
> -- 
> 2.34.1
> 

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

* Re: [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc
  2025-07-14  5:41 ` [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc Ling Xu
  2025-07-14  9:45   ` Dmitry Baryshkov
@ 2025-07-16 19:31   ` Bjorn Andersson
  2025-07-17  2:28     ` Ling Xu
  1 sibling, 1 reply; 12+ messages in thread
From: Bjorn Andersson @ 2025-07-16 19:31 UTC (permalink / raw)
  To: Ling Xu
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, konradybcio, arnd,
	gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel

On Mon, Jul 14, 2025 at 11:11:33AM +0530, Ling Xu wrote:
> Some platforms (like sa8775p) feature one or more GPDSPs (General
> Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide
> a FastRPC implementation, allowing code execution in both signed and
> unsigned protection domains. Extend the checks to allow domain names
> starting with "gdsp" (possibly followed by an index).
> 

This was called cdsp1 before patch 3 where you removed it and now the
same id is introduced but this time with the name GDSP.

Iirc there was a cdsp1 in SA8295P/SA8540P, are you silently dropping
support for that here? Or perhaps just renaming it?

Regards,
Bjorn

> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
> ---
>  drivers/misc/fastrpc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 85b6eb16b616..d05969de406e 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -27,6 +27,7 @@
>  #define MDSP_DOMAIN_ID (1)
>  #define SDSP_DOMAIN_ID (2)
>  #define CDSP_DOMAIN_ID (3)
> +#define GDSP_DOMAIN_ID (4)
>  #define FASTRPC_MAX_SESSIONS	14
>  #define FASTRPC_MAX_VMIDS	16
>  #define FASTRPC_ALIGN		128
> @@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
>  		return MDSP_DOMAIN_ID;
>  	else if (!strncmp(domain, "sdsp", 4))
>  		return SDSP_DOMAIN_ID;
> +	else if (!strncmp(domain, "gdsp", 4))
> +		return GDSP_DOMAIN_ID;
>  
>  	return -EINVAL;
>  }
> @@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>  	case ADSP_DOMAIN_ID:
>  	case MDSP_DOMAIN_ID:
>  	case SDSP_DOMAIN_ID:
> -		/* Unsigned PD offloading is only supported on CDSP */
> +		/* Unsigned PD offloading is only supported on CDSP and GDSP */
>  		data->unsigned_support = false;
>  		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>  		if (err)
>  			goto err_free_data;
>  		break;
>  	case CDSP_DOMAIN_ID:
> +	case GDSP_DOMAIN_ID:
>  		data->unsigned_support = true;
>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
>  		err = fastrpc_device_register(rdev, data, true, domain);
> -- 
> 2.34.1
> 

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

* Re: [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names
  2025-07-16 19:28   ` Bjorn Andersson
@ 2025-07-17  2:23     ` Ling Xu
  0 siblings, 0 replies; 12+ messages in thread
From: Ling Xu @ 2025-07-17  2:23 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, konradybcio, arnd,
	gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel, Srinivas Kandagatla

在 7/17/2025 3:28 AM, Bjorn Andersson 写道:
> On Mon, Jul 14, 2025 at 11:11:32AM +0530, Ling Xu wrote:
>> Currently the domain ids are added for each instance of domains, this is
>> totally not scalable approach.
> 
> This sentence only makes sense for people in your team or participants
> of some recent meeting or (private) mail thread of yours. When providing
> you problem description [1], do so in a way that it makes sense to
> people outside that bubble - and yourself next month.
> 
> [1] https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
> 
>> Clean this mess and create domain ids for
>> only domains not its instances.
>>
> 
> Is the "mess" that the domain is part of the ioctl, or is the mess that
> the names of the domains are defined in an array and you prefer them to
> be listed out in code (fastrpc_get_domain_id())?
I already split this to 2 changes in latest patch, mess means we created domain ids
for its instances.
> 
>> Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
>> ---
>>  drivers/misc/fastrpc.c      | 50 ++++++++++++++++---------------------
>>  include/uapi/misc/fastrpc.h |  2 +-
>>  2 files changed, 22 insertions(+), 30 deletions(-)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index 378923594f02..85b6eb16b616 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -27,8 +27,6 @@
>>  #define MDSP_DOMAIN_ID (1)
>>  #define SDSP_DOMAIN_ID (2)
>>  #define CDSP_DOMAIN_ID (3)
>> -#define CDSP1_DOMAIN_ID (4)
>> -#define FASTRPC_DEV_MAX		5 /* adsp, mdsp, slpi, cdsp, cdsp1 */
>>  #define FASTRPC_MAX_SESSIONS	14
>>  #define FASTRPC_MAX_VMIDS	16
>>  #define FASTRPC_ALIGN		128
>> @@ -106,8 +104,6 @@
>>  
>>  #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscdev)
>>  
>> -static const char *domains[FASTRPC_DEV_MAX] = { "adsp", "mdsp",
>> -						"sdsp", "cdsp", "cdsp1" };
>>  struct fastrpc_phy_page {
>>  	u64 addr;		/* physical address */
>>  	u64 size;		/* size of contiguous region */
>> @@ -1723,7 +1719,6 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,
>>  	uint32_t attribute_id = cap->attribute_id;
>>  	uint32_t *dsp_attributes;
>>  	unsigned long flags;
>> -	uint32_t domain = cap->domain;
>>  	int err;
>>  
>>  	spin_lock_irqsave(&cctx->lock, flags);
>> @@ -1741,7 +1736,7 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,
>>  	err = fastrpc_get_info_from_dsp(fl, dsp_attributes, FASTRPC_MAX_DSP_ATTRIBUTES);
>>  	if (err == DSP_UNSUPPORTED_API) {
>>  		dev_info(&cctx->rpdev->dev,
>> -			 "Warning: DSP capabilities not supported on domain: %d\n", domain);
>> +			 "Warning: DSP capabilities not supported\n");
>>  		kfree(dsp_attributes);
>>  		return -EOPNOTSUPP;
>>  	} else if (err) {
>> @@ -1769,17 +1764,6 @@ static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp)
>>  		return  -EFAULT;
>>  
>>  	cap.capability = 0;
>> -	if (cap.domain >= FASTRPC_DEV_MAX) {
>> -		dev_err(&fl->cctx->rpdev->dev, "Error: Invalid domain id:%d, err:%d\n",
>> -			cap.domain, err);
>> -		return -ECHRNG;
>> -	}
>> -
>> -	/* Fastrpc Capablities does not support modem domain */
>> -	if (cap.domain == MDSP_DOMAIN_ID) {
>> -		dev_err(&fl->cctx->rpdev->dev, "Error: modem not supported %d\n", err);
>> -		return -ECHRNG;
>> -	}
>>  
>>  	if (cap.attribute_id >= FASTRPC_MAX_DSP_ATTRIBUTES) {
>>  		dev_err(&fl->cctx->rpdev->dev, "Error: invalid attribute: %d, err: %d\n",
>> @@ -2255,6 +2239,20 @@ static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ct
>>  	return err;
>>  }
>>  
>> +static int fastrpc_get_domain_id(const char *domain)
>> +{
>> +	if (!strncmp(domain, "adsp", 4))
>> +		return ADSP_DOMAIN_ID;
>> +	else if (!strncmp(domain, "cdsp", 4))
>> +		return CDSP_DOMAIN_ID;
>> +	else if (!strncmp(domain, "mdsp", 4))
>> +		return MDSP_DOMAIN_ID;
>> +	else if (!strncmp(domain, "sdsp", 4))
>> +		return SDSP_DOMAIN_ID;
>> +
> 
> The removed code performs a string compare and you replace this with a
> string prefix compare, but there's no motivation given to why this is
> done.
> 
> I'm also wondering why cdsp1 is now in CDSP_DOMAIN_ID, is that
> intentional? Was it wrong before? If so, that change should be done
> alone and with a Fixes: 
> 
cdsp1 use cdsp0 daemon, they are two instances but one domain.
In kernel, we just care about the domains. we just give a scalable 
approach without adding instances for any new dsp every time.
> Regards,
> Bjorn
> 
>> +	return -EINVAL;
>> +}
>> +
>>  static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>>  {
>>  	struct device *rdev = &rpdev->dev;
>> @@ -2272,15 +2270,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>>  		return err;
>>  	}
>>  
>> -	for (i = 0; i < FASTRPC_DEV_MAX; i++) {
>> -		if (!strcmp(domains[i], domain)) {
>> -			domain_id = i;
>> -			break;
>> -		}
>> -	}
>> +	domain_id = fastrpc_get_domain_id(domain);
>>  
>>  	if (domain_id < 0) {
>> -		dev_info(rdev, "FastRPC Invalid Domain ID %d\n", domain_id);
>> +		dev_info(rdev, "FastRPC Domain %s not supported\n", domain);
>>  		return -EINVAL;
>>  	}
>>  
>> @@ -2330,21 +2323,20 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>>  	case ADSP_DOMAIN_ID:
>>  	case MDSP_DOMAIN_ID:
>>  	case SDSP_DOMAIN_ID:
>> -		/* Unsigned PD offloading is only supported on CDSP and CDSP1 */
>> +		/* Unsigned PD offloading is only supported on CDSP */
>>  		data->unsigned_support = false;
>> -		err = fastrpc_device_register(rdev, data, secure_dsp, domains[domain_id]);
>> +		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>>  		if (err)
>>  			goto err_free_data;
>>  		break;
>>  	case CDSP_DOMAIN_ID:
>> -	case CDSP1_DOMAIN_ID:
>>  		data->unsigned_support = true;
>>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
>> -		err = fastrpc_device_register(rdev, data, true, domains[domain_id]);
>> +		err = fastrpc_device_register(rdev, data, true, domain);
>>  		if (err)
>>  			goto err_free_data;
>>  
>> -		err = fastrpc_device_register(rdev, data, false, domains[domain_id]);
>> +		err = fastrpc_device_register(rdev, data, false, domain);
>>  		if (err)
>>  			goto err_deregister_fdev;
>>  		break;
>> diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h
>> index f33d914d8f46..c6e2925f47e6 100644
>> --- a/include/uapi/misc/fastrpc.h
>> +++ b/include/uapi/misc/fastrpc.h
>> @@ -134,7 +134,7 @@ struct fastrpc_mem_unmap {
>>  };
>>  
>>  struct fastrpc_ioctl_capability {
>> -	__u32 domain;
>> +	__u32 unused; /* deprecated, ignored by the kernel */
>>  	__u32 attribute_id;
>>  	__u32 capability;   /* dsp capability */
>>  	__u32 reserved[4];
>> -- 
>> 2.34.1
>>

-- 
Thx and BRs,
Ling Xu


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

* Re: [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc
  2025-07-16 19:31   ` Bjorn Andersson
@ 2025-07-17  2:28     ` Ling Xu
  2025-07-17 15:18       ` Bjorn Andersson
  0 siblings, 1 reply; 12+ messages in thread
From: Ling Xu @ 2025-07-17  2:28 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, konradybcio, arnd,
	gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel

在 7/17/2025 3:31 AM, Bjorn Andersson 写道:
> On Mon, Jul 14, 2025 at 11:11:33AM +0530, Ling Xu wrote:
>> Some platforms (like sa8775p) feature one or more GPDSPs (General
>> Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide
>> a FastRPC implementation, allowing code execution in both signed and
>> unsigned protection domains. Extend the checks to allow domain names
>> starting with "gdsp" (possibly followed by an index).
>>
> 
> This was called cdsp1 before patch 3 where you removed it and now the
> same id is introduced but this time with the name GDSP.
> 
> Iirc there was a cdsp1 in SA8295P/SA8540P, are you silently dropping
> support for that here? Or perhaps just renaming it?
> 
Cdsp1 support is still there. It's instance of cdsp domain, so we merged it
in cdsp logic.

else if (!strncmp(domain, "cdsp", 4))
	return CDSP_DOMAIN_ID;

In fastrpc_get_domain_id, it return CDSP_DOMAIN_ID for cdsp1 because they use
same deamon.
> Regards,
> Bjorn
> 
>> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
>> ---
>>  drivers/misc/fastrpc.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index 85b6eb16b616..d05969de406e 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -27,6 +27,7 @@
>>  #define MDSP_DOMAIN_ID (1)
>>  #define SDSP_DOMAIN_ID (2)
>>  #define CDSP_DOMAIN_ID (3)
>> +#define GDSP_DOMAIN_ID (4)
>>  #define FASTRPC_MAX_SESSIONS	14
>>  #define FASTRPC_MAX_VMIDS	16
>>  #define FASTRPC_ALIGN		128
>> @@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
>>  		return MDSP_DOMAIN_ID;
>>  	else if (!strncmp(domain, "sdsp", 4))
>>  		return SDSP_DOMAIN_ID;
>> +	else if (!strncmp(domain, "gdsp", 4))
>> +		return GDSP_DOMAIN_ID;
>>  
>>  	return -EINVAL;
>>  }
>> @@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>>  	case ADSP_DOMAIN_ID:
>>  	case MDSP_DOMAIN_ID:
>>  	case SDSP_DOMAIN_ID:
>> -		/* Unsigned PD offloading is only supported on CDSP */
>> +		/* Unsigned PD offloading is only supported on CDSP and GDSP */
>>  		data->unsigned_support = false;
>>  		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>>  		if (err)
>>  			goto err_free_data;
>>  		break;
>>  	case CDSP_DOMAIN_ID:
>> +	case GDSP_DOMAIN_ID:
>>  		data->unsigned_support = true;
>>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
>>  		err = fastrpc_device_register(rdev, data, true, domain);
>> -- 
>> 2.34.1
>>

-- 
Thx and BRs,
Ling Xu


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

* Re: [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc
  2025-07-17  2:28     ` Ling Xu
@ 2025-07-17 15:18       ` Bjorn Andersson
  0 siblings, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2025-07-17 15:18 UTC (permalink / raw)
  To: Ling Xu
  Cc: srini, amahesh, robh, krzk+dt, conor+dt, konradybcio, arnd,
	gregkh, quic_kuiw, ekansh.gupta, devicetree, linux-arm-msm,
	dri-devel, linux-kernel

On Thu, Jul 17, 2025 at 10:28:44AM +0800, Ling Xu wrote:
> 在 7/17/2025 3:31 AM, Bjorn Andersson 写道:
> > On Mon, Jul 14, 2025 at 11:11:33AM +0530, Ling Xu wrote:
> >> Some platforms (like sa8775p) feature one or more GPDSPs (General
> >> Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide
> >> a FastRPC implementation, allowing code execution in both signed and
> >> unsigned protection domains. Extend the checks to allow domain names
> >> starting with "gdsp" (possibly followed by an index).
> >>
> > 
> > This was called cdsp1 before patch 3 where you removed it and now the
> > same id is introduced but this time with the name GDSP.
> > 
> > Iirc there was a cdsp1 in SA8295P/SA8540P, are you silently dropping
> > support for that here? Or perhaps just renaming it?
> > 
> Cdsp1 support is still there. It's instance of cdsp domain, so we merged it
> in cdsp logic.
> 

But doesn't that mean that

  #define CDSP1_DOMAIN_ID (4)

was wrong? It should have been using the 3?

Isn't that a bugfix? If so there should be one patch fixing that.

Perhaps I'm misunderstanding the relevance of these numbers though.

Regards,
Bjorn

> else if (!strncmp(domain, "cdsp", 4))
> 	return CDSP_DOMAIN_ID;
> 
> In fastrpc_get_domain_id, it return CDSP_DOMAIN_ID for cdsp1 because they use
> same deamon.
> > Regards,
> > Bjorn
> > 
> >> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
> >> ---
> >>  drivers/misc/fastrpc.c | 6 +++++-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> >> index 85b6eb16b616..d05969de406e 100644
> >> --- a/drivers/misc/fastrpc.c
> >> +++ b/drivers/misc/fastrpc.c
> >> @@ -27,6 +27,7 @@
> >>  #define MDSP_DOMAIN_ID (1)
> >>  #define SDSP_DOMAIN_ID (2)
> >>  #define CDSP_DOMAIN_ID (3)
> >> +#define GDSP_DOMAIN_ID (4)
> >>  #define FASTRPC_MAX_SESSIONS	14
> >>  #define FASTRPC_MAX_VMIDS	16
> >>  #define FASTRPC_ALIGN		128
> >> @@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
> >>  		return MDSP_DOMAIN_ID;
> >>  	else if (!strncmp(domain, "sdsp", 4))
> >>  		return SDSP_DOMAIN_ID;
> >> +	else if (!strncmp(domain, "gdsp", 4))
> >> +		return GDSP_DOMAIN_ID;
> >>  
> >>  	return -EINVAL;
> >>  }
> >> @@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
> >>  	case ADSP_DOMAIN_ID:
> >>  	case MDSP_DOMAIN_ID:
> >>  	case SDSP_DOMAIN_ID:
> >> -		/* Unsigned PD offloading is only supported on CDSP */
> >> +		/* Unsigned PD offloading is only supported on CDSP and GDSP */
> >>  		data->unsigned_support = false;
> >>  		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
> >>  		if (err)
> >>  			goto err_free_data;
> >>  		break;
> >>  	case CDSP_DOMAIN_ID:
> >> +	case GDSP_DOMAIN_ID:
> >>  		data->unsigned_support = true;
> >>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
> >>  		err = fastrpc_device_register(rdev, data, true, domain);
> >> -- 
> >> 2.34.1
> >>
> 
> -- 
> Thx and BRs,
> Ling Xu
> 

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

end of thread, other threads:[~2025-07-17 15:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14  5:41 [PATCH v7 0/4] Add support for gdsp remoteproc on sa8775p Ling Xu
2025-07-14  5:41 ` [PATCH v7 1/4] dt-bindings: misc: qcom,fastrpc: Add GDSP label Ling Xu
2025-07-14  5:41 ` [PATCH v7 2/4] arm64: dts: qcom: sa8775p: add GDSP fastrpc-compute-cb nodes Ling Xu
2025-07-14  5:41 ` [PATCH v7 3/4] misc: fastrpc: Cleanup the domain names Ling Xu
2025-07-14  9:51   ` Dmitry Baryshkov
2025-07-16 19:28   ` Bjorn Andersson
2025-07-17  2:23     ` Ling Xu
2025-07-14  5:41 ` [PATCH v7 4/4] misc: fastrpc: add support for gdsp remoteproc Ling Xu
2025-07-14  9:45   ` Dmitry Baryshkov
2025-07-16 19:31   ` Bjorn Andersson
2025-07-17  2:28     ` Ling Xu
2025-07-17 15:18       ` Bjorn Andersson

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