All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
To: Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	"Marc Zyngier" <maz@kernel.org>
Cc: gregkh <gregkh@linuxfoundation.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-arm-msm@vger.kernel.org>, <quic_psodagud@quicinc.com>,
	Sai Prakash Ranjan <quic_saipraka@quicinc.com>
Subject: [PATCHv5 1/4] arm64: io: Use asm-generic high level MMIO accessors
Date: Mon, 6 Dec 2021 13:58:03 +0530	[thread overview]
Message-ID: <cc649faf144fce439b7a341303b6cc73ac285949.1638275062.git.quic_saipraka@quicinc.com> (raw)
In-Reply-To: <cover.1638275062.git.quic_saipraka@quicinc.com>

Remove custom arm64 MMIO accessors read{b,w,l,q} and their relaxed
versions in support to use asm-generic ones. Also define arm64
barrier macros to override the asm-generic defined barriers.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 arch/arm64/include/asm/io.h | 33 ++++-----------------------------
 1 file changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 7fd836bea7eb..33de60fdf6f1 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -112,35 +112,10 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
 #define __iowmb()		dma_wmb()
 #define __iomb()		dma_mb()
 
-/*
- * Relaxed I/O memory access primitives. These follow the Device memory
- * ordering rules but do not guarantee any ordering relative to Normal memory
- * accesses.
- */
-#define readb_relaxed(c)	({ u8  __r = __raw_readb(c); __r; })
-#define readw_relaxed(c)	({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
-#define readl_relaxed(c)	({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
-#define readq_relaxed(c)	({ u64 __r = le64_to_cpu((__force __le64)__raw_readq(c)); __r; })
-
-#define writeb_relaxed(v,c)	((void)__raw_writeb((v),(c)))
-#define writew_relaxed(v,c)	((void)__raw_writew((__force u16)cpu_to_le16(v),(c)))
-#define writel_relaxed(v,c)	((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
-#define writeq_relaxed(v,c)	((void)__raw_writeq((__force u64)cpu_to_le64(v),(c)))
-
-/*
- * I/O memory access primitives. Reads are ordered relative to any
- * following Normal memory access. Writes are ordered relative to any prior
- * Normal memory access.
- */
-#define readb(c)		({ u8  __v = readb_relaxed(c); __iormb(__v); __v; })
-#define readw(c)		({ u16 __v = readw_relaxed(c); __iormb(__v); __v; })
-#define readl(c)		({ u32 __v = readl_relaxed(c); __iormb(__v); __v; })
-#define readq(c)		({ u64 __v = readq_relaxed(c); __iormb(__v); __v; })
-
-#define writeb(v,c)		({ __iowmb(); writeb_relaxed((v),(c)); })
-#define writew(v,c)		({ __iowmb(); writew_relaxed((v),(c)); })
-#define writel(v,c)		({ __iowmb(); writel_relaxed((v),(c)); })
-#define writeq(v,c)		({ __iowmb(); writeq_relaxed((v),(c)); })
+#define __io_ar(v)		__io_par(v)
+#define __io_bw()		__iowmb()
+#define __io_br(v)
+#define __io_aw(v)
 
 /*
  *  I/O port access primitives.
-- 
2.33.1


WARNING: multiple messages have this Message-ID (diff)
From: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
To: Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	 Arnd Bergmann <arnd@arndb.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	"Marc Zyngier" <maz@kernel.org>
Cc: gregkh <gregkh@linuxfoundation.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-arm-msm@vger.kernel.org>, <quic_psodagud@quicinc.com>,
	Sai Prakash Ranjan <quic_saipraka@quicinc.com>
Subject: [PATCHv5 1/4] arm64: io: Use asm-generic high level MMIO accessors
Date: Mon, 6 Dec 2021 13:58:03 +0530	[thread overview]
Message-ID: <cc649faf144fce439b7a341303b6cc73ac285949.1638275062.git.quic_saipraka@quicinc.com> (raw)
In-Reply-To: <cover.1638275062.git.quic_saipraka@quicinc.com>

Remove custom arm64 MMIO accessors read{b,w,l,q} and their relaxed
versions in support to use asm-generic ones. Also define arm64
barrier macros to override the asm-generic defined barriers.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 arch/arm64/include/asm/io.h | 33 ++++-----------------------------
 1 file changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 7fd836bea7eb..33de60fdf6f1 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -112,35 +112,10 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
 #define __iowmb()		dma_wmb()
 #define __iomb()		dma_mb()
 
-/*
- * Relaxed I/O memory access primitives. These follow the Device memory
- * ordering rules but do not guarantee any ordering relative to Normal memory
- * accesses.
- */
-#define readb_relaxed(c)	({ u8  __r = __raw_readb(c); __r; })
-#define readw_relaxed(c)	({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
-#define readl_relaxed(c)	({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
-#define readq_relaxed(c)	({ u64 __r = le64_to_cpu((__force __le64)__raw_readq(c)); __r; })
-
-#define writeb_relaxed(v,c)	((void)__raw_writeb((v),(c)))
-#define writew_relaxed(v,c)	((void)__raw_writew((__force u16)cpu_to_le16(v),(c)))
-#define writel_relaxed(v,c)	((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
-#define writeq_relaxed(v,c)	((void)__raw_writeq((__force u64)cpu_to_le64(v),(c)))
-
-/*
- * I/O memory access primitives. Reads are ordered relative to any
- * following Normal memory access. Writes are ordered relative to any prior
- * Normal memory access.
- */
-#define readb(c)		({ u8  __v = readb_relaxed(c); __iormb(__v); __v; })
-#define readw(c)		({ u16 __v = readw_relaxed(c); __iormb(__v); __v; })
-#define readl(c)		({ u32 __v = readl_relaxed(c); __iormb(__v); __v; })
-#define readq(c)		({ u64 __v = readq_relaxed(c); __iormb(__v); __v; })
-
-#define writeb(v,c)		({ __iowmb(); writeb_relaxed((v),(c)); })
-#define writew(v,c)		({ __iowmb(); writew_relaxed((v),(c)); })
-#define writel(v,c)		({ __iowmb(); writel_relaxed((v),(c)); })
-#define writeq(v,c)		({ __iowmb(); writeq_relaxed((v),(c)); })
+#define __io_ar(v)		__io_par(v)
+#define __io_bw()		__iowmb()
+#define __io_br(v)
+#define __io_aw(v)
 
 /*
  *  I/O port access primitives.
-- 
2.33.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-06  8:29 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06  8:28 [PATCHv5 0/4] tracing/rwmmio/arm64: Add support to trace register reads/writes Sai Prakash Ranjan
2021-12-06  8:28 ` Sai Prakash Ranjan
2021-12-06  8:28 ` Sai Prakash Ranjan [this message]
2021-12-06  8:28   ` [PATCHv5 1/4] arm64: io: Use asm-generic high level MMIO accessors Sai Prakash Ranjan
2021-12-06  8:50   ` Arnd Bergmann
2021-12-06  8:50     ` Arnd Bergmann
2021-12-06 11:12     ` Sai Prakash Ranjan
2021-12-06 11:12       ` Sai Prakash Ranjan
2021-12-06 11:30       ` Arnd Bergmann
2021-12-06 11:30         ` Arnd Bergmann
2021-12-06 13:52         ` Sai Prakash Ranjan
2021-12-06 13:52           ` Sai Prakash Ranjan
2021-12-06 15:15           ` Arnd Bergmann
2021-12-06 15:15             ` Arnd Bergmann
2021-12-06 15:57             ` Sai Prakash Ranjan
2021-12-06 15:57               ` Sai Prakash Ranjan
2021-12-06 15:36   ` kernel test robot
2021-12-06 15:36     ` kernel test robot
2021-12-06 15:36     ` kernel test robot
2021-12-07 13:04   ` kernel test robot
2021-12-07 13:04     ` kernel test robot
2021-12-07 13:04     ` kernel test robot
2021-12-06  8:28 ` [PATCHv5 2/4] irqchip/tegra: Fix overflow implicit truncation warnings Sai Prakash Ranjan
2021-12-06  8:28   ` Sai Prakash Ranjan
2021-12-06  8:51   ` Arnd Bergmann
2021-12-06  8:51     ` Arnd Bergmann
2021-12-06  8:28 ` [PATCHv5 3/4] tracing: Add register read/write tracing support Sai Prakash Ranjan
2021-12-06  8:28   ` Sai Prakash Ranjan
2021-12-06  8:59   ` Arnd Bergmann
2021-12-06  8:59     ` Arnd Bergmann
2021-12-06 10:11     ` Sai Prakash Ranjan
2021-12-06 10:11       ` Sai Prakash Ranjan
2021-12-06 10:46       ` Arnd Bergmann
2021-12-06 10:46         ` Arnd Bergmann
2021-12-06 10:52         ` Sai Prakash Ranjan
2021-12-06 10:52           ` Sai Prakash Ranjan
2021-12-06 10:13     ` Sai Prakash Ranjan
2021-12-06 10:13       ` Sai Prakash Ranjan
2021-12-06 11:52   ` kernel test robot
2021-12-06 11:52     ` kernel test robot
2021-12-06 11:52     ` kernel test robot
2021-12-06 16:39   ` kernel test robot
2021-12-06 16:39     ` kernel test robot
2021-12-06 16:39     ` kernel test robot
2021-12-06  8:28 ` [PATCHv5 4/4] asm-generic/io: Add logging support for MMIO accessors Sai Prakash Ranjan
2021-12-06  8:28   ` Sai Prakash Ranjan
2021-12-06  9:09   ` Arnd Bergmann
2021-12-06  9:09     ` Arnd Bergmann
2021-12-06  9:52     ` Sai Prakash Ranjan
2021-12-06  9:52       ` Sai Prakash Ranjan
2021-12-06 10:01       ` Arnd Bergmann
2021-12-06 10:01         ` Arnd Bergmann
2021-12-06 10:20         ` Sai Prakash Ranjan
2021-12-06 10:20           ` Sai Prakash Ranjan

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=cc649faf144fce439b7a341303b6cc73ac285949.1638275062.git.quic_saipraka@quicinc.com \
    --to=quic_saipraka@quicinc.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=quic_psodagud@quicinc.com \
    --cc=rostedt@goodmis.org \
    --cc=will@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.