From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757018AbdELTfY (ORCPT ); Fri, 12 May 2017 15:35:24 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35625 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756712AbdELTfX (ORCPT ); Fri, 12 May 2017 15:35:23 -0400 Date: Fri, 12 May 2017 20:35:18 +0100 From: Okash Khawaja To: Alan Cox Cc: Greg Kroah-Hartman , Samuel Thibault , linux-kernel@vger.kernel.org, William Hubbs , Chris Brannon , Kirk Reiser , speakup@linux-speakup.org, devel@driverdev.osuosl.org, John Covici Subject: Re: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control Message-ID: <20170512193518.GA25825@sanghar> References: <20170509124040.816526511@gmail.com> <20170509124238.139472887@gmail.com> <20170510204151.43986689@alans-desktop> <20170511082914.GA599@sanghar> <20170511143314.590cb399@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170511143314.590cb399@alans-desktop> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 11, 2017 at 02:33:14PM +0100, Alan Cox wrote: > On Thu, 11 May 2017 09:29:14 +0100 > Okash Khawaja 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