]> git.baikalelectronics.ru Git - kernel.git/commit
drm: bridge/dw_hdmi: fix phy enable/disable handling
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 5 Jun 2015 11:22:46 +0000 (12:22 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 18 Aug 2015 10:33:58 +0000 (11:33 +0100)
commit221b09ec28fa7aba63b833e251a99c0e4840394d
treece8d2a4178dc5fc48aa51f24827cd218b5468125
parent55b8ec5fc13070557b5d82a3cd49b15f0fb24ded
drm: bridge/dw_hdmi: fix phy enable/disable handling

The dw_hdmi enable/disable handling is particularly weak in several
regards:
* The hotplug interrupt could call hdmi_poweron() or hdmi_poweroff()
  while DRM is setting a mode, which could race with a mode being set.
* Hotplug will always re-enable the phy whenever it detects an active
  hotplug signal, even if DRM has disabled the output.

Resolve all of these by introducing a mutex to prevent races, and a
state-tracking bool so we know whether DRM wishes the output to be
enabled.  We choose to use our own mutex rather than ->struct_mutex
so that we can still process interrupts in a timely fashion.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/gpu/drm/bridge/dw_hdmi.c