From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 780621F0C51; Fri, 12 May 2017 15:35:41 -0400 (EDT) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by befuddled.reisers.ca (Postfix) with ESMTPS id A40601EFDC7 for ; Fri, 12 May 2017 15:35:39 -0400 (EDT) Received: by mail-wr0-f193.google.com with SMTP id 6so8524141wrb.1 for ; Fri, 12 May 2017 12:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=N6flFiJiB3DWCOGOtdrx0ONLU7KJ573723rKnjc4pws=; b=mURI0nQnjZtf7xtddl0DHmBYeS/zpuN0ymdB1ot3zyb2VDif/zYMgESM/FOyearupH WhsSzOvm8teykeb2SvoxdAWx2SJ/YXtjR0SMeqeQui3I/3flL4DC5tnasOOBr+RRkTNq V2Fq0LKcTj5Pq1/c06D8EmvoONSW24zzTN0JDUySEFII76NpyG68RMTuTpSMiITljcpx G3CFbZh9gyMHGkXHKoDEu5AxyFyYhOKOimhmctg7N3IMafU3oWYRZJxfxOMd45/2zmLB Z3JtXAolYbpwXkbIbP2e8TYZ7rQp5Cj2sWpYPU/l2Z4WwuRi1t+6Il/iMapF8w3u2cX6 pYTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=N6flFiJiB3DWCOGOtdrx0ONLU7KJ573723rKnjc4pws=; b=UPfsoC8D08xGLxnNsEekYAjMRBgDwPdCtiqpQHjgQY8sAm2UTvyj4h85hQQWpEdFu1 z7iY/BsJxAMm9MBIyIDjXHHDjAbGnzyiT6cPwrtC50qQ0r8ew3rNIuc6yy9K8OSlgGDt D1xziFZa5opEe2nH+QceO/uursauHpl5OLPUXFcjOHi77YJV3Idjrw1Z/H5YNHsbzdk7 SECHoIKdFlTXjZJTO2cxv+vnMYk+okDuMeFypaba1k1OXghNFQC6/VCvfHg/kKZK0t/u XUqUYAPyKv8SvdoUE+3TFKH76a+LnuPrdKIQh/dfLEuSUBEmuhqfCO2sCvvkZ6qYyMqh EWmw== X-Gm-Message-State: AODbwcAMISOQmp4Ws48soO9wJNkr+oID3sKCaFWwGsW2KlJlcfHrQVcR 6Mxx5Kd2AqSH4Q== X-Received: by 10.223.150.179 with SMTP id u48mr4072006wrb.195.1494617722014; Fri, 12 May 2017 12:35:22 -0700 (PDT) Received: from sanghar (host81-132-222-115.range81-132.btcentralplus.com. [81.132.222.115]) by smtp.gmail.com with ESMTPSA id 203sm3954998wmv.18.2017.05.12.12.35.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 May 2017 12:35:20 -0700 (PDT) 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2017 19:35:41 -0000 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