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

Commit f5a93341 authored by Liam Mark's avatar Liam Mark
Browse files

ion: ensure prefetch/drain requests are processed in order



Currently when there is an ION prefetch or drain request we are adding
them to the start of the prefetch_list list.

This can cause the requests to be processed in the wrong order, for
example if there is a prefetch request made followed by a drain request
(before the prefetch request has been processed) the the drain request
will be handled first.

Ensure prefetch and drain requests are processed in order by appending
requests to the end of the prefetch_list list

Change-Id: I935a0d69a52267e888e9b19e1e8c0d9bd68e295b
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent e5f7df23
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/*
 *
 * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -285,7 +285,7 @@ static int __ion_system_secure_heap_resize(struct ion_heap *heap, void *ptr,
		spin_unlock_irqrestore(&secure_heap->work_lock, flags);
		goto out_free;
	}
	list_splice_init(&items, &secure_heap->prefetch_list);
	list_splice_tail_init(&items, &secure_heap->prefetch_list);
	queue_delayed_work(system_unbound_wq, &secure_heap->prefetch_work,
			   shrink ?  msecs_to_jiffies(SHRINK_DELAY) : 0);
	spin_unlock_irqrestore(&secure_heap->work_lock, flags);