<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2016年08月11日 17:09, Mark yao wrote:<br>
</div>
<blockquote cite="mid:57AC40E0.8080809@rock-chips.com" type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<div class="moz-cite-prefix">On 2016年08月11日 16:32, Russell King -
ARM Linux wrote:<br>
</div>
<blockquote cite="mid:20160811083220.GS1041@n2100.armlinux.org.uk"
type="cite">
<pre wrap="">On Thu, Aug 11, 2016 at 03:54:03PM +0800, Mark Yao wrote:
</pre>
<blockquote type="cite">
<pre wrap="">hdmi->disabled maybe not match to the real hardware status.
->dw_hdmi_bridge_enable()
hdmi->disabled = false;
-->dw_hdmi_update_power()
if (hdmi->rxsense)
force = DRM_FORCE_ON;
else
force = DRM_FORCE_OFF;
hdmi->rxsense maybe false on bridge enable path, then hdmi->disabled
is false, but actually hardware is power off, they are not match.
</pre>
</blockquote>
<pre wrap="">... which is correct. If rxsense is false, it means there is nothing
plugged in, so we don't power the hardware up until something _is_
plugged in.
When something is plugged in, we get the HPD and RXSENSE events, which
will cause dw_hdmi_update_power() to be called.
hdmi->disabled is merely a bit mask of things that would cause us to
want to avoid powering the hardware up when rxsense becomes true.
</pre>
</blockquote>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<span style="color: rgb(51, 51, 51); font-family: arial;
font-size: 16px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px; display:
inline !important; float: none; background-color: rgb(255, 255,
255);">At one moment</span>, if hdmi->rxsense = false,
hdmi->disabled = true, and the hdmi is unplug<br>
<br>
then we plug hdmi:<br>
1, dw_hdmi_irq<br>
--> because disabled is true, so can't not run into the
patch to enable hdmi->rxsense<br>
2, uevent plugin<br>
3, get_connector_detect: <br>
hdmi->disabled is true, so just report status
connected<br>
4, dw_hdmi_bridge_enable<br>
--> set hdmi->disabled = false, but because
hdmi->rxsense is false, so force is power off.<br>
then the userspace thinks the hdmi is power on, but in fact it's
power off.<br>
</blockquote>
if another hdmi irq can happen here, that can break the deadlock,
but I don't see any irq happen after this step.<br>
<br>
<blockquote cite="mid:57AC40E0.8080809@rock-chips.com" type="cite">
5, unplug hdmi<br>
hdmi hardware rxsense status is false, also can't recovery
to true.<br>
all the status back to step 1.<br>
<br>
So the bug is when hdmi->rxsense run into false, hardly to
recovery.<br>
<br>
hdmi->rxsense = true request dw_hdmi_bridge_enable<br>
dw_hdmi_bridge_enable request "hdmi->rxsense == true"<br>
<br>
<pre class="moz-signature" cols="72">--
Mark Yao</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Mark Yao</pre>
</body>
</html>