linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org,
	Kedareswara rao Appana <appana.durga.rao@xilinx.com>,
	anirudh@xilinx.com, wg@grandegger.com, michal.simek@xilinx.com,
	soren.brinkmann@xilinx.com, appanad@xilinx.com,
	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
Date: Mon, 26 Oct 2015 02:25:30 +0100	[thread overview]
Message-ID: <201510260225.30934.arnd@arndb.de> (raw)
In-Reply-To: <562D3C4C.60306@pengutronix.de>

On Sunday 25 October 2015, Marc Kleine-Budde wrote:
> On 10/22/2015 10:58 AM, Arnd Bergmann wrote:
> >>> 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.
> >>>
> >>> 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?
> > 
> > No, the relaxed writes are not well-defined across architectures. On
> > ARM, the CPU guarantees that stores to an MMIO area are still in order
> > with respect to one another, the barrier is only needed for actual DMA,
> > so you are fine. I would expect the same to be true everywhere,
> > otherwise a lot of other drivers would be broken too.
> 
> And the relaxed functions seem not to be available on all archs. This
> driver should work on microblaze. Are __raw_writeX(), __raw_readX() an
> alternative here?

__raw_writeX() and __raw_readX()  are not safe to use in drivers in general.

readl_relaxed() should work on all architectures nowadays, and I've checked
that it does on microblaze.

	Arnd

  reply	other threads:[~2015-10-26  1:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  4:46 [PATCH 1/2] can: xilinx: use readl/writel instead of ioread/iowrite Kedareswara rao Appana
2015-10-22  4:46 ` [PATCH 2/2] can: xilinx: fix bug in bus error handling Kedareswara rao Appana
2015-10-22  4:46 ` Kedareswara rao Appana
2015-10-22  4:46 ` Kedareswara rao Appana
2015-10-22  8:14 ` [PATCH 1/2] can: xilinx: use readl/writel instead of ioread/iowrite Arnd Bergmann
2015-10-22  8:21   ` Marc Kleine-Budde
2015-10-22  8:39     ` Appana Durga Kedareswara Rao
2015-10-22  8:58     ` Arnd Bergmann
2015-10-25 20:32       ` Marc Kleine-Budde
2015-10-26  1:25         ` Arnd Bergmann [this message]
2015-10-22  8:34   ` Appana Durga Kedareswara Rao
2015-10-22  9:02     ` Arnd Bergmann
2015-10-22  9:49       ` Michal Simek
     [not found] ` <1445489163-11045-2-git-send-email-appanad@xilinx.com>
2015-10-22 16:33   ` [PATCH 2/2] can: xilinx: fix bug in bus error handling Sören Brinkmann
2015-10-23  5:21     ` Appana Durga Kedareswara Rao

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=201510260225.30934.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=anirudh@xilinx.com \
    --cc=appana.durga.rao@xilinx.com \
    --cc=appanad@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=soren.brinkmann@xilinx.com \
    --cc=wg@grandegger.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).