From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Johan Hovold <johan@kernel.org>,
linux-usb@vger.kernel.org, Jim Paris <jim@jtan.com>,
Oliver Neukum <oliver@neukum.org>,
linux-kernel@vger.kernel.org,
Peter Hurley <peter@hurleysoftware.com>
Subject: Re: [PATCH] USB: cdc-acm: only raise DTR on transitions from B0
Date: Wed, 29 Oct 2014 16:58:40 +0100 [thread overview]
Message-ID: <20141029155840.GJ2265@localhost> (raw)
In-Reply-To: <20141029155602.GC17399@kroah.com>
On Wed, Oct 29, 2014 at 11:56:02PM +0800, Greg Kroah-Hartman wrote:
> On Wed, Oct 29, 2014 at 04:30:40PM +0100, Johan Hovold wrote:
> > Make sure to only raise DTR on transitions from B0 in set_termios.
> >
> > Also allow set_termios to be called from open with a termios_old of
> > NULL. Note that DTR will not be raised prematurely in this case.
> >
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> > drivers/usb/class/cdc-acm.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> > index e934e19f49f5..7e58bbfd6319 100644
> > --- a/drivers/usb/class/cdc-acm.c
> > +++ b/drivers/usb/class/cdc-acm.c
> > @@ -980,11 +980,12 @@ static void acm_tty_set_termios(struct tty_struct *tty,
> > /* FIXME: Needs to clear unsupported bits in the termios */
> > acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
> >
> > - if (!newline.dwDTERate) {
> > + if (C_BAUD(tty) == B0) {
> > newline.dwDTERate = acm->line.dwDTERate;
> > newctrl &= ~ACM_CTRL_DTR;
> > - } else
> > + } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) {
> > newctrl |= ACM_CTRL_DTR;
> > + }
> >
> > if (newctrl != acm->ctrlout)
> > acm_set_control(acm, acm->ctrlout = newctrl);
>
> This should go to older kernels as well, right?
Yes, if you want.
It's fixing handling of B0, but I doubt many people care (hence the
missing stable tag). Note that set_termios is currently not called
during open() (but Jim's patch will be relying on this one).
Johan
next prev parent reply other threads:[~2014-10-29 16:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 23:26 [PATCH] cdc-acm: ensure that termios get set when the port is opened Jim Paris
2014-10-29 1:05 ` Peter Hurley
2014-10-29 13:43 ` [PATCH v2] cdc-acm: ensure that termios get set when the port is activated Jim Paris
2014-10-29 15:07 ` Johan Hovold
2014-10-29 15:30 ` [PATCH] USB: cdc-acm: only raise DTR on transitions from B0 Johan Hovold
2014-10-29 15:56 ` Greg Kroah-Hartman
2014-10-29 15:58 ` Johan Hovold [this message]
2014-10-30 0:53 ` [PATCH v3] cdc-acm: ensure that termios get set when the port is activated Jim Paris
2014-10-30 7:51 ` Johan Hovold
2014-10-30 14:45 ` [PATCH v4] " Jim Paris
2014-10-30 14:48 ` Johan Hovold
2014-10-30 15:04 ` [PATCH v4-real] " Jim Paris
2014-10-31 11:45 ` Johan Hovold
2014-10-31 16:04 ` Oliver Neukum
2014-10-30 6:48 ` [PATCH] USB: cdc-acm: only raise DTR on transitions from B0 Oliver Neukum
2014-11-05 17:41 ` [PATCH Resend] " 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=20141029155840.GJ2265@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jim@jtan.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=peter@hurleysoftware.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).