From: Jeffrey Carlyle Date: Fri, 8 Oct 2010 19:49:19 +0000 (-0500) Subject: regulator: avoid deadlock when disabling regulator with supply X-Git-Tag: v2.6.37-rc1~56^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cbf811dfd027bde8504e541d0009c5722b98be5;p=pandora-kernel.git regulator: avoid deadlock when disabling regulator with supply I have a regulator A that sets regulator B as its supply. When I call set_supply to add B as the supply for A, regulator A gets added to the supply_list for regulator B. When I call regulator_disable(A), I end up with a call chain like this: regulator_disable(A) > mutex_lock(A) > _regulator_disable(A) >> _regulator_disable(B) >>> _notifier_call_chain(B) >>>> mutex_lock(A) Which results in dead lock since we are trying to acquire the mutex lock for regulator A which we already hold. This patch addresses this issue by moving the call to disable regulator B outside of the lock aquired inside the initial call to regulator_disable. This change also addresses the issue of not acquiring the mutex for regulator B before calling _regulator_disable(B). Signed-off-by: Jeffrey Carlyle Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- Reading git-diff-tree failed