From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Joakim Zhang <qiangqing.zhang@nxp.com>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH V2 1/3] can: flexcan: initialize all flexcan memory for ECC function
Date: Mon, 28 Sep 2020 08:20:59 +0200 [thread overview]
Message-ID: <c43b3311-8c15-71ec-5f39-1a3b22f928e5@pengutronix.de> (raw)
In-Reply-To: <DB8PR04MB67953242A9B727F851B7466CE6350@DB8PR04MB6795.eurprd04.prod.outlook.com>
[-- Attachment #1.1: Type: text/plain, Size: 943 bytes --]
On 9/28/20 7:23 AM, Joakim Zhang wrote:
>>>> + for (i = 0; i < ram_init[0].len; i++)
>>>> + priv->write(0, (void __iomem *)regs + ram_init[0].offset +
>>>> +sizeof(u32) * i);
>>>
>>> As the write function only does endian conversion, and you're writing 0 here.
>>> What about using iowrite32_rep() and get rid of the for loop?
>>
>> Thanks for this point, I will update in next version.
>
> Ahhh.. I check iowrite32_rep() writes a buf to single address, no shift for address.
Doh! Right.
> I prefer to use memset_io() here to initialize a block of io memory. What do
> you think?
Of course, that's the correct function for this!
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-09-28 6:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-27 16:07 [PATCH V2 0/3] patch set for flexcan Joakim Zhang
2020-09-27 16:07 ` [PATCH V2 1/3] can: flexcan: initialize all flexcan memory for ECC function Joakim Zhang
2020-09-27 19:51 ` Marc Kleine-Budde
2020-09-28 2:00 ` Joakim Zhang
2020-09-27 19:57 ` Marc Kleine-Budde
2020-09-28 2:29 ` Joakim Zhang
2020-09-28 5:23 ` Joakim Zhang
2020-09-28 6:20 ` Marc Kleine-Budde [this message]
2020-09-27 16:08 ` [PATCH V2 2/3] can: flexcan: add flexcan driver for i.MX8MP Joakim Zhang
2020-09-27 16:08 ` [PATCH V2 3/3] can: flexcan: disable runtime PM if register flexcandev failed Joakim Zhang
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=c43b3311-8c15-71ec-5f39-1a3b22f928e5@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=qiangqing.zhang@nxp.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;
as well as URLs for NNTP newsgroup(s).