public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Vitaly V. Ch" <vitaly.v.ch@gmail.com>
Cc: USB list <linux-usb@vger.kernel.org>,
	linux-serial@vger.kernel.org, bryder@sgi.com,
	kuba@mareimbrium.org
Subject: Re: Review and minor fixes for ftdi_sio.h
Date: Fri, 5 Feb 2010 08:38:49 -0800	[thread overview]
Message-ID: <20100205163849.GB27145@kroah.com> (raw)
In-Reply-To: <6efe08af1002050154k8ae2a9evff2971afce407b52@mail.gmail.com>

On Fri, Feb 05, 2010 at 11:54:56AM +0200, Vitaly V. Ch wrote:
> Hi all!
> 
> I'm find then ftdi_sio.c in 2.4.37.8 kernel have next bug: if I have
> three ftdi-232 simultaneously connected to middle-loaded host,
> application which use one of them will hung in driver, usually during
> few hour.

Can you look at the version in 2.6.33-rc6, and also in the linux-next
tree?  Both of those have changes to this driver already done, and
hopefully this fixes your problem.

> At now i try to revise that driver and also I review driver in 2.6.32
> and do few minor fixes + found out possible buggy place.
> 
> ****************************************
> 1) function ftdi_232am_baud_base_to_divisor() in 2.6.32 have next view:
> 
> static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
> {
>     unsigned short int divisor;
>     /* divisor shifted 3 bits to the left */
>     int divisor3 = base / 2 / baud;
>     if ((divisor3 & 0x7) == 7)
>         divisor3++; /* round x.7/8 up to x+1 */
>     divisor = divisor3 >> 3;
>     divisor3 &= 0x7;
>     if (divisor3 == 1)
>         divisor |= 0xc000; /* 0.125 */
>     else if (divisor3 >= 4)
>         divisor |= 0x4000; /* 0.5 */
>     else if (divisor3 != 0)
>         divisor |= 0x8000; /* 0.25 */
>     /// @warning possible at this place we have bug
>     else if (divisor == 1)
>         divisor = 0;    /* special case for maximum baud rate */
>     return divisor;
> }
> 
> but POSSIBLE may be need:
> 
> static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
> {
>     unsigned short int divisor;
>     /* divisor shifted 3 bits to the left */
>     int divisor3 = base / 2 / baud;
>     if ((divisor3 & 0x7) == 7)
>         divisor3++; /* round x.7/8 up to x+1 */
>     divisor = divisor3 >> 3;
>     divisor3 &= 0x7;
>     if (divisor3 == 1)
>         divisor |= 0xc000; /* 0.125 */
>     else if (divisor3 >= 4)
>         divisor |= 0x4000; /* 0.5 */
>     else if (divisor3 != 0)
>         divisor |= 0x8000; /* 0.25 */
> 
>     if (divisor == 1)
>         divisor = 0;    /* special case for maximum baud rate */
>     return divisor;
> }
> 
> Can anyone guide me?

I don't know, what is the problem you are seeing here?

> *********************************************************
> 2) In the attached patch I do few small fixes. About half of them must
> be merged into kernel trunk

Which half?  :)

Can you look at the above mentioned kernel versions and see if the
problem is already fixed there?

If not, can you send a patch that I can apply (read
Documentation/SubmittingPatches for how to do it)?

thanks,

greg k-h

      reply	other threads:[~2010-02-05 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  9:54 Review and minor fixes for ftdi_sio.h Vitaly V. Ch
2010-02-05 16:38 ` Greg KH [this message]

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=20100205163849.GB27145@kroah.com \
    --to=greg@kroah.com \
    --cc=bryder@sgi.com \
    --cc=kuba@mareimbrium.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=vitaly.v.ch@gmail.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