linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Russell King <rmk@arm.linux.org.uk>
Subject: uart_ioctl OOPS with irtty-sir
Date: Thu, 3 Apr 2003 17:34:05 -0800	[thread overview]
Message-ID: <20030404013405.GA19446@bougret.hpl.hp.com> (raw)

	Hi Russel,

	Sorry to bring more bad news...

	In 2.5.66, somebody (maybe you) added a check to
tty_hung_up_p(filp) in uart_ioctl().
	The code now looks like this (drivers/serial/core.c) :
------------------------------------
static int
uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
	   unsigned long arg)
{
[...]
	if (tty_hung_up_p(filp)) {
		ret = -EIO;
		goto out_up;
	}
[...]
	switch (cmd) {
	case TIOCMSET:
		ret = uart_set_modem_info(state->port, cmd,
					  (unsigned int *)arg);
		break;
------------------------------------

	Unfortunately, the irtty-sir driver, which is a TTY line
discipline and a network driver, need to be able to change the RTS and
DTR line from a kernel thread.
	The code looks like (drivers/net/irda/irtty-sir.c) :
----------------------------
static int irtty_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
{
[...]
	if (priv->tty->driver.ioctl(priv->tty, NULL, TIOCMSET, (unsigned long) &arg)) { 
		IRDA_DEBUG(2, "%s(), error doing ioctl!\n", __FUNCTION__);
	}
----------------------------

	You can guess the result : instant OPPS.


	I don't really see how I would be able to get hold of a "struct
file" in kernel space, so please advise.

	Have fun, and thanks in advance...

	Jean

             reply	other threads:[~2003-04-04  1:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04  1:34 Jean Tourrilhes [this message]
2003-04-04  9:25 ` uart_ioctl OOPS with irtty-sir Russell King
2003-04-04 17:24   ` Jean Tourrilhes
2003-04-08 17:44   ` Jean Tourrilhes
2003-04-13 16:04     ` Russell King
2003-04-14 16:30       ` Jean Tourrilhes
2003-04-13 16:51     ` Russell King
2003-04-14 16:31       ` Jean Tourrilhes
2003-04-10  2:29   ` Jean Tourrilhes

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=20030404013405.GA19446@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).