Re: [PATCH] tty: serial_core: Clear TTY_IO_ERROR iftty_port_open()return 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 6, 2016 at 9:45 PM, 陈华才 <chenhc@xxxxxxxxxx> wrote:
> I use a PLX9050 PCI-serial card (I think this problem isn't limited to this card).
> I boot kernel-4.9.0-rc5 with "console=ttyS1,115200 console=tty".
> My distribution is Fedora21 on Loongson (I think X86 have the same problem).
> When I do "echo xxxyyy > /dev/ttyS1" or "stty -F /dev/ttyS1", I get "Input/Output Error".

I've played with a variety of setups, wrestled with systemd creating
gettys, and still can't reproduce this. I only see "Input/Output
Error" if the port doesn't exist (and needs configuration by
setserial).

Can you try something like this:

diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 5cd3cd932293..0be8ad1824ed 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -265,6 +265,8 @@ static void tty_port_shutdown(struct tty_port
*port, struct tty_struct *tty)

                if (port->ops->shutdown)
                        port->ops->shutdown(port);
+
+               set_bit(TTY_IO_ERROR, &tty->flags);
        }
 out:
        mutex_unlock(&port->mutex);
@@ -576,7 +578,6 @@ void tty_port_close(struct tty_port *port, struct
tty_struct *tty,
        if (tty_port_close_start(port, tty, filp) == 0)
                return;
        tty_port_shutdown(port, tty);
-       set_bit(TTY_IO_ERROR, &tty->flags);
        tty_port_close_end(port, tty);
        tty_port_tty_set(port, NULL);
 }

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux