All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Konstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
Cc: johan@kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug
Date: Mon, 19 Oct 2015 11:14:12 +0200	[thread overview]
Message-ID: <1445246052.1796.5.camel@suse.com> (raw)
In-Reply-To: <1444946786-18146-1-git-send-email-konstantin.shkolnyy@gmail.com>

On Thu, 2015-10-15 at 17:06 -0500, Konstantin Shkolnyy wrote:
> cp2108 GET_LINE_CTL returns the 16-bit value with the 2 bytes swapped.
> However, SET_LINE_CTL functions properly. When the driver tries to modify
> the register, it reads it, modifies some bits and writes back. Because the
> read bytes were swapped, this often results in an invalid value to be written.
> In turn, this causes cp2108 respond with a stall. The stall sometimes doesn't
> clear properly and cp2108 starts responding to following valid commands also
> with stalls, effectively failing.

Just a remark.
>  
> @@ -865,18 +888,53 @@ static void cp210x_break_ctl(struct tty_struct *tty, int break_state)
>  
>  static int cp210x_startup(struct usb_serial *serial)
>  {
> +	struct usb_serial_port *port;
>  	struct usb_host_interface *cur_altsetting;
>  	struct cp210x_serial_private *spriv;
> +	unsigned int  line_ctl;
> +	int           err;
> +
> +	/* We always expect a single port only */
> +	if (serial->num_ports != 1) {
> +		dev_err(&serial->dev->dev, "%s - expected 1 port, found %d\n",
> +			__func__, serial->num_ports);
> +		return -EINVAL;
> +	}

Why do you introduce this new check? It has no obvious connect with the
subject of this fix.

	Regards
		Oliver



  reply	other threads:[~2015-10-19  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 22:06 [PATCH] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug Konstantin Shkolnyy
2015-10-19  9:14 ` Oliver Neukum [this message]
2015-10-19 13:20   ` Konstantin Shkolnyy
  -- strict thread matches above, loose matches on Subject: below --
2015-10-08 20:53 Konstantin Shkolnyy
2015-10-07 23:38 Konstantin Shkolnyy
2015-10-08  7:31 ` Bjørn Mork

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=1445246052.1796.5.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=johan@kernel.org \
    --cc=konstantin.shkolnyy@gmail.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.