SUPERH platform development
 help / color / mirror / Atom feed
From: takashi.yoshii.zj@renesas.com
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] serial: sh-sci: report CTS as active for get_mctrl
Date: Wed, 24 Aug 2011 11:04:00 +0000	[thread overview]
Message-ID: <4E54DAA0.4030008@renesas.com> (raw)
In-Reply-To: <4E536466.6020604@renesas.com>

Hi,

> This looks reasonable, but what application specifically was hitting
> this? ...

Well, it was detected by pure test. So, actually, nobody is in trouble :)
But I think it occurs on anything that use hardware flow control and write(TX).
Even shell terminal session does. Try invoke "stty crtscts" on your shell.
It will freeze your terminal session whatever its flow control setting is.
Or, do like as followings on ssh session, is safer.
 $ stty -F /dev/ttySC1 clocal crtscts -echo
 $ echo x > /dev/ttySC1
Output 'x' on serial expected, but it stops and no output.

To make things clearer, I've made following test program and ran on sh7785lcr with
free ttySC1 (not used for console, nor shell).

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termios.h>
main(){
        struct termios t;
        int fd = open("/dev/ttySC1", O_RDWR);
        tcgetattr(fd, &t);
        t.c_cflag |= CRTSCTS;
        tcsetattr(fd, TCSANOW, &t);
        write(fd, "x", 1);
        close(fd);
}

Output 'x' and exit, is expected.
But no output and stops during "close" on last line.
More precisely, it is waiting for event on tty->write_wait at uart_close().

(In addition to close(), ioctl() will be also a case. It waits for outputs done)

/yoshii

  parent reply	other threads:[~2011-08-24 11:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23  8:27 [PATCH] serial: sh-sci: report CTS as active for get_mctrl Yoshii Takashi
2011-08-23 10:31 ` Paul Mundt
2011-08-24 11:04 ` takashi.yoshii.zj [this message]
2011-08-29  7:25 ` Paul Mundt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E54DAA0.4030008@renesas.com \
    --to=takashi.yoshii.zj@renesas.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox