<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 05/29/2013 04:50 PM, Stefan Zegenhagen wrote:
    <blockquote cite="mid:1369839043.3947.26.camel@ax-sze" type="cite">
      <pre wrap="">Dear all,

we've stumbled across a small problem.

One of our devices does not like 'to_erl' to be run over a serial port.
When to_erl is started, we see "Attaching to /tm<0xFF>" being printed
and the device then refuses to accept any input. Occasionally, we have
seen a linux kernel error message "serial8250: too much work for irq16"
simultaneously. After some debugging we found out that cause is a call
to tcsetattr() by to_erl, immediately preceeded by some printf().

The UART in our device doesn't like hardware parameters to be changed
while output is concurrently active. In fact, the GNU libc manual also
mentions that it might be dangerous to change UART hardware parameters
when a transmission is ongoing.

The patch attached to this e-mail changes the behaviour of to_erl to use
TCSADRAIN instead of TCSANOW when changing terminal parameters. This
makes the serial driver wait for the output queues to be empty before
applying the terminal parameter change.


Kind regards,

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-patches mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/listinfo/erlang-patches</a>
</pre>
    </blockquote>
    Hello Stefan,<br>
    Your patch should soon be visible in the 'pu' branch. <br>
    Thanks,<br>
    <br>
    <pre class="moz-signature" cols="72">-- 

BR Fredrik Gustafsson
Erlang OTP Team</pre>
  </body>
</html>