mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Paul Hardwick <p.hardwick@option.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: nozomi: ERESTARTSYS to userspace?
Date: Mon, 8 Oct 2007 13:02:20 +0100	[thread overview]
Message-ID: <20071008130220.78b265f2@the-village.bc.nu> (raw)
In-Reply-To: <470A05DF.5080405@gmail.com>

>         if (unlikely(down_trylock(&port->tty_sem))) {
>                 /*
>                  * must test lock as tty layer wraps calls
>                  * to this function with BKL
>                  */
>                 dev_err(&dc->pdev->dev, "Would have deadlocked - "
>                         "return ERESTARTSYS\n");
>                 return -ERESTARTSYS;
>         }
> 
> The use of ERESTARTSYS seems bogus to me, no signal is pending and this flag
> would reach userspace (that is not permitted), am I right?

serial driver write methods are called from the ldisc not the tty so the
code is in fact totally bogus.

I suspect what is needed (other than to take the entire driver to bits
and put it back together using serial_core) is 

	if (down_trylock(&port->tty_sem))
		return 0;

and the driver is then required to wake the write wait queue when that
condition becomes false - or at least before/when it runs out of
data (which currently it doesn't seem to for all cases).

Lots of other breakage in it as well (termios function is totally bogus,
tty_flip_queue_function is a no-op) etc etc

Alan

      reply	other threads:[~2007-10-08 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 10:26 Jiri Slaby
2007-10-08 12:02 ` Alan Cox [this message]

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=20071008130220.78b265f2@the-village.bc.nu \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.hardwick@option.com \
    /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

all inboxes | Powered by JetHome®