From: Srinivas Kandagatla <srini@kernel.org>
To: Jingyi Wang <jingyi.wang@oss.qualcomm.com>,
Srinivas Kandagatla <srini@kernel.org>,
Amol Maheshwari <amahesh@qti.qualcomm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: aiqun.yu@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com,
trilok.soni@oss.qualcomm.com, yijie.yang@oss.qualcomm.com,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Kumari Pallavi <kumari.pallavi@oss.qualcomm.com>
Subject: Re: [PATCH 2/2] misc: fastrpc: Update dma_mask for CDSP support on Kaanapali SoC
Date: Sat, 4 Oct 2025 19:36:08 +0100 [thread overview]
Message-ID: <7b281f10-f42c-454b-9c4d-96ea4f66c66f@kernel.org> (raw)
In-Reply-To: <20250924-knp-fastrpc-v1-2-4b40f8bfce1d@oss.qualcomm.com>
On 9/25/25 12:46 AM, Jingyi Wang wrote:
> From: Kumari Pallavi <kumari.pallavi@oss.qualcomm.com>
>
> DSP currently supports 32-bit IOVA (32-bit PA + 4-bit SID) for
> both Q6 and user DMA (uDMA) access. This is being upgraded to
> 34-bit PA + 4-bit SID due to a hardware revision in CDSP for
> Kaanapali SoC, which expands the DMA addressable range.
> Update DMA mask configuration in the driver to support CDSP on
> Kaanapali SoC. Set the default `dma_mask` to 32-bit and update
> it to 34-bit based on CDSP and SoC-specific compatible string.
>
> Signed-off-by: Kumari Pallavi <kumari.pallavi@oss.qualcomm.com>
> Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
> ---
> drivers/misc/fastrpc.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index db396241b8ce..e019163eb265 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -275,6 +275,7 @@ struct fastrpc_session_ctx {
> bool used;
> bool valid;
> u32 sid_pos;
> + u32 pa_bits;
same comments as in patch 1 move to channel ctx, also why do we even
need this to be stored in the first place as dma mask is set in
probe,we will not need it after wards.
> };
>
> struct fastrpc_channel_ctx {
> @@ -2179,9 +2180,9 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
> sess->used = false;
> sess->valid = true;
> sess->dev = dev;
> + sess->pa_bits = cctx->dma_mask;
> /* Configure where sid will be prepended to pa */
> - sess->sid_pos =
> - (cctx->iova_format ? SID_POS_IN_IOVA : DSP_DEFAULT_BUS_WIDTH);
> + sess->sid_pos = (cctx->iova_format ? SID_POS_IN_IOVA : sess->pa_bits);
>
> if (of_property_read_u32(dev->of_node, "reg", &sess->sid))
> dev_info(dev, "FastRPC Session ID not specified in DT\n");
> @@ -2198,9 +2199,9 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
> }
> }
> spin_unlock_irqrestore(&cctx->lock, flags);
> - rc = dma_set_mask(dev, DMA_BIT_MASK(32));
> + rc = dma_set_mask(dev, DMA_BIT_MASK(sess->pa_bits));
> if (rc) {
> - dev_err(dev, "32-bit DMA enable failed\n");
> + dev_err(dev, "%u-bit DMA enable failed\n", sess->pa_bits);
> return rc;
> }
>
> @@ -2287,10 +2288,12 @@ static int fastrpc_get_domain_id(const char *domain)
>
> struct fastrpc_soc_data {
> u32 dsp_iova_format;
> + u32 cdsp_dma_mask;
> };
>
> static const struct fastrpc_soc_data kaanapali_soc_data = {
> .dsp_iova_format = 1,
> + .cdsp_dma_mask = 34,
> };
>
> static const struct of_device_id qcom_soc_match_table[] = {
> @@ -2310,6 +2313,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
> const struct of_device_id *match;
> const struct fastrpc_soc_data *soc_data = NULL;
> u32 iova_format = 0;
> + u32 ubs = DSP_DEFAULT_BUS_WIDTH;
>
> root = of_find_node_by_path("/");
> if (!root)
> @@ -2322,6 +2326,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
> } else {
> soc_data = match->data;
> iova_format = soc_data->dsp_iova_format;
> + ubs = soc_data->cdsp_dma_mask;
> }
>
> err = of_property_read_string(rdev->of_node, "label", &domain);
> @@ -2404,6 +2409,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
> }
> /* determine where sid needs to be prepended to pa based on iova_format */
> data->iova_format = iova_format;
> + data->dma_mask = (domain_id == CDSP_DOMAIN_ID ? ubs : DSP_DEFAULT_BUS_WIDTH);
set the default of 32 and move this inside switch case where we have
domain id checks.
> kref_init(&data->refcount);
>
> dev_set_drvdata(&rpdev->dev, data);
>
prev parent reply other threads:[~2025-10-04 18:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 23:46 [PATCH 0/2] Add ADSP and CDSP support on Kaanapali SoC Jingyi Wang
2025-09-24 23:46 ` [PATCH 1/2] misc: fastrpc: Add support for new DSP IOVA formatting Jingyi Wang
2025-09-25 2:25 ` Dmitry Baryshkov
2025-09-30 4:43 ` Kumari Pallavi
2025-09-25 6:24 ` Arnd Bergmann
2025-09-30 4:40 ` Kumari Pallavi
2025-09-26 0:08 ` kernel test robot
2025-10-04 18:25 ` Srinivas Kandagatla
2025-09-24 23:46 ` [PATCH 2/2] misc: fastrpc: Update dma_mask for CDSP support on Kaanapali SoC Jingyi Wang
2025-09-25 2:57 ` Dmitry Baryshkov
2025-10-04 18:36 ` Srinivas Kandagatla [this message]
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=7b281f10-f42c-454b-9c4d-96ea4f66c66f@kernel.org \
--to=srini@kernel.org \
--cc=aiqun.yu@oss.qualcomm.com \
--cc=amahesh@qti.qualcomm.com \
--cc=arnd@arndb.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jingyi.wang@oss.qualcomm.com \
--cc=kumari.pallavi@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tingwei.zhang@oss.qualcomm.com \
--cc=trilok.soni@oss.qualcomm.com \
--cc=yijie.yang@oss.qualcomm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox