From: Johan Hovold <jhovold@gmail.com>
To: Colin Leitner <colin.leitner@googlemail.com>
Cc: gregkh@linuxfoundation.org, Johan Hovold <jhovold@gmail.com>,
linux-serial@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: pl2303: fixed handling of CS5 setting
Date: Mon, 4 Nov 2013 11:13:56 +0100 [thread overview]
Message-ID: <20131104101356.GA15921@localhost> (raw)
In-Reply-To: <5276C9AE.1050702@gmail.com>
On Sun, Nov 03, 2013 at 11:09:50PM +0100, Colin Leitner wrote:
> This patch fixes the CS5 setting on the PL2303 USB-to-serial devices. CS5 has a
> value of 0 and the CSIZE setting has been skipped altogether by the enclosing
> if. Tested on 3.11.6 and the scope shows the correct output after the fix has
> been applied.
>
> Tagged to be added to stable, because it fixes a user visible driver bug and is
> simple enough to backport easily.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Looks good now, but I'm afraid it doesn't apply to v3.12. There were
some last minute reverts in v3.12 which could possibly explain that.
Care to rebase against v3.12 and send a v2 (v3?)?
Thanks,
Johan
> ---
> drivers/usb/serial/pl2303.c | 30 ++++++++++++++----------------
> 1 file changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
> index bedf8e4..fd86357 100644
> --- a/drivers/usb/serial/pl2303.c
> +++ b/drivers/usb/serial/pl2303.c
> @@ -522,23 +522,21 @@ static void pl2303_set_termios(struct tty_struct *tty,
> 0, 0, buf, 7, 100);
> dev_dbg(&port->dev, "0xa1:0x21:0:0 %d - %7ph\n", i, buf);
>
> - if (C_CSIZE(tty)) {
> - switch (C_CSIZE(tty)) {
> - case CS5:
> - buf[6] = 5;
> - break;
> - case CS6:
> - buf[6] = 6;
> - break;
> - case CS7:
> - buf[6] = 7;
> - break;
> - default:
> - case CS8:
> - buf[6] = 8;
> - }
> - dev_dbg(&port->dev, "data bits = %d\n", buf[6]);
> + switch (C_CSIZE(tty)) {
> + case CS5:
> + buf[6] = 5;
> + break;
> + case CS6:
> + buf[6] = 6;
> + break;
> + case CS7:
> + buf[6] = 7;
> + break;
> + default:
> + case CS8:
> + buf[6] = 8;
> }
> + dev_dbg(&port->dev, "data bits = %d\n", buf[6]);
>
> /* For reference: buf[0]:buf[3] baud rate value */
> pl2303_encode_baudrate(tty, port, spriv->type, buf);
> --
> 1.7.10.4
next prev parent reply other threads:[~2013-11-04 10:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-03 22:09 [PATCH] USB: pl2303: fixed handling of CS5 setting Colin Leitner
2013-11-04 10:13 ` Johan Hovold [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-11-04 18:40 Colin Leitner
2013-11-04 19:13 ` Johan Hovold
2013-11-05 18:08 ` Greg KH
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=20131104101356.GA15921@localhost \
--to=jhovold@gmail.com \
--cc=colin.leitner@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@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).