linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	linux-usb@vger.kernel.org, Jiri Slaby <jslaby@suse.com>,
	linux-kernel@vger.kernel.org, stable <stable@vger.kernel.org>,
	Florian Zumbiehl <florz@florz.de>
Subject: USB: serial: console: fix reported terminal settings
Date: Wed, 5 Dec 2018 11:05:45 +0100	[thread overview]
Message-ID: <20181205100545.GA23483@kroah.com> (raw)

On Wed, Dec 05, 2018 at 10:50:49AM +0100, Johan Hovold wrote:
> 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 <stable@vger.kernel.org>	# 4.18
> > >>> Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> > >>> Cc: Florian Zumbiehl <florz@florz.de>
> > >>> Signed-off-by: Johan Hovold <johan@kernel.org>
> > >>> ---
> > >>>   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 <jarkko.nikula@linux.intel.com>
> 
> 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?

Sure, that's fine.

> Note that the changes to tty are trivial; I'm just renaming and
> exporting an existing helper.

Yeah, I have no objections to them.  We can take them in my usb tree.

thanks,

greg k-h

             reply	other threads:[~2018-12-05 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 10:05 Greg Kroah-Hartman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-12-05 10:33 USB: serial: console: fix reported terminal settings Johan Hovold
2018-12-05 10:18 Greg Kroah-Hartman
2018-12-05 10:10 Johan Hovold
2018-12-05  9:50 Johan Hovold
2018-12-05  9:36 Jarkko Nikula
2018-12-04 16:31 Johan Hovold
2018-12-04 16:15 Greg Kroah-Hartman
2018-12-04 16:00 Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181205100545.GA23483@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=florz@florz.de \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=johan@kernel.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).