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

Commit 64ed0904 authored by Jilai Wang's avatar Jilai Wang Committed by Blagovest Kolenichev
Browse files

msm: npu: Remove explicit usage of __iormb()



Explicit usage of the __iormb() is not advisable, as the
implementation of this function is architecture specific,
which will result in build failures if the signature of
__iormb() changes on a particular architecture.

Thus, replace explicit usages of readl_relaxed(), followed by
__iormb() with the readl() wrappers, as this achieves the
same effect, while abstracting the internal implementation
of __iormb().

Change-Id: I2422d3b30f2a350c376b1c6a1245aa0d441020e0
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parent a0c8d6ec
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -33,8 +33,7 @@ uint32_t npu_core_reg_read(struct npu_device *npu_dev, uint32_t off)
{
	uint32_t ret = 0;

	ret = readl_relaxed(npu_dev->core_io.base + off);
	__iormb();
	ret = readl(npu_dev->core_io.base + off);
	return ret;
}

@@ -48,8 +47,7 @@ uint32_t npu_bwmon_reg_read(struct npu_device *npu_dev, uint32_t off)
{
	uint32_t ret = 0;

	ret = readl_relaxed(npu_dev->bwmon_io.base + off);
	__iormb();
	ret = readl(npu_dev->bwmon_io.base + off);
	return ret;
}

@@ -64,10 +62,8 @@ uint32_t npu_qfprom_reg_read(struct npu_device *npu_dev, uint32_t off)
{
	uint32_t ret = 0;

	if (npu_dev->qfprom_io.base) {
		ret = readl_relaxed(npu_dev->qfprom_io.base + off);
		__iormb();
	}
	if (npu_dev->qfprom_io.base)
		ret = readl(npu_dev->qfprom_io.base + off);

	return ret;
}