From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Peng Fan <peng.fan@nxp.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Cristian Marussi <cristian.marussi@arm.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"arm-scmi@vger.kernel.org" <arm-scmi@vger.kernel.org>,
"james.quinlan@broadcom.com" <james.quinlan@broadcom.com>,
"justin.chen@broadcom.com" <justin.chen@broadcom.com>,
"kapil.hali@broadcom.com" <kapil.hali@broadcom.com>,
"bcm-kernel-feedback-list@broadcom.com"
<bcm-kernel-feedback-list@broadcom.com>
Subject: Re: [PATCH 2/2] firmware: arm_scmi: Support 'reg-io-width' property for shared memory
Date: Sun, 11 Aug 2024 14:03:50 -0700 [thread overview]
Message-ID: <6d601728-7f38-400c-9a51-8170d33f0055@broadcom.com> (raw)
In-Reply-To: <PAXPR04MB84598FFA4F7D8D1287D220D688842@PAXPR04MB8459.eurprd04.prod.outlook.com>
On 8/11/2024 5:42 AM, Peng Fan wrote:
>> Subject: [PATCH 2/2] firmware: arm_scmi: Support 'reg-io-width'
>> property for shared memory
>>
>> Some shared memory areas might only support a certain access width,
>> (e.g.: 32 bits accesses only). Update the shmem layer to support
>> reading from and writing to such shared memory area using the
>> specified I/O width in the Device Tree. The various transport layers
>> making use of the shmem.c code are updated accordingly to pass the
>> I/O width to the routines that need it.
>>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>
> [...]
>> }
>>
>> static void smc_mark_txdone(struct scmi_chan_info *cinfo, int ret, diff
>> --git a/drivers/firmware/arm_scmi/shmem.c
>> b/drivers/firmware/arm_scmi/shmem.c
>> index 01d8a9398fe8..192262d63baa 100644
>> --- a/drivers/firmware/arm_scmi/shmem.c
>> +++ b/drivers/firmware/arm_scmi/shmem.c
>> @@ -34,9 +34,20 @@ struct scmi_shared_mem {
>> u8 msg_payload[];
>> };
>>
>> +#define __shmem_copy_toio_tpl(s) \
>> + for (unsigned int i = 0; i < xfer->tx.len; i += shmem_io_width)
>> \
>> + iowrite##s(((u##s *)(xfer->tx.buf))[i / shmem_io_width],
>> \
>> + shmem->msg_payload + i);
>
> there will be a barrier with iowrite, use raw_write##s?
Makes sense, and that matches what memcpy_{from,to}_io() does, too.
>
>> +
>> +#define __shmem_copy_fromio_tpl(s) \
>> + for (unsigned int i = 0; i < xfer->rx.len; i += shmem_io_width)
>> \
>> + ((u##s *)(xfer->rx.buf))[i / shmem_io_width] =
>> \
>> + ioread##s(shmem->msg_payload +
>> shmem_io_width + i);
>
> Use raw_ioread##s?
Agreed.
--
Florian
next prev parent reply other threads:[~2024-08-11 21:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-10 21:46 [PATCH 0/2] Support for I/O width within ARM SCMI SHMEM Florian Fainelli
2024-08-10 21:46 ` [PATCH 1/2] dt-bindings: sram: Document reg-io-width property Florian Fainelli
2024-08-11 5:37 ` Christophe JAILLET
2024-08-11 12:39 ` Krzysztof Kozlowski
2024-08-12 16:55 ` Rob Herring
2024-08-10 21:46 ` [PATCH 2/2] firmware: arm_scmi: Support 'reg-io-width' property for shared memory Florian Fainelli
2024-08-11 2:42 ` Florian Fainelli
2024-08-11 12:17 ` kernel test robot
2024-08-11 12:27 ` kernel test robot
2024-08-11 12:27 ` kernel test robot
2024-08-11 12:42 ` Peng Fan
2024-08-11 21:03 ` Florian Fainelli [this message]
2024-08-11 21:08 ` Florian Fainelli
2024-08-12 17:18 ` Cristian Marussi
2024-08-12 17:46 ` Florian Fainelli
2024-08-12 18:01 ` Cristian Marussi
2024-08-12 21:19 ` Florian Fainelli
2024-08-13 5:00 ` Florian Fainelli
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=6d601728-7f38-400c-9a51-8170d33f0055@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=arm-scmi@vger.kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=conor+dt@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=james.quinlan@broadcom.com \
--cc=justin.chen@broadcom.com \
--cc=kapil.hali@broadcom.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.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
all inboxes | Powered by JetHome®