uart_ioctl OOPS with irtty-sir

From: Jean Tourrilhes (jt@bougret.hpl.hp.com)
Date: Thu Apr 03 2003 - 20:34:05 EST


        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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:21 EST