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

Commit 0e8d8e60 authored by Jilai Wang's avatar Jilai Wang Committed by Ivaylo Georgiev
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: Ib88f7981652a55975562fb59fb0e72acddc99223
Signed-off-by: default avatarIvaylo Georgiev <irgeorgiev@codeaurora.org>
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent f048dfe1
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -26,8 +26,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;
}

@@ -41,8 +40,7 @@ uint32_t npu_qdsp_reg_read(struct npu_device *npu_dev, uint32_t off)
{
	uint32_t ret = 0;

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

@@ -56,8 +54,7 @@ uint32_t npu_apss_shared_reg_read(struct npu_device *npu_dev, uint32_t off)
{
	uint32_t ret = 0;

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

@@ -72,8 +69,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;
}

@@ -88,10 +84,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;
}