<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - DisplayPort MST (multi-stream transport) "atomic sleep" Linux kernel bug"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89366">89366</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>DisplayPort MST (multi-stream transport) "atomic sleep" Linux kernel bug
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DRI
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86 (IA32)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>General
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adam_richter2004@yahoo.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>[This is a slightly edited version of an email that I attempted to send to the
dri-devel mailing list.]

CONFIG_DEBUG_ATOMIC_SLEEP complains about the following locking problem in
linux-4.0-rc1/drivers/gpu/drm/drm_dp_mst_topology.c:

drm_dp_mst_wait_tx_reply --> wait_event_timeout --> check_txmsg_state  -->
mutex_lock

I believe that any function called in the "condition" argument in the
wait_event_timeout macro (in this case, check_txmsg_state) is not allowed to
block when the condition is being evalutated to determine whether to unblock
the process.

I think the problem is real.  On two different computers and three different
DisplayPort MST hubs, plugging in a DisplayPort hub or having it plugged in
from boot time results in a hang within a few minutes of doing a few "xrandr"
commands.

At first glance, it looked to me like it might be safe to remove the
mutex_{,un}lock calls from check_txmsg_state (which is not called from anywhere
else), and change the integer field txmsg->state to be an atomic_t (although
I'd be surprised if there is existing hardware that supports an MST hub where
the accessing that field is not atomic.  However, altough removing those mutex
calls eliminated the complaint from CONFIG_DEBUG_ATOMIC_SLEEP, it also resulted
in the system sometimes seeming to ignore the MST hub and otherwise eventually
getting a kernel memory fault in the DisplayPort MST code or another
spontaneous reset (possibly deadlock follwed by a watchdog reset).

Advice is welcome, although I am not blocked in my own efforts to analyze this
further.  I plan to post updates when I have more news.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>