public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: asm: add readq/writeq methods
Date: Sat, 7 Dec 2013 15:25:56 +0000	[thread overview]
Message-ID: <20131207152556.GP4360@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <52A32C88.9010000@arkona-technologies.de>

On Sat, Dec 07, 2013 at 03:11:20PM +0100, Matthias Mann wrote:
> Add readq/writeq methods for 32 bit ARM to allow transfering 64 bit words over
> PCIe as a single transfer.

Since these asm instructions are not universally implemented, use of these
will lead to build time errors if a driver attempts to make use of these
on an ARM architecture which doesn't support it.

Hence, these need to be conditional - since they first appeared (iirc) in
ARMv5, then they should be conditional on

#if __LINUX_ARM_ARCH__ >= 5

However, there's another issue here.  The use of readq/writeq() is
controlled with various preprocessor or configuration symbols:

#if BITS_PER_LONG >= 64
#ifdef CONFIG_64BIT
#ifndef readq
#ifndef writeq

I much prefer the latter two, as it means drivers can individually
implement the lacking support in a way which is appropriate for the device
they're driving - which is especially important if reading a register has
side effects.  In other words, readq() and writeq() is not something that
can be provided by an arch where no 64-bit read/write IO instructions
exist.

This requires that where an architecture provides them, that they be
accompanied by these definitions:

#define readq readq
#define writeq writeq

to prevent the drivers own private definitions of these accessors
conflicting.

      parent reply	other threads:[~2013-12-07 15:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 14:11 [PATCH] ARM: asm: add readq/writeq methods Matthias Mann
2013-12-07 15:12 ` Måns Rullgård
2013-12-07 15:20   ` Alexander Shiyan
2013-12-07 15:25 ` Russell King - ARM Linux [this message]

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=20131207152556.GP4360@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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