Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65f96fa9 authored by Akhil P Oommen's avatar Akhil P Oommen
Browse files

msm: Fix address space violation in I/O accessors



Typecasting was ignoring the address space of the I/O address. Use
proper address space while typecasting.

Change-Id: I54442975a8a8e65af576455e96d50199c650f73e
Signed-off-by: default avatarAkhil P Oommen <akhilpo@codeaurora.org>
parent 9fcd72d5
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -107,10 +107,11 @@ static inline u64 __raw_readq_no_log(const volatile void __iomem *addr)

#define __raw_write_logged(v, a, _t) ({ \
	int _ret; \
	void *_addr = (void *)(a); \
	volatile void __iomem *_a = (a); \
	void *_addr = (void __force *)(_a); \
	_ret = uncached_logk(LOGK_WRITEL, _addr); \
	ETB_WAYPOINT; \
	__raw_write##_t##_no_log((v), _addr); \
	__raw_write##_t##_no_log((v), _a); \
	if (_ret) \
		LOG_BARRIER; \
	})
@@ -122,11 +123,12 @@ static inline u64 __raw_readq_no_log(const volatile void __iomem *addr)

#define __raw_read_logged(a, _l, _t)    ({ \
	_t __a; \
	void *_addr = (void *)(a); \
	const volatile void __iomem *_a = (a); \
	void *_addr = (void __force *)(_a); \
	int _ret; \
	_ret = uncached_logk(LOGK_READL, _addr); \
	ETB_WAYPOINT; \
	__a = __raw_read##_l##_no_log(_addr); \
	__a = __raw_read##_l##_no_log(_a); \
	if (_ret) \
		LOG_BARRIER; \
	__a; \