From nobody Thu Oct 2 18:15:52 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6DC430DECF for ; Fri, 12 Sep 2025 13:13:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682795; cv=none; b=MzNvtn0bY+ZT5OsvLwrY+DLnb/2zaxil+bokcYqF9FFmha8gOyT7bOJJQwABkfn4BZCqp38ErLelHSuLuHsONebXmK9lcV8cthgyMlrAX2GKWqBCD7viFDiensDpWs6QdxmXv2iY3hCyCIKPgK4KBlsqyGZdNZ+m9yhzm4NiMkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682795; c=relaxed/simple; bh=zDxzy6kp4ylEzSSnp4BJo+hrkNtna5+yUe6Yeev5icU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qYvRyO0CWf1FUCTmYm1iONmx28Mn12FNyVn7ATPkM6qUvGvwWCQ7RPa4fFzVqvz+pKrrR6JWYn5KVV+sJFEQvJDZpgvAyN0VFQaiaXcsd9c/TeymgGsW+JhTFd/Li0juEUQcYU3UGKiLo8E6Vkpc7H2tMpCcMhZZEnHVVKPnr3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l7dxhjpr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l7dxhjpr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E498C4CEF7; Fri, 12 Sep 2025 13:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757682795; bh=zDxzy6kp4ylEzSSnp4BJo+hrkNtna5+yUe6Yeev5icU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l7dxhjprLVqy14SY2I2X/bZy001rYno8uv7HccEI2XdfKseTTmC6n6CDA+pmPF8n3 j2VLjZMZ3xfI3oBtez56Al+PFYoGmyhh+QxqV0C3JvkY4B9xIn7IykM88nSIbRj2ad 2MD0+VZXH9wVsqtt1vVYTwb0I/YlXHo8JiRrInuDqle6ULpvlFiGoavqTatyIhG1XJ jGO1rv2NDLtHsYJVH2+e9mug/S9Sg5ac2eXBFae8ZE0v0dch9TCi412+AGttyCtJJc CWYqex8m7Q0DiVf9Ha8IiI1MDBO6A/NZjt132jnDqOmdel/EiRKSt47MKWp/iJMbwF GANeUcL+Oib/Q== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ling Xu , Krzysztof Kozlowski , Ekansh Gupta , Srinivas Kandagatla Subject: [PATCH 1/4] dt-bindings: misc: qcom,fastrpc: Add GDSP label Date: Fri, 12 Sep 2025 14:12:59 +0100 Message-ID: <20250912131302.303199-2-srini@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250912131302.303199-1-srini@kernel.org> References: <20250912131302.303199-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ling Xu 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 Reviewed-by: Ekansh Gupta Signed-off-by: Ling Xu Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml b/Doc= umentation/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 =20 memory-region: maxItems: 1 --=20 2.50.0 From nobody Thu Oct 2 18:15:52 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BD9630E84F for ; Fri, 12 Sep 2025 13:13:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682797; cv=none; b=YcXwx/W4lZXLPGzqwMG1MaXFF0tsclI4Z/5U3DJVK6mmD4JT5OkSD7jJTWinYHR9UVYQJlFT3mVhU7hADkO1O4s9a7RGDX6d16NA9cE2s1hvsjWb4InPmEw5rzj5p4Cw2KPqZ44HrOraggDoDEF8esx5SbBKPxX6aMlKPCffcBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682797; c=relaxed/simple; bh=Vem+mD7YnvII4WUoWkOsIWojVllp/ghNcYZB9qlvTLQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TdtiQPx1lZSdR1I+QJm3WJJBACo+/wKH9Q8kFiuBACOhVdUwN/4m+GozgLxWLYvcahO4AVdGquWsj9l/2v9UtZ0kFOtI2i6dA83XGP1IW0ruLuTbxMGRnXeAjD1PDVcwARaoXTEZEk2tLLnCQb2g0JbmjEXat5a9+yX+/ZtfKww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EDITvuyV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EDITvuyV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C976BC4CEF9; Fri, 12 Sep 2025 13:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757682797; bh=Vem+mD7YnvII4WUoWkOsIWojVllp/ghNcYZB9qlvTLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EDITvuyVWmvwzKJFj2L1dg7jOGHOuSn9pJOw2JnP6XLPIHi/Sq28wkzPEZQd4YXyd jgzYdYuJtpabDD0Bzf1gKtlJPgQ+6H8/PnjSqkiy80CMYJp9wG0QvfE0VAKNLiDV4m slnbOdfn+80r2D/Xp1+iun97NacnqCTyTajwxjE3BmYdc3oT3OhMNCv4Pq8i3BBvp1 qdMV67joWrzuZhsf3J5RoAcye2kAaIp2CBMHv8LDE7po8sBbSF8S6xQCB9gluTqg9s pouN93YZPbzX+AKUCWTd0kYxbw65MlFa/WsA7TfwMe6fMBW3xQBt+5TG1rXnITw174 3PLKy6Zyi6TNA== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ling Xu , Dmitry Baryshkov , Ekansh Gupta , Srinivas Kandagatla Subject: [PATCH 2/4] misc: fastrpc: Remove kernel-side domain checks from capability ioctl Date: Fri, 12 Sep 2025 14:13:00 +0100 Message-ID: <20250912131302.303199-3-srini@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250912131302.303199-1-srini@kernel.org> References: <20250912131302.303199-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ling Xu Domain ID in the uAPI is misleading. Remove checks and log messages related to 'domain' field in capability structure. Update UAPI to mark the field as unused. Reviewed-by: Dmitry Baryshkov Reviewed-by: Ekansh Gupta Signed-off-by: Ling Xu Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 14 +------------- include/uapi/misc/fastrpc.h | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 7eec907ed454..1dc69d234996 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1750,7 +1750,6 @@ static int fastrpc_get_info_from_kernel(struct fastrp= c_ioctl_capability *cap, uint32_t attribute_id =3D cap->attribute_id; uint32_t *dsp_attributes; unsigned long flags; - uint32_t domain =3D cap->domain; int err; =20 spin_lock_irqsave(&cctx->lock, flags); @@ -1768,7 +1767,7 @@ static int fastrpc_get_info_from_kernel(struct fastrp= c_ioctl_capability *cap, err =3D fastrpc_get_info_from_dsp(fl, dsp_attributes, FASTRPC_MAX_DSP_ATT= RIBUTES); if (err =3D=3D 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) { @@ -1796,17 +1795,6 @@ static int fastrpc_get_dsp_info(struct fastrpc_user = *fl, char __user *argp) return -EFAULT; =20 cap.capability =3D 0; - if (cap.domain >=3D 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 =3D=3D MDSP_DOMAIN_ID) { - dev_err(&fl->cctx->rpdev->dev, "Error: modem not supported %d\n", err); - return -ECHRNG; - } =20 if (cap.attribute_id >=3D FASTRPC_MAX_DSP_ATTRIBUTES) { dev_err(&fl->cctx->rpdev->dev, "Error: invalid attribute: %d, err: %d\n", 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 { }; =20 struct fastrpc_ioctl_capability { - __u32 domain; + __u32 unused; /* deprecated, ignored by the kernel */ __u32 attribute_id; __u32 capability; /* dsp capability */ __u32 reserved[4]; --=20 2.50.0 From nobody Thu Oct 2 18:15:52 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5C6030F529 for ; Fri, 12 Sep 2025 13:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682798; cv=none; b=aJVVL06j4gJhUnR7pZva0Lzgkr/txVK0xWCORfjpC8B/ZC9qxBduP6dRYAu0il2SCRnsEifPTO4/qVldPknQr+iV7jdClu0Rm9mJbzR/5BJYmIsESXgV4oczqZX7+FeH0CQk9mbUleZWlkxpGQo2B6xA6wLeWcnO1bgt/GJtMQA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682798; c=relaxed/simple; bh=RWcZD9xAE7KcutgA/HLhkTOkAiPLVusWcV5umMhzW+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YkGOt/NEuo9wjS3JbeGMJLNN6cYXZozUJHYJ7YVQ3dvOYJ9gT/RjjCmnUi1MMPgtbXYZ8qxkt7TT9YGUeYNwUwFsxHuKceFnTVp9F8r0XDFFBKdDSbQ+lqSj+I9eFUdh644TiSbvOuDbnDe1ySOJoBpWMSq0E6Zd0b7/ZtQESuc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EKmaSm4T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EKmaSm4T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 600C5C4CEF1; Fri, 12 Sep 2025 13:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757682798; bh=RWcZD9xAE7KcutgA/HLhkTOkAiPLVusWcV5umMhzW+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EKmaSm4TC14fSBBWlnd6qYTXySZ1IK7M3Kvb2t2/ibWFbLCyJqw2Hn0bZ2ca9TEvO PudERgS92Covz9Hg1FqMW2Ui7fOhGR1T5jVjCCVk30PTpKlLKatZosizpDhhwrAFtH //VtagUUuXoqVSfZTLyQ1JF+hLsWz8AOrzFp3o0+gRt/sY9W/v7VXcYmZQPsLx8uV7 MeLFzXZK7J/S5y6P6sO7xVT/QElO7Pwf5pl9BuikNXqkUnSuIPCUKBa3aBw2P2Pwom eBVtrdbgOikLYnHIfc6BHivKezzqKnyGhMWL7UfJQhlQkJR0GANhFAz9XVqTXOpN/J uhGzywRgXBWiA== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ling Xu , Srinivas Kandagatla , Dmitry Baryshkov , Ekansh Gupta , Srinivas Kandagatla Subject: [PATCH 3/4] misc: fastrpc: Cleanup the domain names Date: Fri, 12 Sep 2025 14:13:01 +0100 Message-ID: <20250912131302.303199-4-srini@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250912131302.303199-1-srini@kernel.org> References: <20250912131302.303199-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ling Xu 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 Signed-off-by: Srinivas Kandagatla Reviewed-by: Dmitry Baryshkov Reviewed-by: Ekansh Gupta Signed-off-by: Ling Xu Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 1dc69d234996..93ec587fcab6 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 @@ =20 #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscd= ev) =20 -static const char *domains[FASTRPC_DEV_MAX] =3D { "adsp", "mdsp", - "sdsp", "cdsp", "cdsp1" }; struct fastrpc_phy_page { u64 addr; /* physical address */ u64 size; /* size of contiguous region */ @@ -2270,6 +2266,20 @@ static int fastrpc_device_register(struct device *de= v, struct fastrpc_channel_ct return err; } =20 +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 =3D &rpdev->dev; @@ -2285,15 +2295,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device = *rpdev) return err; } =20 - for (i =3D 0; i < FASTRPC_DEV_MAX; i++) { - if (!strcmp(domains[i], domain)) { - domain_id =3D i; - break; - } - } + domain_id =3D fastrpc_get_domain_id(domain); =20 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; } =20 @@ -2340,21 +2345,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 =3D false; - err =3D fastrpc_device_register(rdev, data, secure_dsp, domains[domain_i= d]); + err =3D 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 =3D true; /* Create both device nodes so that we can allow both Signed and Unsigne= d PD */ - err =3D fastrpc_device_register(rdev, data, true, domains[domain_id]); + err =3D fastrpc_device_register(rdev, data, true, domain); if (err) goto err_free_data; =20 - err =3D fastrpc_device_register(rdev, data, false, domains[domain_id]); + err =3D fastrpc_device_register(rdev, data, false, domain); if (err) goto err_deregister_fdev; break; --=20 2.50.0 From nobody Thu Oct 2 18:15:52 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EDBB31158A for ; Fri, 12 Sep 2025 13:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682800; cv=none; b=OMOpJC0hFr279WvGH4PNuW+AGyabfHK7lbjuz1eGz4oTAaIvyDqOswH2Q0JnxK97OD9QfUB5JJhGwFliAwDbJAvPEouLnaUclRtAtHJKDdw8RXcHd741kUcFkziItijO1JY/k4/XYxlMmKsRk8GYM9QqrPr0U+eB0TKkWZx6tEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757682800; c=relaxed/simple; bh=z2okbvpEzQfU4OrKuk32NxS1oROubzvEwtkcZHLDBY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CIog8L//MzaY2Rj8OcG/BT0/W4TYbbMu4Guk7MPUONGTgiqWAYiyYVtmPPySvlP/79XfVKSiup8t0V84rod2Dpz/m87j33FXP8TtJ6yDZW0WcBC+Lxv8sObasckTRMCH0RzHeoLbnzbMlbZE2mBO54NPmOEn+92NXP/BN33fr4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l8yFwPgT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l8yFwPgT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A39CC4CEF1; Fri, 12 Sep 2025 13:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757682800; bh=z2okbvpEzQfU4OrKuk32NxS1oROubzvEwtkcZHLDBY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l8yFwPgTIanqhAB78A0RJrxHZ/ZDhTwr1HNnckcL16zlVmMeKo0L0p3KFOEuLXlwZ QkZ4EFTamh1qtp/YfbjRexkX35qiqhb9FvrxjXONE+RqzqN8v+vOzbbvJo9yiWdLgZ xMKXm7RuWe5YivvtPXMM3zqDt0pcqt+jj7UV7Hn0jzX8oyZtLqiwcUNcVloe6qWr2h RXG4/q3n0i/6iJL8yJIudq6HDjJqsEt7v8RAQwNCs/atOt5xDvnAELxtR1iHOs0nDv StvDVVlrIimi2XeA9J3PgoGkYownHrCG9gIjsLJGueiS5PJs1kcxwwUhIY7hrz/hxQ Kj8lW1ZL29aFg== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ling Xu , Dmitry Baryshkov , Ekansh Gupta , Srinivas Kandagatla Subject: [PATCH 4/4] misc: fastrpc: add support for gdsp remoteproc Date: Fri, 12 Sep 2025 14:13:02 +0100 Message-ID: <20250912131302.303199-5-srini@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250912131302.303199-1-srini@kernel.org> References: <20250912131302.303199-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ling Xu Some platforms (like lemans) 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). Reviewed-by: Dmitry Baryshkov Reviewed-by: Ekansh Gupta Signed-off-by: Ling Xu Signed-off-by: Srinivas Kandagatla --- 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 93ec587fcab6..621bce7e101c 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 @@ -2276,6 +2277,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; =20 return -EINVAL; } @@ -2345,13 +2348,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 =3D false; err =3D 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 =3D true; /* Create both device nodes so that we can allow both Signed and Unsigne= d PD */ err =3D fastrpc_device_register(rdev, data, true, domain); --=20 2.50.0