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

Commit 174d2cab authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "gpu: ion: Don't recursively take secure chunk lock"

parents ae07b199 0d2b34e4
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -356,7 +356,14 @@ static int ion_secure_cma_shrinker(struct shrinker *shrinker,
	if (!(sc->gfp_mask & __GFP_MOVABLE))
		return atomic_read(&sheap->total_pool_size);

	mutex_lock(&sheap->chunk_lock);
	/*
	 * Allocation path may invoke the shrinker. Proceeding any further
	 * would cause a deadlock in several places so don't shrink if that
	 * happens.
	 */
	if (!mutex_trylock(&sheap->chunk_lock))
		return -1;

	list_for_each_safe(entry, _n, &sheap->chunks) {
		struct ion_cma_alloc_chunk *chunk = container_of(entry,
					struct ion_cma_alloc_chunk, entry);