mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Kumari Pallavi <kumari.pallavi@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	kpallavi@qti.qualcomm.com, srini@kernel.org,
	amahesh@qti.qualcomm.com, arnd@arndb.de,
	gregkh@linuxfoundation.org, 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 v3 2/4] misc: fastrpc: Rename phys to dma_addr for clarity
Date: Mon, 17 Nov 2025 12:31:25 +0100	[thread overview]
Message-ID: <8adbf95a-4ca1-418c-bac5-9a5e01116164@oss.qualcomm.com> (raw)
In-Reply-To: <lxa5lomfvjf6e4jxt7c67cj7q6blflvc3lpmclybag3cumxtxb@xnte42junlmc>

On 11/17/25 12:22 PM, Dmitry Baryshkov wrote:
> On Mon, Nov 17, 2025 at 12:37:33PM +0530, Kumari Pallavi wrote:
>>
>>
>> On 11/14/2025 9:14 PM, Bjorn Andersson wrote:
>>> On Fri, Nov 14, 2025 at 02:11:40PM +0530, Kumari Pallavi wrote:
>>>> Update all references of buf->phys and map->phys to buf->dma_addr and
>>>> map->dma_addr to accurately represent that these fields store DMA
>>>> addresses, not physical addresses. This change improves code clarity
>>>> and aligns with kernel conventions for dma_addr_t usage.
>>>>
>>>> Signed-off-by: Kumari Pallavi <kumari.pallavi@oss.qualcomm.com>
>>>> ---
>>>>   drivers/misc/fastrpc.c | 76 ++++++++++++++++++++++--------------------
>>>>   1 file changed, 40 insertions(+), 36 deletions(-)
>>>>
>>>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>>>> index ee652ef01534..d6a7960fe716 100644
>>>> --- a/drivers/misc/fastrpc.c
>>>> +++ b/drivers/misc/fastrpc.c
>>>> @@ -106,7 +106,7 @@
>>>>   #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscdev)
>>>>   struct fastrpc_phy_page {
>>>> -	u64 addr;		/* physical address */
>>>> +	u64 addr;		/* physical or dma address */
>>>>   	u64 size;		/* size of contiguous region */
>>>>   };
>>>> @@ -171,7 +171,7 @@ struct fastrpc_msg {
>>>>   	u64 ctx;		/* invoke caller context */
>>>>   	u32 handle;	/* handle to invoke */
>>>>   	u32 sc;		/* scalars structure describing the data */
>>>> -	u64 addr;		/* physical address */
>>>> +	u64 addr;		/* physical or dma address */
>>>
>>> Can you go all the way and make the type dma_addr_t? That way you don't
>>> need to typecast the dma_alloc_coherent() and dma_free_coherent().
>>>
>>> I believe it might complicate the places where you do math on it, but
>>> that is a good thing, as it highlights those places where you do
>>> something unexpected.
>>>
>>
>> While this not strictly limited to holding a dma_addr_t.
>> Based on historical behavior, when the FASTRPC_ATTR_SECUREMAP flag is
>> set, S2 mapping expects a physical address to be passed to the
>> qcom_scm_assign_mem() API.
>> reference-
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=e90d911906196bf987492c94e38f10ca611dfd7b
>>
>> If you suggest, I can define it as dma_addr_t and perform typecasting to u64
>> wherever required.
> 
> You don't need to typecase dma_addr_t when passing u64.

*on arm anyway

Konrad

  reply	other threads:[~2025-11-17 11:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14  8:41 [PATCH v3 0/4] Add ADSP and CDSP support on Kaanapali SoC Kumari Pallavi
2025-11-14  8:41 ` [PATCH v3 1/4] dt-bindings: misc: qcom,fastrpc: Add compatible for Kaanapali Kumari Pallavi
2025-11-14 15:47   ` Krzysztof Kozlowski
2025-11-17  7:17     ` Kumari Pallavi
2025-11-17  7:20       ` Krzysztof Kozlowski
2025-11-14  8:41 ` [PATCH v3 2/4] misc: fastrpc: Rename phys to dma_addr for clarity Kumari Pallavi
2025-11-14 12:15   ` Dmitry Baryshkov
2025-11-17  7:03     ` Kumari Pallavi
2025-11-14 15:44   ` Bjorn Andersson
2025-11-17  7:07     ` Kumari Pallavi
2025-11-17 11:22       ` Dmitry Baryshkov
2025-11-17 11:31         ` Konrad Dybcio [this message]
2025-11-18 16:04       ` Bjorn Andersson
2025-11-14  8:41 ` [PATCH v3 3/4] misc: fastrpc: Add support for new DSP IOVA formatting Kumari Pallavi
2025-11-14 15:51   ` Bjorn Andersson
2025-11-17  7:02     ` Kumari Pallavi
2025-11-18 15:52       ` Bjorn Andersson
2025-11-14  8:41 ` [PATCH v3 4/4] misc: fastrpc: Update dma_bits for CDSP support on Kaanapali SoC Kumari Pallavi
2025-11-14 16:00   ` Bjorn Andersson
2025-11-17  9:12     ` Kumari Pallavi
2025-11-18 16:57       ` Bjorn Andersson
2025-11-24 11:21         ` Kumari Pallavi

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=8adbf95a-4ca1-418c-bac5-9a5e01116164@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=aiqun.yu@oss.qualcomm.com \
    --cc=amahesh@qti.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --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=kumari.pallavi@oss.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

all inboxes | Powered by JetHome®