stm class: Fix locking in unbinding policy path
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 22 Dec 2015 15:25:18 +0000 (17:25 +0200)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 1 Jun 2016 21:28:39 +0000 (15:28 -0600)
commitdf313b9ca8b14575387fbe53e5609caacde3e243
treed4314378c495ee3d811f4b0c8239808aa1016e51
parent51d81f32321e52023849e73a7ea777f89757e6f3
stm class: Fix locking in unbinding policy path

Right now, if stm device removal has to unbind from a policy (that is,
an stm device that has STP policy, gets removed), it will trigger a
nested lock on the stm device's policy mutex.

This patch fixes the problem by moving the locking from the policy
unbinding to policy removal (configfs path), where it's actually needed;
the other caller of the policy unbinding function already takes the
mutex around the call.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4c127fd16e6b33ecb7badc091480c84ea9aebeb6)
drivers/hwtracing/stm/policy.c