Re: TIOCMGET on a tty that is hung up

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

 



On Wed, Apr 11, 2018 at 11:10:22AM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> I have the following setup:
> 
>  - arm/imx6 based machine
>  - null-modem cable between two uart ports (driver: imx.c)
>  - tested with 4.9 and 4.16
> 
> To test handshaking signals port A's DTR signal is toggled using
> TIOCMSET and then port B's DCD and DSR is read to check if the new level
> is readable there.
> 
> The problem I'm faced now is that this fails sometimes[1] because when A's
> DTR is set inactive the level on B's DCD changes (as expected) and the
> driver calls uart_handle_dcd_change(0) which results in tty_hangup(tty)
> for B. Then when calling ioctl(fd_B, TIOCMGET, ..) the command is
> handled in hung_up_tty_ioctl() which returns -EIO.
> 
> This makes it impossible to reliably get the handshaking state of B and
> I wonder if that is intended. I would have expected that TIOCMGET worked
> independent of the port being hung up or not.

>From what I recall, after hangup happens, you can't do much with the
port like this, sorry.

greg k-h
--
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