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

Commit 38cf9ce3 authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

qcom: pil-msa: Move freeing DMA memory till after MBA authenticates image



Although the MBA image is copied and executed from L2 memory,
the 1MB of DDR memory that was initially allocated for the
image is still used by MBA.
Thus move freeing this memory from the init_image operation
till until the auth_and_reset operation is successful.

Change-Id: I578bc6fc89c501d02ab25c50f32f52c5b6e386ce
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 7438ce4e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -351,8 +351,6 @@ int pil_mss_reset_load_mba(struct pil_desc *pil)
		goto err_mss_reset;
	}

	/* The MBA doesn't run from DDR, free the memory now. */
	dma_free_coherent(pil->dev, MBA_SIZE, drv->mba_virt, drv->mba_phys);
	release_firmware(fw);

	return 0;
@@ -459,6 +457,10 @@ static int pil_msa_mba_auth(struct pil_desc *pil)
		ret = -EINVAL;
	}

	if (drv->q6->mba_virt)
		/* Reclaim MBA memory. */
		dma_free_coherent(pil->dev, MBA_SIZE, drv->q6->mba_virt,
							drv->q6->mba_phys);
	return ret;
}