Thread (13 messages) 13 messages, 4 authors, 2015-10-26

RE: [PATCH 1/2] can: xilinx: use readl/writel instead of ioread/iowrite

flat view

From: Appana Durga Kedareswara Rao <hidden>
Date: 2015-10-22 08:40:08
Also in: linux-arm-kernel, linux-can, lkml

Hi Marc,
-----Original Message-----
From: Marc Kleine-Budde [mailto:mkl@pengutronix.de]
Sent: Thursday, October 22, 2015 1:52 PM
To: Arnd Bergmann; linux-arm-kernel@lists.infradead.org
Cc: Appana Durga Kedareswara Rao; Anirudha Sarangi; wg@grandegger.com;
Michal Simek; Soren Brinkmann; Appana Durga Kedareswara Rao;
netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
can@vger.kernel.org
Subject: Re: [PATCH 1/2] can: xilinx: use readl/writel instead of ioread/iowrite

On 10/22/2015 10:14 AM, Arnd Bergmann wrote:
quoted
On Thursday 22 October 2015 10:16:02 Kedareswara rao Appana wrote:
quoted
The driver only supports memory-mapped I/O [by ioremap()], so
readl/writel is actually the right thing to do, IMO.
During the validation of this driver or IP on ARM 64-bit processor
while sending lot of packets observed that the tx packet drop with
iowrite Putting the barriers for each tx fifo register write fixes
this issue Instead of barriers using writel also fixed this issue.

Signed-off-by: Kedareswara rao Appana <redacted>
The two should really do the same thing: iowrite32() is just a static
inline calling writel() on both ARM32 and ARM64. On which kernel
version did you observe the difference? It's possible that an older
version used CONFIG_GENERIC_IOMAP, which made this slightly more
expensive.
quoted
If there are barriers that you want to get rid of for performance
reasons, you should use writel_relaxed(), but be careful to
synchronize them correctly with regard to DMA. It should be fine in
this driver, as it does not perform any DMA, but be aware that there
is no big-endian version of
writel_relaxed() at the moment.
We don't have DMA in CAN drivers, but usually a certain write triggers sending.
Do we need a barrier before triggering the sending?
Yes During validation of this IP on ARM 64 bit processor with using iowrite32() and sending a lot of packets it requires barriers before triggering the send.
With using writel() barriers are not needed.

Regards,
Kedar.
Marc

--
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help