Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9261561imu; Wed, 5 Dec 2018 01:39:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/VvgB4GJmD+pEayr2RAeE0pKMEIkh0lMkbiPe8Po3hP7BhO816kuqCwGgAoM4CKb8KloVZw X-Received: by 2002:a62:7c47:: with SMTP id x68mr23922306pfc.209.1544002796256; Wed, 05 Dec 2018 01:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544002796; cv=none; d=google.com; s=arc-20160816; b=obIqTv+cVNxTrzaIMiir0CfZolxCWuFioFRne8/byFMGeWEjc0VXxTfvMUdLG+s0oX ZBX7AdlblozYF1aITM/Ds9E7CIoD9OoPvgC+tu1ZS/fWXEl5K0eAchKaZry7yk1NG3wC zlDIltAd+ZpkD+d5P4dimsdpQO3ksiBTqlm+QOH++CBp4UEqtpy9fFM9TJUPME35PJst PAiuTy7M/TOh6KTW/wmVU7knndg1zPu3QWfiEnJucdviScyTo0QA3emRy6SQXejfsxxM cdyXmZJhv+s2Xqv1rBP618c42ykfJDX/tHIOJ/Bz3h3ehhPQeCCE5iUXtzI9oak8FPlq xXig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5Jo6xRcoOT4rlPnjOS5e1c3HNCZ01qeUxVYmDLAiZlI=; b=vdOXht/NtNVYwXf2DHzjXOJj6XX0+gQ0qbgK8hlYOCpHT2JhRL0y1qJ7wOhYjzZWlO HQivRuOug4P6DoEVnQIofFLYPQQcdt1u9QY3b7EhUwi9x9taNNIfydKnXs8PcqkF3qqg S1ddLHMQ5JX9SEE7h2xNbnDWgtqQ2s6vSI7q+EkfKaCQnxEhx+OvzWLlfXB/Jh14sZp7 S3KZMxlVIUK+/xkOuUfRdbVe62AxdBLZvNtjErbyqD39LZLSmxnHaPU1UPsMKwnPaOz4 A9EldBSQ+9F9e8rxznvuqRxHMkq4yKOz0I0nRO9zfsx/KTTtqT/JnN1HH/Ik2/iDGyIH y6kg== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si5133313pgl.192.2018.12.05.01.39.41; Wed, 05 Dec 2018 01:39:56 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727853AbeLEJhA (ORCPT + 99 others); Wed, 5 Dec 2018 04:37:00 -0500 Received: from mga06.intel.com ([134.134.136.31]:57528 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727773AbeLEJg4 (ORCPT ); Wed, 5 Dec 2018 04:36:56 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2018 01:36:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,317,1539673200"; d="scan'208";a="104989232" Received: from mylly.fi.intel.com (HELO [10.237.72.59]) ([10.237.72.59]) by fmsmga007.fm.intel.com with ESMTP; 05 Dec 2018 01:36:53 -0800 Subject: Re: [PATCH] USB: serial: console: fix reported terminal settings To: Johan Hovold , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Jiri Slaby , linux-kernel@vger.kernel.org, stable , Florian Zumbiehl References: <20181204155904.GC18087@localhost> <20181204160036.24625-1-johan@kernel.org> <20181204161518.GA17941@kroah.com> <20181204163155.GD18087@localhost> From: Jarkko Nikula Message-ID: <4e395eb4-739a-05df-e14d-e32f9cfefdd3@linux.intel.com> Date: Wed, 5 Dec 2018 11:36:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181204163155.GD18087@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >>> >>> Instead, use a (renamed) tty helper to save the termios data used at >>> console setup, so that the tty termios reflects the actual terminal >>> settings after a subsequent tty open(). >>> >>> Note that the calls to tty_init_termios() (tty_driver_install()) and >>> tty_save_termios() are serialised using the disconnect mutex. >>> >>> 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