linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kumari Pallavi <kumari.pallavi@oss.qualcomm.com>
To: Srinivas Kandagatla <srini@kernel.org>,
	kpallavi@qti.qualcomm.com, amahesh@qti.qualcomm.com,
	arnd@arndb.de, gregkh@linuxfoundation.org
Cc: quic_bkumar@quicinc.com, ekansh.gupta@oss.qualcomm.com,
	linux-kernel@vger.kernel.org, quic_chennak@quicinc.com,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	jingyi.wang@oss.qualcomm.com, aiqun.yu@oss.qualcomm.com,
	ktadakam@qti.qualcomm.com
Subject: Re: [PATCH v2 3/3] misc: fastrpc: Update dma_mask for CDSP support on Kaanapali SoC
Date: Wed, 15 Oct 2025 16:17:39 +0530	[thread overview]
Message-ID: <0000ffec-c17d-40a4-950b-5cafcbbad5ac@oss.qualcomm.com> (raw)
In-Reply-To: <2a6319e5-15e5-4cb7-a2f3-7521383fc30e@kernel.org>



On 10/15/2025 2:55 PM, Srinivas Kandagatla wrote:
> 
> 
> On 10/15/25 5:57 AM, Kumari Pallavi wrote:
>> 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>
>> ---
>>   drivers/misc/fastrpc.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index 1a5d620b23f2..f2e5e53e9067 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -267,6 +267,7 @@ struct fastrpc_session_ctx {
>>   
>>   struct fastrpc_soc_data {
>>   	u32 sid_pos;
>> +	u32 cdsp_dma_mask;
> How about making this an actual dmamask ex:
> 
> 	u64 cdsp_dma_mask == DMA_BIT_MASK(64),
> 	u64 dma_mask == DMA_BIT_MASK(32),
> 
> This will give more clear picture of what is going on,
> 

The current approach of assigning a value to cdsp_dma_mask allows for 
adaptable logging behavior, making it easier to trace.

> BTW, these values are not set in the patch for some reason for both
> default and soc specific soc data>

Ack.

>>   struct fastrpc_channel_ctx {
>> @@ -2178,6 +2179,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
>>   	int i, sessions = 0;
>>   	unsigned long flags;
>>   	int rc;
>> +	u32 dma_mask = 32;this should come from default soc_data, do not hardcode this here.
> 	u64 dma_mask = default_soc_data->dma_mask;>

Ack.

>>   	cctx = dev_get_drvdata(dev->parent);
>>   	if (!cctx)
>> @@ -2197,6 +2199,9 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
>>   	sess->dev = dev;
>>   	dev_set_drvdata(dev, sess);> +	if (cctx->domain_id == CDSP_DOMAIN_ID)
>> +		dma_mask = cctx->soc_data->cdsp_dma_mask;
>> +
> 
>>   	if (of_property_read_u32(dev->of_node, "reg", &sess->sid))
>>   		dev_info(dev, "FastRPC Session ID not specified in DT\n");
>>   
>> @@ -2211,9 +2216,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(dma_mask));
>>   	if (rc) {
>> -		dev_err(dev, "32-bit DMA enable failed\n");
>> +		dev_err(dev, "%u-bit DMA enable failed\n", dma_mask);
>>   		return rc;
>>   	}
>>   
> 


      reply	other threads:[~2025-10-15 10:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  4:56 [PATCH v2 0/3] Add ADSP and CDSP support on Kaanapali SoC Kumari Pallavi
2025-10-15  4:57 ` [PATCH v2 1/3] misc: fastrpc: Rename phys to dma_addr for clarity Kumari Pallavi
2025-10-15  7:20   ` Arnd Bergmann
2025-10-15 10:49     ` Kumari Pallavi
2025-10-15 10:07   ` Dmitry Baryshkov
2025-10-23  7:20     ` Kumari Pallavi
2025-10-15  4:57 ` [PATCH v2 2/3] misc: fastrpc: Add support for new DSP IOVA formatting Kumari Pallavi
2025-10-15  7:09   ` Arnd Bergmann
2025-10-15  8:52   ` Srinivas Kandagatla
2025-10-15 10:47     ` Kumari Pallavi
2025-10-18 17:25       ` Krzysztof Kozlowski
2025-10-18 17:24   ` Krzysztof Kozlowski
2025-10-23  8:35     ` Kumari Pallavi
2025-10-23  8:41       ` Krzysztof Kozlowski
2025-10-15  4:57 ` [PATCH v2 3/3] misc: fastrpc: Update dma_mask for CDSP support on Kaanapali SoC Kumari Pallavi
2025-10-15  7:06   ` Arnd Bergmann
2025-10-15  9:25   ` Srinivas Kandagatla
2025-10-15 10:47     ` Kumari Pallavi [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=0000ffec-c17d-40a4-950b-5cafcbbad5ac@oss.qualcomm.com \
    --to=kumari.pallavi@oss.qualcomm.com \
    --cc=aiqun.yu@oss.qualcomm.com \
    --cc=amahesh@qti.qualcomm.com \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ekansh.gupta@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jingyi.wang@oss.qualcomm.com \
    --cc=kpallavi@qti.qualcomm.com \
    --cc=ktadakam@qti.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_bkumar@quicinc.com \
    --cc=quic_chennak@quicinc.com \
    --cc=srini@kernel.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 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).