Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1640711 > unrolled thread

Re: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control

Started byOkash Khawaja <okash.khawaja@gmail.com>
First post2017-05-12 21:40 +0200
Last post2017-05-12 22:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [patch 1/1] staging: speakup: flush tty buffers and ensure  hardware flow control Okash Khawaja <okash.khawaja@gmail.com> - 2017-05-12 21:40 +0200
    Re: [patch 1/1] staging: speakup: flush tty buffers and ensure  hardware flow control Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-05-12 22:30 +0200

#1640711 — Re: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control

FromOkash Khawaja <okash.khawaja@gmail.com>
Date2017-05-12 21:40 +0200
SubjectRe: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control
Message-ID<tGozU-Ud-17@gated-at.bofh.it>
On Thu, May 11, 2017 at 02:33:14PM +0100, Alan Cox wrote:
> On Thu, 11 May 2017 09:29:14 +0100
> Okash Khawaja <okash.khawaja@gmail.com> wrote:
> 
> > Hi Alan,
> > 
> > On Wed, May 10, 2017 at 08:41:51PM +0100, Alan Cox wrote:
> > > > +	if (!(tmp_termios.c_cflag & CRTSCTS)) {
> > > > +		tmp_termios.c_cflag |= CRTSCTS;
> > > > +		ret = tty_set_termios(tty, &tmp_termios);
> > > > +		if (ret)
> > > > +			pr_warn("speakup: Failed to set hardware flow control\n");  
> > > 
> > > You should check the tty c_cflag after the call rather than rely on an
> > > error code. Strictly speaking tty_set_termios should error if no tty bits
> > > are changed by the request but it never has on Linux. Instead check the
> > > tty gave you the result you wanted.  
> > Thanks. I will replace the check for return value with check for c_cflag.
> > 
> > May be we should fix this in tty_set_termios?
> 
> Possibly. It however changes the external kernel ABI. It's also not a
> simple memcmp because any undefined bits must be ignored.
> 
> Make a patch, try it and see what breaks ? If nothing breaks then yes it
> makes sense IMHO too.

Right, thanks for the heads up. I'll see if I get round to doing it. For
external kernel ABI, will we need to check libc implementations of
termios functions? Will that be sufficient?

Thanks,
Okash

[toc] | [next] | [standalone]


#1640733

FromAlan Cox <gnomes@lxorguk.ukuu.org.uk>
Date2017-05-12 22:30 +0200
Message-ID<tGpmi-1v8-11@gated-at.bofh.it>
In reply to#1640711
On Fri, 12 May 2017 20:35:18 +0100
Okash Khawaja <okash.khawaja@gmail.com> wrote:

> On Thu, May 11, 2017 at 02:33:14PM +0100, Alan Cox wrote:
> > On Thu, 11 May 2017 09:29:14 +0100
> > Okash Khawaja <okash.khawaja@gmail.com> wrote:
> >   
> > > Hi Alan,
> > > 
> > > On Wed, May 10, 2017 at 08:41:51PM +0100, Alan Cox wrote:  
> > > > > +	if (!(tmp_termios.c_cflag & CRTSCTS)) {
> > > > > +		tmp_termios.c_cflag |= CRTSCTS;
> > > > > +		ret = tty_set_termios(tty, &tmp_termios);
> > > > > +		if (ret)
> > > > > +			pr_warn("speakup: Failed to set hardware flow control\n");    
> > > > 
> > > > You should check the tty c_cflag after the call rather than rely on an
> > > > error code. Strictly speaking tty_set_termios should error if no tty bits
> > > > are changed by the request but it never has on Linux. Instead check the
> > > > tty gave you the result you wanted.    
> > > Thanks. I will replace the check for return value with check for c_cflag.
> > > 
> > > May be we should fix this in tty_set_termios?  
> > 
> > Possibly. It however changes the external kernel ABI. It's also not a
> > simple memcmp because any undefined bits must be ignored.
> > 
> > Make a patch, try it and see what breaks ? If nothing breaks then yes it
> > makes sense IMHO too.  
> 
> Right, thanks for the heads up. I'll see if I get round to doing it. For
> external kernel ABI, will we need to check libc implementations of
> termios functions? Will that be sufficient?

I think the only way you find out is to try it and run a distro like
that. If it seems ok submit the patch to linux-next with a clear note it
potentially changes the ABI so if people find bugs it can be reverted.

Alan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web