drm/msm/sde: fix deadlock between IRQ lock and node state lock

Deadlock is found when histogram interrupt is being disabled and
at the same time histogram callback function is being called. The
histogram IRQ lock is hold by interrupt thread, and node state
lock is hold by main thread. And each thread is waiting for the
other lock. Change fixes the race condition and add one more state
in node to avoid the interrupt be disabled twice.

And the patch also fix another issue, when Driver receives the request
from userspace to disable histogram irq, and the irq node has already
been deleted from user event list, it will fail to disable the irq. The
change fixes the issue by getting the irq node by container_of instead
of user event list.

Change-Id: If1158e1d916fce4d79248b082a15b7590b54bab6
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
3 files changed