2019-05-29 07:18:00 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2017-07-10 18:02:19 -07:00
|
|
|
/*
|
|
|
|
* {read,write}{b,w,l,q} based on arch/arm64/include/asm/io.h
|
|
|
|
* which was based on arch/arm/include/io.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 1996-2000 Russell King
|
|
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
|
|
* Copyright (C) 2014 Regents of the University of California
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_RISCV_IO_H
|
|
|
|
#define _ASM_RISCV_IO_H
|
|
|
|
|
2017-11-29 17:55:14 -08:00
|
|
|
#include <linux/types.h>
|
2020-06-08 21:32:38 -07:00
|
|
|
#include <linux/pgtable.h>
|
2020-06-08 21:32:42 -07:00
|
|
|
#include <asm/mmiowb.h>
|
2020-09-17 15:37:11 -07:00
|
|
|
#include <asm/early_ioremap.h>
|
2017-11-29 17:55:14 -08:00
|
|
|
|
2017-07-10 18:02:19 -07:00
|
|
|
/*
|
riscv: separate MMIO functions into their own header file
Separate the low-level MMIO static inline functions and macros, such
as {read,write}{b,w,l,q}(), into their own header file under
arch/riscv/include: asm/mmio.h. This is done to break a header
dependency chain that arises when both asm/pgtable.h and asm/io.h are
included by asm/timex.h. Since the problem is related to the legacy
I/O port support in asm/io.h, this allows files under arch/riscv that
encounter those issues to simply include asm/mmio.h instead, and
bypass the legacy I/O port functions. Existing users of asm/io.h
don't need to change anything, since asm/mmio.h is included by
asm/io.h.
While here, clean up some checkpatch.pl-related issues with the
original code.
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
2019-10-28 13:53:50 -07:00
|
|
|
* MMIO access functions are separated out to break dependency cycles
|
|
|
|
* when using {read,write}* fns in low-level headers
|
2017-07-10 18:02:19 -07:00
|
|
|
*/
|
riscv: separate MMIO functions into their own header file
Separate the low-level MMIO static inline functions and macros, such
as {read,write}{b,w,l,q}(), into their own header file under
arch/riscv/include: asm/mmio.h. This is done to break a header
dependency chain that arises when both asm/pgtable.h and asm/io.h are
included by asm/timex.h. Since the problem is related to the legacy
I/O port support in asm/io.h, this allows files under arch/riscv that
encounter those issues to simply include asm/mmio.h instead, and
bypass the legacy I/O port functions. Existing users of asm/io.h
don't need to change anything, since asm/mmio.h is included by
asm/io.h.
While here, clean up some checkpatch.pl-related issues with the
original code.
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
2019-10-28 13:53:50 -07:00
|
|
|
#include <asm/mmio.h>
|
2017-07-10 18:02:19 -07:00
|
|
|
|
2019-10-25 08:30:03 +00:00
|
|
|
/*
|
|
|
|
* I/O port access constants.
|
|
|
|
*/
|
2019-10-28 13:10:41 +01:00
|
|
|
#ifdef CONFIG_MMU
|
2019-10-25 08:30:03 +00:00
|
|
|
#define IO_SPACE_LIMIT (PCI_IO_SIZE - 1)
|
|
|
|
#define PCI_IOBASE ((void __iomem *)PCI_IO_START)
|
2019-10-28 13:10:41 +01:00
|
|
|
#endif /* CONFIG_MMU */
|
2019-10-25 08:30:03 +00:00
|
|
|
|
2017-07-10 18:02:19 -07:00
|
|
|
/*
|
|
|
|
* Emulation routines for the port-mapped IO space used by some PCI drivers.
|
|
|
|
* These are defined as being "fully synchronous", but also "not guaranteed to
|
|
|
|
* be fully ordered with respect to other memory and I/O operations". We're
|
|
|
|
* going to be on the safe side here and just make them:
|
|
|
|
* - Fully ordered WRT each other, by bracketing them with two fences. The
|
|
|
|
* outer set contains both I/O so inX is ordered with outX, while the inner just
|
|
|
|
* needs the type of the access (I for inX and O for outX).
|
|
|
|
* - Ordered in the same manner as readX/writeX WRT memory by subsuming their
|
|
|
|
* fences.
|
|
|
|
* - Ordered WRT timer reads, so udelay and friends don't get elided by the
|
|
|
|
* implementation.
|
|
|
|
* Note that there is no way to actually enforce that outX is a non-posted
|
|
|
|
* operation on RISC-V, but hopefully the timer ordering constraint is
|
|
|
|
* sufficient to ensure this works sanely on controllers that support I/O
|
|
|
|
* writes.
|
|
|
|
*/
|
2024-02-17 13:13:16 +00:00
|
|
|
#define __io_pbr() RISCV_FENCE(io, i)
|
|
|
|
#define __io_par(v) RISCV_FENCE(i, ior)
|
|
|
|
#define __io_pbw() RISCV_FENCE(iow, o)
|
|
|
|
#define __io_paw() RISCV_FENCE(o, io)
|
2017-07-10 18:02:19 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Accesses from a single hart to a single I/O address must be ordered. This
|
|
|
|
* allows us to use the raw read macros, but we still need to fence before and
|
|
|
|
* after the block to ensure ordering WRT other macros. These are defined to
|
|
|
|
* perform host-endian accesses so we use __raw instead of __cpu.
|
|
|
|
*/
|
|
|
|
#define __io_reads_ins(port, ctype, len, bfence, afence) \
|
|
|
|
static inline void __ ## port ## len(const volatile void __iomem *addr, \
|
|
|
|
void *buffer, \
|
|
|
|
unsigned int count) \
|
|
|
|
{ \
|
|
|
|
bfence; \
|
|
|
|
if (count) { \
|
|
|
|
ctype *buf = buffer; \
|
|
|
|
\
|
|
|
|
do { \
|
|
|
|
ctype x = __raw_read ## len(addr); \
|
|
|
|
*buf++ = x; \
|
|
|
|
} while (--count); \
|
|
|
|
} \
|
|
|
|
afence; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define __io_writes_outs(port, ctype, len, bfence, afence) \
|
|
|
|
static inline void __ ## port ## len(volatile void __iomem *addr, \
|
|
|
|
const void *buffer, \
|
|
|
|
unsigned int count) \
|
|
|
|
{ \
|
|
|
|
bfence; \
|
|
|
|
if (count) { \
|
|
|
|
const ctype *buf = buffer; \
|
|
|
|
\
|
|
|
|
do { \
|
2017-11-28 14:15:32 -08:00
|
|
|
__raw_write ## len(*buf++, addr); \
|
2017-07-10 18:02:19 -07:00
|
|
|
} while (--count); \
|
|
|
|
} \
|
|
|
|
afence; \
|
|
|
|
}
|
|
|
|
|
2019-02-22 18:04:53 +00:00
|
|
|
__io_reads_ins(reads, u8, b, __io_br(), __io_ar(addr))
|
|
|
|
__io_reads_ins(reads, u16, w, __io_br(), __io_ar(addr))
|
|
|
|
__io_reads_ins(reads, u32, l, __io_br(), __io_ar(addr))
|
2017-07-10 18:02:19 -07:00
|
|
|
#define readsb(addr, buffer, count) __readsb(addr, buffer, count)
|
|
|
|
#define readsw(addr, buffer, count) __readsw(addr, buffer, count)
|
|
|
|
#define readsl(addr, buffer, count) __readsl(addr, buffer, count)
|
|
|
|
|
2019-02-22 18:04:53 +00:00
|
|
|
__io_reads_ins(ins, u8, b, __io_pbr(), __io_par(addr))
|
|
|
|
__io_reads_ins(ins, u16, w, __io_pbr(), __io_par(addr))
|
|
|
|
__io_reads_ins(ins, u32, l, __io_pbr(), __io_par(addr))
|
RISC-V: Make port I/O string accessors actually work
Fix port I/O string accessors such as `insb', `outsb', etc. which use
the physical PCI port I/O address rather than the corresponding memory
mapping to get at the requested location, which in turn breaks at least
accesses made by our parport driver to a PCIe parallel port such as:
PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
causing a memory access fault:
Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008
Oops [#1]
Modules linked in:
CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23
Hardware name: SiFive HiFive Unmatched A00 (DT)
epc : parport_pc_fifo_write_block_pio+0x266/0x416
ra : parport_pc_fifo_write_block_pio+0xb4/0x416
epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60
gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000
t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0
s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000
a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb
a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000
s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50
s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000
s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000
s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930
t5 : 0000000000001000 t6 : 0000000000040000
status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f
[<ffffffff80543212>] parport_pc_compat_write_block_pio+0xfe/0x200
[<ffffffff8053bbc0>] parport_write+0x46/0xf8
[<ffffffff8050530e>] lp_write+0x158/0x2d2
[<ffffffff80185716>] vfs_write+0x8e/0x2c2
[<ffffffff80185a74>] ksys_write+0x52/0xc2
[<ffffffff80185af2>] sys_write+0xe/0x16
[<ffffffff80003770>] ret_from_syscall+0x0/0x2
---[ end trace 0000000000000000 ]---
For simplicity address the problem by adding PCI_IOBASE to the physical
address requested in the respective wrapper macros only, observing that
the raw accessors such as `__insb', `__outsb', etc. are not supposed to
be used other than by said macros. Remove the cast to `long' that is no
longer needed on `addr' now that it is used as an offset from PCI_IOBASE
and add parentheses around `addr' needed for predictable evaluation in
macro expansion. No need to make said adjustments in separate changes
given that current code is gravely broken and does not ever work.
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: fab957c11efe2 ("RISC-V: Atomic and Locking Code")
Cc: stable@vger.kernel.org # v4.15+
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209220223080.29493@angie.orcam.me.uk
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-09-22 22:56:06 +01:00
|
|
|
#define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count)
|
|
|
|
#define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count)
|
|
|
|
#define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
|
2017-07-10 18:02:19 -07:00
|
|
|
|
|
|
|
__io_writes_outs(writes, u8, b, __io_bw(), __io_aw())
|
|
|
|
__io_writes_outs(writes, u16, w, __io_bw(), __io_aw())
|
|
|
|
__io_writes_outs(writes, u32, l, __io_bw(), __io_aw())
|
|
|
|
#define writesb(addr, buffer, count) __writesb(addr, buffer, count)
|
|
|
|
#define writesw(addr, buffer, count) __writesw(addr, buffer, count)
|
|
|
|
#define writesl(addr, buffer, count) __writesl(addr, buffer, count)
|
|
|
|
|
|
|
|
__io_writes_outs(outs, u8, b, __io_pbw(), __io_paw())
|
|
|
|
__io_writes_outs(outs, u16, w, __io_pbw(), __io_paw())
|
|
|
|
__io_writes_outs(outs, u32, l, __io_pbw(), __io_paw())
|
RISC-V: Make port I/O string accessors actually work
Fix port I/O string accessors such as `insb', `outsb', etc. which use
the physical PCI port I/O address rather than the corresponding memory
mapping to get at the requested location, which in turn breaks at least
accesses made by our parport driver to a PCIe parallel port such as:
PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
causing a memory access fault:
Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008
Oops [#1]
Modules linked in:
CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23
Hardware name: SiFive HiFive Unmatched A00 (DT)
epc : parport_pc_fifo_write_block_pio+0x266/0x416
ra : parport_pc_fifo_write_block_pio+0xb4/0x416
epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60
gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000
t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0
s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000
a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb
a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000
s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50
s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000
s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000
s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930
t5 : 0000000000001000 t6 : 0000000000040000
status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f
[<ffffffff80543212>] parport_pc_compat_write_block_pio+0xfe/0x200
[<ffffffff8053bbc0>] parport_write+0x46/0xf8
[<ffffffff8050530e>] lp_write+0x158/0x2d2
[<ffffffff80185716>] vfs_write+0x8e/0x2c2
[<ffffffff80185a74>] ksys_write+0x52/0xc2
[<ffffffff80185af2>] sys_write+0xe/0x16
[<ffffffff80003770>] ret_from_syscall+0x0/0x2
---[ end trace 0000000000000000 ]---
For simplicity address the problem by adding PCI_IOBASE to the physical
address requested in the respective wrapper macros only, observing that
the raw accessors such as `__insb', `__outsb', etc. are not supposed to
be used other than by said macros. Remove the cast to `long' that is no
longer needed on `addr' now that it is used as an offset from PCI_IOBASE
and add parentheses around `addr' needed for predictable evaluation in
macro expansion. No need to make said adjustments in separate changes
given that current code is gravely broken and does not ever work.
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: fab957c11efe2 ("RISC-V: Atomic and Locking Code")
Cc: stable@vger.kernel.org # v4.15+
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209220223080.29493@angie.orcam.me.uk
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-09-22 22:56:06 +01:00
|
|
|
#define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count)
|
|
|
|
#define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count)
|
|
|
|
#define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
|
2017-07-10 18:02:19 -07:00
|
|
|
|
|
|
|
#ifdef CONFIG_64BIT
|
2019-02-22 18:04:53 +00:00
|
|
|
__io_reads_ins(reads, u64, q, __io_br(), __io_ar(addr))
|
2017-07-10 18:02:19 -07:00
|
|
|
#define readsq(addr, buffer, count) __readsq(addr, buffer, count)
|
|
|
|
|
2019-02-22 18:04:53 +00:00
|
|
|
__io_reads_ins(ins, u64, q, __io_pbr(), __io_par(addr))
|
RISC-V: Make port I/O string accessors actually work
Fix port I/O string accessors such as `insb', `outsb', etc. which use
the physical PCI port I/O address rather than the corresponding memory
mapping to get at the requested location, which in turn breaks at least
accesses made by our parport driver to a PCIe parallel port such as:
PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
causing a memory access fault:
Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008
Oops [#1]
Modules linked in:
CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23
Hardware name: SiFive HiFive Unmatched A00 (DT)
epc : parport_pc_fifo_write_block_pio+0x266/0x416
ra : parport_pc_fifo_write_block_pio+0xb4/0x416
epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60
gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000
t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0
s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000
a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb
a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000
s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50
s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000
s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000
s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930
t5 : 0000000000001000 t6 : 0000000000040000
status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f
[<ffffffff80543212>] parport_pc_compat_write_block_pio+0xfe/0x200
[<ffffffff8053bbc0>] parport_write+0x46/0xf8
[<ffffffff8050530e>] lp_write+0x158/0x2d2
[<ffffffff80185716>] vfs_write+0x8e/0x2c2
[<ffffffff80185a74>] ksys_write+0x52/0xc2
[<ffffffff80185af2>] sys_write+0xe/0x16
[<ffffffff80003770>] ret_from_syscall+0x0/0x2
---[ end trace 0000000000000000 ]---
For simplicity address the problem by adding PCI_IOBASE to the physical
address requested in the respective wrapper macros only, observing that
the raw accessors such as `__insb', `__outsb', etc. are not supposed to
be used other than by said macros. Remove the cast to `long' that is no
longer needed on `addr' now that it is used as an offset from PCI_IOBASE
and add parentheses around `addr' needed for predictable evaluation in
macro expansion. No need to make said adjustments in separate changes
given that current code is gravely broken and does not ever work.
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: fab957c11efe2 ("RISC-V: Atomic and Locking Code")
Cc: stable@vger.kernel.org # v4.15+
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209220223080.29493@angie.orcam.me.uk
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-09-22 22:56:06 +01:00
|
|
|
#define insq(addr, buffer, count) __insq(PCI_IOBASE + (addr), buffer, count)
|
2017-07-10 18:02:19 -07:00
|
|
|
|
|
|
|
__io_writes_outs(writes, u64, q, __io_bw(), __io_aw())
|
|
|
|
#define writesq(addr, buffer, count) __writesq(addr, buffer, count)
|
|
|
|
|
|
|
|
__io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
|
RISC-V: Make port I/O string accessors actually work
Fix port I/O string accessors such as `insb', `outsb', etc. which use
the physical PCI port I/O address rather than the corresponding memory
mapping to get at the requested location, which in turn breaks at least
accesses made by our parport driver to a PCIe parallel port such as:
PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
causing a memory access fault:
Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008
Oops [#1]
Modules linked in:
CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23
Hardware name: SiFive HiFive Unmatched A00 (DT)
epc : parport_pc_fifo_write_block_pio+0x266/0x416
ra : parport_pc_fifo_write_block_pio+0xb4/0x416
epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60
gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000
t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0
s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000
a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb
a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000
s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50
s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000
s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000
s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930
t5 : 0000000000001000 t6 : 0000000000040000
status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f
[<ffffffff80543212>] parport_pc_compat_write_block_pio+0xfe/0x200
[<ffffffff8053bbc0>] parport_write+0x46/0xf8
[<ffffffff8050530e>] lp_write+0x158/0x2d2
[<ffffffff80185716>] vfs_write+0x8e/0x2c2
[<ffffffff80185a74>] ksys_write+0x52/0xc2
[<ffffffff80185af2>] sys_write+0xe/0x16
[<ffffffff80003770>] ret_from_syscall+0x0/0x2
---[ end trace 0000000000000000 ]---
For simplicity address the problem by adding PCI_IOBASE to the physical
address requested in the respective wrapper macros only, observing that
the raw accessors such as `__insb', `__outsb', etc. are not supposed to
be used other than by said macros. Remove the cast to `long' that is no
longer needed on `addr' now that it is used as an offset from PCI_IOBASE
and add parentheses around `addr' needed for predictable evaluation in
macro expansion. No need to make said adjustments in separate changes
given that current code is gravely broken and does not ever work.
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: fab957c11efe2 ("RISC-V: Atomic and Locking Code")
Cc: stable@vger.kernel.org # v4.15+
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209220223080.29493@angie.orcam.me.uk
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-09-22 22:56:06 +01:00
|
|
|
#define outsq(addr, buffer, count) __outsq(PCI_IOBASE + (addr), buffer, count)
|
2017-07-10 18:02:19 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <asm-generic/io.h>
|
|
|
|
|
2022-11-14 14:35:34 +05:30
|
|
|
#ifdef CONFIG_MMU
|
2025-02-17 18:38:20 +02:00
|
|
|
#define arch_memremap_wb(addr, size, flags) \
|
2025-02-18 15:49:54 +05:30
|
|
|
((__force void *)ioremap_prot((addr), (size), __pgprot(_PAGE_KERNEL)))
|
2022-11-14 14:35:34 +05:30
|
|
|
#endif
|
|
|
|
|
2017-07-10 18:02:19 -07:00
|
|
|
#endif /* _ASM_RISCV_IO_H */
|