Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8452339imu; Tue, 4 Dec 2018 08:34:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/XOppL7/2AHrmAKIjludutlhvccZoebaWTAq2enkMtCB7CCnokR+MsWx+pdreUxz5Cg/fSf X-Received: by 2002:a63:2054:: with SMTP id r20mr17189566pgm.328.1543941280848; Tue, 04 Dec 2018 08:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543941280; cv=none; d=google.com; s=arc-20160816; b=aoooWlBDJv1dRdMJEhuXd7kAhtuMK0kmIh0v5nRo7FUZZaoPfkEMfK0OwThvnzdhJw Hy+JSE61YhfMeshVuy4s8UzspJwj7OgoiRtj5C3VW1+1fKigtDoS0LD+CYXzgBjo4q2r iXEZ7B2AX//0uAFwzencznjJPBTnTIFh/VO+Fn5YQ971DDjobQjtqiSAMyOXdMZyQW3n 61hLRZM+j8D/D9P+0Xs3Qulq5MmGmedgB+PC8/4+V60j16sutBrIqpQhP2ONg5xSfLg+ EJme5Y0dPidEaEKi31IPmFXv7nEMpfabq/hDt48KysMWyW00316s760xwa9ZcX8N0v/Z 4Fhw== 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=GLf7jhPRgKHtp81VkqFMGOjWO0dWtGHtzBeMcmUcCjg=; b=rkahKC/813MGe3Q+5Vf1PFAtfkmGaPrlckleFfZIOpBM7VthB79g8dMuZwEB/TZHJe m9Z767MxQ7J4TSIZxpVfRjPfNjnRxVceqNPODesX7iIRZN8ezAxRw66CNW9Lsmim9oKh IqSOQxTIkUoxEOP660+Hb8Fl1WwlEojOi2Ir1gYTkcjA5SIvPSZTL8QgTSsiMJyXyxV2 DOyqkTCqXa2DQi2R9ZIGHfTj5LOP2W8i0/qb8vVrx3fqlPVC4tCllTSnPibtczCrMHtv nDcsOtHQ1ZTmvMfSp2inQK4LR2gpC/Dd9Fk4icm3fkDKYzERPTg7TfBhhu3buIrk1MVR tXlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=VbWZLk47; 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 q17si20868515pfc.198.2018.12.04.08.34.16; Tue, 04 Dec 2018 08:34:40 -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=VbWZLk47; 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 S1727081AbeLDQb6 (ORCPT + 99 others); Tue, 4 Dec 2018 11:31:58 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:45283 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbeLDQb6 (ORCPT ); Tue, 4 Dec 2018 11:31:58 -0500 Received: by mail-lj1-f194.google.com with SMTP id s5-v6so15479551ljd.12; Tue, 04 Dec 2018 08:31:55 -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=GLf7jhPRgKHtp81VkqFMGOjWO0dWtGHtzBeMcmUcCjg=; b=VbWZLk47768sb76OJK24tEMJ1ibD1a1O5jZ0bsZGvqPbpzxONxIDJjlPH7F3gDwxoW v6dOBmDM+e/kTY+CJ/r7y3zdWnc080iC9NSY6g1dcGGAPe3DuwWw67y0IJPqlcnZQ1rw drQfYX8SZLQe72O4say82+OK/MA4DqhNJDusHw/rtaHpSZtUdiZGCjFqHvOitGAsGeXv gthpUIBbd2rU9MxnJoBM2ptrG9X8bg+8ek4shDvYpIL1iWYOIHP5sJRdMRIm1l2Wx4SF tGByJ/BSz8+Jc/k5FFTbg3jPQk+qjk9kyqwjqYvi/5o1LyL9rWW26UDpulQKZAEli0ie 7ffQ== 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=GLf7jhPRgKHtp81VkqFMGOjWO0dWtGHtzBeMcmUcCjg=; b=P+ntIVcrhvtqaJvhYFRf4++PvNsPR9/IPZx31sQXQFCSh5Ko3wNbAZmmQLHl1emgFK Xq8uxaM5Q9QepDWTUaFnwfC5STkh8K8cGcA77t6ECKsJjNCm5xHNbVeSc560gy3OG50E NmTtZus9B96iG9BJuS4+oj1Onm3ycuarVuSNJkPqqNFNeFscGXpdwmx7bEOgzNf2Dynp erjqaErl8GXldJrhOrE2I9MrD+24HF+Ol3wm5TQy63JT/56A6UY/SENv47vHcztdQZ7q wup9NRAc9H//pQtcG6x53OfW0BYB3/e1R9TSQo4wImzNB45TfiGhofJm/ON48TR3c5i2 DTOA== X-Gm-Message-State: AA+aEWYhzyHSHPrkk2k13lAoMVgp2fhysZ2pJrC4GXAWPHQ6lFK9rcGU wlfEvl2fIUWyjUK79b10FLs= X-Received: by 2002:a2e:5d12:: with SMTP id r18-v6mr14674323ljb.89.1543941114610; Tue, 04 Dec 2018 08:31:54 -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 p23sm3051863lfh.47.2018.12.04.08.31.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 08:31:53 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gUDc3-0006cj-0n; Tue, 04 Dec 2018 17:31:55 +0100 Date: Tue, 4 Dec 2018 17:31:55 +0100 From: Johan Hovold To: Greg Kroah-Hartman Cc: Johan Hovold , 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: <20181204163155.GD18087@localhost> References: <20181204155904.GC18087@localhost> <20181204160036.24625-1-johan@kernel.org> <20181204161518.GA17941@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204161518.GA17941@kroah.com> 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: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. Thanks, Johan