Commit 717264ba authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

staging: gasket: core: switch to relaxed memory-mapped I/O

Use of readl() is deprecated; readl_relaxed() with appropriate memory
barriers is preferred.  Switch to relaxed reads and writes for better
performance as well.  Memory barriers required for I/O vs. normal
memory access on Apex devices have already been explicitly coded in the
page table routines.
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c258edc
...@@ -590,25 +590,25 @@ const char *gasket_num_name_lookup(uint num, ...@@ -590,25 +590,25 @@ const char *gasket_num_name_lookup(uint num,
static inline ulong gasket_dev_read_64(struct gasket_dev *gasket_dev, int bar, static inline ulong gasket_dev_read_64(struct gasket_dev *gasket_dev, int bar,
ulong location) ulong location)
{ {
return readq(&gasket_dev->bar_data[bar].virt_base[location]); return readq_relaxed(&gasket_dev->bar_data[bar].virt_base[location]);
} }
static inline void gasket_dev_write_64(struct gasket_dev *dev, u64 value, static inline void gasket_dev_write_64(struct gasket_dev *dev, u64 value,
int bar, ulong location) int bar, ulong location)
{ {
writeq(value, &dev->bar_data[bar].virt_base[location]); writeq_relaxed(value, &dev->bar_data[bar].virt_base[location]);
} }
static inline void gasket_dev_write_32(struct gasket_dev *dev, u32 value, static inline void gasket_dev_write_32(struct gasket_dev *dev, u32 value,
int bar, ulong location) int bar, ulong location)
{ {
writel(value, &dev->bar_data[bar].virt_base[location]); writel_relaxed(value, &dev->bar_data[bar].virt_base[location]);
} }
static inline u32 gasket_dev_read_32(struct gasket_dev *dev, int bar, static inline u32 gasket_dev_read_32(struct gasket_dev *dev, int bar,
ulong location) ulong location)
{ {
return readl(&dev->bar_data[bar].virt_base[location]); return readl_relaxed(&dev->bar_data[bar].virt_base[location]);
} }
static inline void gasket_read_modify_write_64(struct gasket_dev *dev, int bar, static inline void gasket_read_modify_write_64(struct gasket_dev *dev, int bar,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment