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

Commit 997a6547 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ion: Use a freezable unbound workqueue for the memory prefetch work items"

parents 79fe7870 48a845e5
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ struct ion_system_secure_heap {
	bool destroy_heap;
	struct list_head prefetch_list;
	struct delayed_work prefetch_work;
	struct workqueue_struct *prefetch_wq;
};

struct prefetch_info {
@@ -270,7 +271,8 @@ static int __ion_system_secure_heap_resize(struct ion_heap *heap,
		goto out_free;
	}
	list_splice_tail_init(&items, &secure_heap->prefetch_list);
	queue_delayed_work(system_unbound_wq, &secure_heap->prefetch_work,
	queue_delayed_work(secure_heap->prefetch_wq,
			   &secure_heap->prefetch_work,
			   shrink ?  msecs_to_jiffies(SHRINK_DELAY) : 0);
	spin_unlock_irqrestore(&secure_heap->work_lock, flags);

@@ -345,6 +347,15 @@ struct ion_heap *ion_system_secure_heap_create(struct ion_platform_heap *unused)
	INIT_LIST_HEAD(&heap->prefetch_list);
	INIT_DELAYED_WORK(&heap->prefetch_work,
			  ion_system_secure_heap_prefetch_work);

	heap->prefetch_wq = alloc_workqueue("system_secure_prefetch_wq",
					    WQ_UNBOUND | WQ_FREEZABLE, 0);
	if (!heap->prefetch_wq) {
		pr_err("Failed to create system secure prefetch workqueue\n");
		kfree(heap);
		return ERR_PTR(-ENOMEM);
	}

	return &heap->heap.ion_heap;
}