Re: [PATCH] Fix Corruption issue in USB ftdi driverdrivers/usb/serial/ftdi_sio.c

From: Alan Cox
Date: Tue Nov 01 2011 - 07:25:51 EST


> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/