Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8432266imu; Tue, 4 Dec 2018 08:16:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/UDcTKj6dfCLqd/jeKgld7S2S2HU3oA2axm5ItfmmSyl3ymYpo04fkcEKCU/OAtwbPeQcpm X-Received: by 2002:a62:1c7:: with SMTP id 190mr20709017pfb.46.1543940204407; Tue, 04 Dec 2018 08:16:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543940204; cv=none; d=google.com; s=arc-20160816; b=Hw5nFlWq5QtIRi8d8Uzf1dqMTi/h+yFhAeTloN+XwzBWbT+DGxOS+NhpN/19AHj5aQ pY1gozorVASqB11asJDlVxJnnrDFjX5cQRi2w9C8Qe+SbGhk5PVB0yMdAgyCguPmQ/fB RwndCxmo7vZVfuCbKu5u304EhIOY6PPwzM9tU9Lil97ZPMi7w5tZtpMEVBTPg7G3nDqE NvJmjPzFo+qnJtjEauXYhRhbGkka7H5V1VRtxeyoDUV5YlQHuEUPkP20XzOWljoFpVAn h6EA7I7ynJrDFne8d8zPscqaQPsmSax8jJ5Cf7VP9ZEvWsdEgxfe1EMn6gcwXYOrgEHL h0yg== 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=e83Mpv8/sdZ7ZP/nwBfQtR7HwrJVLQUzrYlpYXfV9iQ=; b=r7vKgKnae7l8R995A4oDqZrdbO/m5l0gYT0mXiwUeFSWDJK/fLz4kLfBKq1oaufI2c nN0jnpLcUFXnaasWyfATPs5G5/wv+hgDJac6CuhGqXEgzKnPU2ml0ayvgEn9AK9zvk9B tXb/IhVYjsx8qk7hJQfZPgKlwyuGJwsUy9rJcOn1wLY3X3NkmcfLH5hs5JZ5iPkuUS4c aE0NDnqxnX57811oneYx0ztcV/BXc760HTlHEGV7QDT9OOQvmvfKpbzWe1tM6vr1j2nf qSNeArWEstSG2qvABhqxObjbx7DEdRrbpixYndRCEuaOGm1hVzJTnKhPpl9N2/SueYDE i9Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BsTFXI0W; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 27si16713660pgp.135.2018.12.04.08.16.23; Tue, 04 Dec 2018 08:16:44 -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=pass header.i=@kernel.org header.s=default header.b=BsTFXI0W; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbeLDQPW (ORCPT + 99 others); Tue, 4 Dec 2018 11:15:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:57412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbeLDQPV (ORCPT ); Tue, 4 Dec 2018 11:15:21 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 86B4220659; Tue, 4 Dec 2018 16:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543940121; bh=JQnLjUmPw1yLQJ2dKbTFKt1TNQpyVvPTycBj/3G4WrY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BsTFXI0WNPgZPuhU46e/HZUBy1ROfLXFNSnR0EK99050hBs8oWI9dstVslQh7DW1/ iUd3norUUNnk2C5RV0GGyVwpNMQkFMd9KK+WfnAidZSZVDbzrD+jCDZUmTpnvcA4O2 Z8uArFLeeORU8+OmRMQUOmWCg6qAQhpMSoxHcNpQ= Date: Tue, 4 Dec 2018 17:15:18 +0100 From: Greg Kroah-Hartman To: Johan Hovold Cc: linux-usb@vger.kernel.org, Jarkko Nikula , Jiri Slaby , linux-kernel@vger.kernel.org, stable , Florian Zumbiehl Subject: Re: [PATCH] USB: serial: console: fix reported terminal settings Message-ID: <20181204161518.GA17941@kroah.com> References: <20181204155904.GC18087@localhost> <20181204160036.24625-1-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204160036.24625-1-johan@kernel.org> User-Agent: Mutt/1.11.0 (2018-11-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? thanks, greg k-h