linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: "Wang, Sheng Long" <shenglong.wang.ext@siemens.com>
Cc: Johan Hovold <johan@kernel.org>,
	Sheng Long Wang <china_shenglong@163.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lkp@intel.com" <lkp@intel.com>
Subject: Re: [PATCH v6] usb-serial:cp210x: add support to software flow control
Date: Mon, 16 Nov 2020 17:38:01 +0100	[thread overview]
Message-ID: <X7Kq6fJ/VMnB3Nt0@localhost> (raw)
In-Reply-To: <520e730958174cb39561a94d03e4727e@siemens.com>

[ Please avoid top posting. ]

On Mon, Nov 16, 2020 at 07:56:10AM +0000, Wang, Sheng Long wrote:
> Hi, Johan
> 
> Thank you very much for your reply!
> 
> You mean if we call cp210x_open()  When opening the device, because
> IXON  is set by default, the cp210x_get_termios() does not process
> IXON, So it is invalid IXON at this time.

Right, with the current implementation you need to make sure that
termios reflects the device state on open or your changes will never
actually enable software flow control in the device.

> As you said, It is very strange in cp210x_get_termios()  In the "get"
> function to "set"  IXON.  In addition, the best way is to disable the
> IXON bit as you said.  If the user needs IXON, call set_ termios
> function, So I'm now in cp210x_get_termios()  Is it a temporary
> solution for terminos to handle IXON ?  I'm afraid it will need to be
> adjusted.

No, I didn't mean that IXON should be disabled by default. I meant that
the driver should make sure that the device settings matches termios on
open, not the other way round.

This unusual implementation has caused a number of issues in the past
and it's been on my list fix up for some time. I finally got around to
that today and I just CCed you on the result. That should simplify
adding software flow control and allow more code to be shared with the
hardware flow-control handling.

I've pushed a branch for you here:

	https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/log/?h=cp210x-termios

Johan

  reply	other threads:[~2020-11-16 16:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16  2:24 [PATCH v6] usb-serial:cp210x: add support to software flow control Sheng Long Wang
2020-11-13 15:27 ` Johan Hovold
2020-11-16  7:56   ` Wang, Sheng Long
2020-11-16 16:38     ` Johan Hovold [this message]
2020-11-23  1:11       ` Wang, Sheng Long
2020-11-27 10:23         ` 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=X7Kq6fJ/VMnB3Nt0@localhost \
    --to=johan@kernel.org \
    --cc=china_shenglong@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=shenglong.wang.ext@siemens.com \
    /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).