public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: Andrew Worsley <amworsley@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>,
	Johan Hovold <jhovold@gmail.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix Corruption issue in USB ftdi driver drivers/usb/serial/ftdi_sio.c
Date: Tue, 1 Nov 2011 11:36:07 +0000	[thread overview]
Message-ID: <20111101113607.15b254c6@bob.linux.org.uk> (raw)
In-Reply-To: <CA+Y=x3=xEa6XVspsodhbKOArtZ7VMYSMLhpF4WZ1sFNfaJ_E9g@mail.gmail.com>

> I don't know why it repeatedly tries to set this all the time - it
> would appear to be quite a lot of work so perhaps there is something
> else that could be cleaned up. This was the simplest safe change that
> fixed my problem. It appears this code hasn't changed very much since
> the first history information in git that I could see - so perhaps
> nobody else is really noticing this issue for some reason?

It could be a problem specific to some firmware or revision. We've had
a similar quirk with a different USB adapter. The actual calls to keep
changing it are coming from your application however.

>         cflag = termios->c_cflag;
> 
> -       /* FIXME -For this cut I don't care if the line is really
> changing or
> -          not  - so just do the change regardless  - should be able
> to
> -          compare old_termios and tty->termios */
> +       /* compare old_termios and tty->termios */
> +    if (old_termios->c_cflag == termios->c_cflag)
> +        goto no_c_cflag_changes;

You can't do it this way because the speed data is not entirely within
c_cflag. Check c_ispeed and c_ospeed match and for the parity if you want to skip
that check if the parity bits change specifically.

Alan

  parent reply	other threads:[~2011-11-01 11:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28  6:57 [PATCH] Fix Corruption issue in USB ftdi driver drivers/usb/serial/ftdi_sio.c Andrew Worsley
2011-10-28 10:50 ` Uwe Bonnes
2011-10-28 20:25   ` Andrew Worsley
2011-11-01 11:36 ` Alan Cox [this message]
2011-11-02  5:21   ` Andrew Worsley
2011-11-02 11:31     ` Alan Cox
2011-11-03  5:06       ` Andrew Worsley
2011-11-14 21:54         ` 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=20111101113607.15b254c6@bob.linux.org.uk \
    --to=alan@linux.intel.com \
    --cc=amworsley@gmail.com \
    --cc=bon@elektron.ikp.physik.tu-darmstadt.de \
    --cc=gregkh@suse.de \
    --cc=jhovold@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=plagnioj@jcrosoft.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