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

Commit 34b55c8f authored by Rohit Vaswani's avatar Rohit Vaswani
Browse files

msm: pil: Fix segment physical address comparison



The PIL must load segments in order of lowest physical address
to highest physical address.  The comparison used to sort the
segment list prior to load is replaced with one that works
for physical addresses above 2GB (0x80000000).  The previous
comparison returned an incorrect result when comparing a
segment with a physical address located below 2GB with one located
above 2GB.

Change-Id: Id648959a1619ad0a7bb7f8f78e1f7164b3693fb6
Acked-by: default avatarKaushik Sikdar <ksikdar@qti.qualcomm.com>
Signed-off-by: default avatarRohit Vaswani <rvaswani@codeaurora.org>
parent 3f0d02d1
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -466,10 +466,16 @@ static int pil_setup_region(struct pil_priv *priv, const struct pil_mdt *mdt)

static int pil_cmp_seg(void *priv, struct list_head *a, struct list_head *b)
{
	int ret = 0;
	struct pil_seg *seg_a = list_entry(a, struct pil_seg, list);
	struct pil_seg *seg_b = list_entry(b, struct pil_seg, list);

	return seg_a->paddr - seg_b->paddr;
	if (seg_a->paddr < seg_b->paddr)
		ret = -1;
	else if (seg_a->paddr > seg_b->paddr)
		ret = 1;

	return ret;
}

static int pil_init_mmap(struct pil_desc *desc, const struct pil_mdt *mdt)