Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9270171imu; Wed, 5 Dec 2018 01:51:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/UQw8yYtRuQ36faqTU0zbYoKQ3M60HaU9uK03qNBYZ0TIgUxe6OvxVZC9Vkz2c45EI0K1wV X-Received: by 2002:aa7:8203:: with SMTP id k3mr23126300pfi.192.1544003502711; Wed, 05 Dec 2018 01:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544003502; cv=none; d=google.com; s=arc-20160816; b=tco5hgxUnIKDEMiYoG9iEPzhU1z8BWAjq/U7uQrsz2iHaH0n9TDMRMj2ec3LxMR/8W iWZwFAprbO0TpFKAJQoyL/dg/wWl5RyoGF9MIhkHsAihIOPJ5A9KPb2U9MNZySvDu9kn P9L2McwXBI/PXiIH7TPDIymjt/v1yr+AY8u8+s1tFEJn75uNV0fb1squ1HSHIy8Z4B6Y FyRWIvzk/2J+M9C1UpOPNbO4nBac76I/uqNYKYi75oNCUsaXS1x9Exvq77JCARmcTmh1 fZp6r0YKSTYI3T5DGnUY5j6bWXdfcu88pgXoiWwRK2u6lh2vFItl8Xr3eHQ4EBCu+ODG w8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RYISLgGXnU6gBBNeqHLvv96XBNp05noLEvvRTVgHeUY=; b=y2q+gNfGZpLIx5c0d0cKDSJAklRkvx00ecB9Ei4ipM4gHb8T2ZYiQ3gHze6CLDPk38 1O7lTzFynyFr1+Wcgi1chPAiqX0TeSOk3CULUKZ0hXng05QWd83rl2Ps/YwtTX54FIpK dLbGYGrzsm95ichoKDC+HS12jhcHtiVM/q0z0GThTLsZ3UFhey4eiPzyHZ+FWy7jCBPq pw5gKz28FXKtbCGqV0Yfr4fOJgUd0Mx5YUDrHQ3Mfw29olmDfedg3QQEyLTZ3k+yurqA OF70UNufUs4NwaK7TH8LF9FKrgy2z5cjdDT+6Ud9eslT6LiLhEl4YgG1sMaIcliEtIsr 14cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=btUfF8zy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si19861564pfk.287.2018.12.05.01.51.27; Wed, 05 Dec 2018 01:51:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=btUfF8zy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729241AbeLEJuy (ORCPT + 99 others); Wed, 5 Dec 2018 04:50:54 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41945 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729257AbeLEJuw (ORCPT ); Wed, 5 Dec 2018 04:50:52 -0500 Received: by mail-lj1-f196.google.com with SMTP id k15-v6so241830ljc.8; Wed, 05 Dec 2018 01:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RYISLgGXnU6gBBNeqHLvv96XBNp05noLEvvRTVgHeUY=; b=btUfF8zyRrk16dxB/76Ldk++VbfYrCa6YAmGeD3Rh5zSIBtTYDai5fsMHxzFlptGxO DZxDV9J5x5IsxBw4BBhZ07uNHkBu7NVklxzbolfIXdfC1ql9gz9n1YmrSd6+Na3X3Qyv tkLREYis2X8B94CORkF5I4d7RNcHQxZ5cF1PcPesr8hQUrWMdd5mbKUdvt2sSncAupHB pFrQwUUIRntAW2oFnkz4nI6h1ehmp/YzUSFQreHISVMz3xzJ3AuxKhiOh+Yqg19k3OiA S8KKtOSMQKFJ9kNkQH3zlg7p4+B4p+LvZW+fQ64SIYt2dPcjNiHxskT9tm9py8Qpa3AJ 3/3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=RYISLgGXnU6gBBNeqHLvv96XBNp05noLEvvRTVgHeUY=; b=BGjKvOHwUXFBCmTcv5DNfuuDEsVQ1Xlj6nM4ARbuBAZ1tUJpSS/senjtzOB75ohTnF vOeX+Iy7L3WpJyC4JmuaDTK1NUC3eqCZuuZrBmSf4ANpx8uP7wfcMDSsDZPTqP8SCi/L KorBW5QDrOqwNDjPqs+DGcrDQv/JIxNJUz6g98kij5Tqk2cW4sKTMoUbIf6K5PqQy2MS dUdSqK59jofypzbmWch2vZ0hmAKpDyOTcatTfiPqOAhytj1ObgWqm3DF2GvOgOWhwdKV qyybpuOUuhXd9okpf9E4Idfw/0rY6ebmgyh/WORgrDFU8jebZshbhRKrfl/2gQIFECjz RI0A== X-Gm-Message-State: AA+aEWZO8xDQVQeqWeOUiTcBIYdmjvWlPuNa7tmSiuqV319gE60mXP/b Hpo0VOX2tW6LGdWfqdDa+yI= X-Received: by 2002:a2e:2b85:: with SMTP id r5-v6mr14694355ljr.91.1544003448380; Wed, 05 Dec 2018 01:50:48 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id e13-v6sm3657021ljk.53.2018.12.05.01.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 01:50:47 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gUTpR-00047L-Fa; Wed, 05 Dec 2018 10:50:49 +0100 Date: Wed, 5 Dec 2018 10:50:49 +0100 From: Johan Hovold To: Jarkko Nikula Cc: Johan Hovold , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Jiri Slaby , linux-kernel@vger.kernel.org, stable , Florian Zumbiehl Subject: Re: [PATCH] USB: serial: console: fix reported terminal settings Message-ID: <20181205095049.GA15689@localhost> References: <20181204155904.GC18087@localhost> <20181204160036.24625-1-johan@kernel.org> <20181204161518.GA17941@kroah.com> <20181204163155.GD18087@localhost> <4e395eb4-739a-05df-e14d-e32f9cfefdd3@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e395eb4-739a-05df-e14d-e32f9cfefdd3@linux.intel.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 11:36:52AM +0200, Jarkko Nikula wrote: > On 12/4/18 6:31 PM, Johan Hovold wrote: > > On Tue, Dec 04, 2018 at 05:15:18PM +0100, Greg Kroah-Hartman wrote: > >> On Tue, Dec 04, 2018 at 05:00:36PM +0100, Johan Hovold wrote: > >>> The USB-serial console implementation has never reported the actual > >>> terminal settings used. Despite storing the corresponding cflags in its > >>> struct console, this was never honoured on later tty open() where the > >>> tty termios would be left initialised to the driver defaults. > >>> > >>> Unlike the serial console implementation, the USB-serial code calls > >>> subdriver open() already at console setup. While calling set_termios() > >>> before open() looks like it could work for some USB-serial drivers, > >>> others definitely do not expect this, so modelling this after serial > >>> core is going to be intrusive, if at all possible. > >>> This specifically fixes a regression that was triggered by a recent > >>> change adding software flow control to the pl2303 driver: a getty trying > >>> to disable flow control while leaving the baud rate unchanged would now > >>> also set the baud rate to the driver default (prior to the flow-control > >>> change this had been a noop). > >>> > >>> Fixes: 7041d9c3f01b ("USB: serial: pl2303: add support for tx xon/xoff flow control") > >>> Cc: stable # 4.18 > >>> Reported-by: Jarkko Nikula > >>> Cc: Florian Zumbiehl > >>> Signed-off-by: Johan Hovold > >>> --- > >>> drivers/tty/tty_io.c | 11 +++++++++-- > >>> drivers/usb/serial/console.c | 2 +- > >>> include/linux/tty.h | 1 + > >>> 3 files changed, 11 insertions(+), 3 deletions(-) > >> > >> Ah, messy :) > >> > >> Want me to take this through my tty tree? > > > > If you prefer. I was planning on including this in a USB-serial pull > > request for -rc6 since it fixes a user-reported regression, but perhaps > > taking this through your tty-linus branch (which already holds a console > > fix) is easier/faster. > > > > We should wait for Jarkko to confirm that this fixes the problem he > > reported first, though. > > > Great, this fixed the issue for both pl2303 based adapters I reported. > > Tested on top of 0072a0c14d5b ("Merge tag 'media/v4.20-4' of > git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media") > > Tested-by: Jarkko Nikula Great, thanks for testing. Greg, I noticed I left out the part about subdrivers not expecting *write()* to be called before open() so I'll amend the commit message when applying and include this one in a pull-request tomorrow, if that's ok with you? Note that the changes to tty are trivial; I'm just renaming and exporting an existing helper. Thanks, Johan