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

Commit bc9a8f61 authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

qcom: peripheral-loader: Use iowrite32_copy instead of writeq



Due to stricter alignment restrictions on arm64 targets,
replace the use of writeq with iowrite32_copy to prevent
alignment exceptions while accessing device memory. The
specific access that fails here is an 8byte store to an
address that is not 8 byte aligned.

Change-Id: Ia55ecde572a4f1fa46c3aea5f08db4c5637404c4
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent 563010bc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -461,7 +461,8 @@ static int pil_setup_region(struct pil_priv *priv, const struct pil_mdt *mdt)
	}

	if (priv->info) {
		writeq(priv->region_start, &priv->info->start);
		__iowrite32_copy(&priv->info->start, &priv->region_start,
					sizeof(priv->region_start) / 4);
		writel_relaxed(priv->region_end - priv->region_start,
				&priv->info->size);
	}
@@ -517,9 +518,11 @@ static void pil_release_mmap(struct pil_desc *desc)
{
	struct pil_priv *priv = desc->priv;
	struct pil_seg *p, *tmp;
	u64 zero = 0ULL;

	if (priv->info) {
		writeq(0, &priv->info->start);
		__iowrite32_copy(&priv->info->start, &zero,
					sizeof(zero) / 4);
		writel_relaxed(0, &priv->info->size);
	}