All of lore.kernel.org
 help / color / mirror / Atom feed
* artpec.c / serial_core.c hardware flow control problem
@ 2012-06-28 15:29 Mikael Johansson
  2012-06-28 16:24 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Johansson @ 2012-06-28 15:29 UTC (permalink / raw)
  To: linux-serial; +Cc: Mikael Starvik, Jesper Nilsson, Johan Adolfsson

Greetings,

We have a problem with drivers/serial/artpec.c (Not yet in main tree) 
which uses hardware supported flow control (XON/XOFF). We do cfmakeraw() 
and tcsetattr() from userspace to set a termios struct where (c_iflag & 
IXON) is not set. The problem is that the call to tcsetattr() is not 
propagated down to serial_artpec_set_termios(), the reason being that 
uart_set_termios() doesn't think that IXON is a RELEVANT_IFLAG and 
returns prematurely instead of calling uart_change_speed --> 
ops->set_termios().

Could this be fixed by making IXON a RELEVANT_IFLAG?:

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 7f28307..d45473d 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1211,7 +1211,7 @@ static void uart_set_termios(struct tty_struct *tty,
       * bits in c_cflag; c_[io]speed will always be set
       * appropriately by set_termios() in tty_ioctl.c
       */
-#define RELEVANT_IFLAG(iflag)    ((iflag) & 
(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
+#define RELEVANT_IFLAG(iflag)    ((iflag) & 
(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|IXON))
      if ((cflag ^ old_termios->c_cflag) == 0 &&
          tty->termios->c_ospeed == old_termios->c_ospeed &&
          tty->termios->c_ispeed == old_termios->c_ispeed &&


Or should it be fixed at some other level?

Note: This was tested on 2.6.35 but appears to have the same code in the 
newer kernels. Not many drivers seem to look at the IXON flag, only 
crisv10, omap_serial and jsm_neo.

Best regards,
Mikael Johansson


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-29 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 15:29 artpec.c / serial_core.c hardware flow control problem Mikael Johansson
2012-06-28 16:24 ` Alan Cox
2012-06-29 15:16   ` Johan Adolfsson
2012-06-29 16:31     ` Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.