linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: neilb@suse.de (NeilBrown)
To: linux-arm-kernel@lists.infradead.org
Subject: patch "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA" added to tty tree
Date: Sat, 4 Feb 2012 07:44:27 +1100	[thread overview]
Message-ID: <20120204074427.5091fef5@notabene.brown> (raw)
In-Reply-To: <alpine.DEB.2.00.1202031234120.27947@utopia.booyaka.com>

On Fri, 3 Feb 2012 12:42:22 -0700 (MST) Paul Walmsley <paul@pwsan.com> wrote:

> On Fri, 3 Feb 2012, Grazvydas Ignotas wrote:
> 
> > On Fri, Feb 3, 2012 at 11:54 AM, NeilBrown <neilb@suse.de> wrote:
> > > On Thu, 2 Feb 2012 22:45:53 -0700 (MST) Paul Walmsley <paul@pwsan.com> wrote:
> > >> On Fri, 3 Feb 2012, NeilBrown wrote:
> > >>
> > >> > then CPUIDLE enters lower states and I think it uses less power but I
> > >> > sometimes lose the first char I type (that is known) but also I sometimes get
> > >> > corruption on output.
> > >>
> > >> I don't see any output corruption on 35xx BeagleBoard, either with or
> > >> without these patches. ?So this is presumably a 37xx-centric problem, and
> > >> unrelated to these patches, I would guess.
> > >
> > > Maybe it is 37xx specific. ?I think this is a DM3730.
> > 
> > Not sure if it's the same problem but with 3530 on 3.2 with
> > sleep_timeout set, I usually get first char dropped (as expected) but
> > sometimes I get corrupted char instead too. Corrupt char seems to
> > almost always happen if I set cpufreq to powersave, on performace it's
> > almost always ok, so maybe it's some timing problem,
> 
> OK so let's distinguish between two corruption situations:
> 
> 1. The first character transmitted to the OMAP UART in a serial console 
> when the UART powerdomain is in a non-functional, low power state (e.g., 
> RET or below) is corrupted.  This is not actually output corruption, this 
> is input corruption.
> 
> 2. Characters are corrupted while the OMAP UART is transmitting data, but 
> there has been no recent data sent to the OMAP.
> 
> Case 1 is expected and is almost certainly not a bug.  As Neil mentioned 
> it should be bps-rate dependent.  It occurs when the first character 
> transmitted to the OMAP wakes the chip up via I/O ring/chain wakeup.
> I/O ring/chain wakeup is driven by a 32KiHz clock and is therefore 
> relatively high-latency.  So this could easily cause the first character 
> or first few characters to be lost or corrupted, depending on the exact 
> sequence of events, the low power state that the chip was in, etc.

A 32KiHz cycles every 30mSec.
At 115200 bps, there is one bit every 8.7 microseconds.

When I type "return" - which looks like 0101100001111... on the wire,
I see '0xC3' which looks like 011000011111... on the wire.
So we lost exactly 2 bits, or a delay around 17 microseconds.

I find it hard to reconcile that delay with the cause being a 32KiHZ clock.

If the first char I type is a space (0x20 or 0000001001111111) then
the character received is 0x90 (0000010011111) which is exactly 1 bit missing,
so an 8 or 9 usec delay.
If the first char I type is 'o' (0x6f, or 0111101101111111) then the character
received is 0xfb (01101111111111) which misses 5 bits.
I think it misses the first bit, then waits for a start bit (0), then takes
the next 8 bits.

At 230400 bps, I always lose at least 2 bits.
At 460800 bps, I seem lose at least 3 bits.
(above there, nothing works at all ... could be my USB/serial cable at fault).

So it looks a lot like a delay which is a small number of microseconds.
Could be the wake-up latency in the I/O ring/chain, but doesn't look like the
32 KiHz clock :-)

> 
> Case 2 is not expected.  That is likely a bug somewhere.  Neil, this is 
> what I understood that you are experiencing.  Is that correct?

Correct.

Thanks,
NeilBrown

> 
> Gra?vydas, are you seeing case 1 or 2 (or something completely different 
> ;-) ?
> 
> 
> - Paul

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120204/4c79c062/attachment.sig>

  reply	other threads:[~2012-02-03 20:44 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <13274430881471@kroah.org>
2012-01-26  3:02 ` patch "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA" added to tty tree Paul Walmsley
2012-01-26  4:21   ` Greg KH
2012-01-26  4:31     ` Paul Walmsley
2012-01-26 19:16       ` Greg KH
2012-01-26 19:34         ` Paul Walmsley
2012-02-02 20:03           ` Paul Walmsley
2012-02-02 20:22             ` Greg KH
2012-02-03  4:07             ` NeilBrown
2012-02-03  5:45               ` Paul Walmsley
2012-02-03  9:54                 ` NeilBrown
2012-02-03 11:42                   ` Grazvydas Ignotas
2012-02-03 12:11                     ` NeilBrown
2012-02-03 19:49                       ` Paul Walmsley
2012-02-03 20:34                         ` Paul Walmsley
2012-02-03 21:42                         ` Paul Walmsley
2012-02-03 22:10                           ` NeilBrown
2012-02-03 22:30                             ` Paul Walmsley
2012-02-04  0:23                       ` Woodruff, Richard
2012-02-04  0:59                         ` Paul Walmsley
2012-02-04  1:46                           ` Woodruff, Richard
2012-02-04  2:39                             ` Paul Walmsley
2012-02-04  2:31                         ` NeilBrown
2012-02-07  1:00                           ` Woodruff, Richard
2012-02-03 19:42                     ` Paul Walmsley
2012-02-03 20:44                       ` NeilBrown [this message]
2012-02-03 21:04                         ` Paul Walmsley
2012-02-04 16:00                       ` Grazvydas Ignotas
2012-02-04 16:31                         ` Paul Walmsley
2012-02-04 16:57                           ` Russell King - ARM Linux
2012-02-04 17:32                             ` Paul Walmsley
2012-02-04 17:55                               ` Russell King - ARM Linux
2012-02-04 19:37                                 ` Paul Walmsley
2012-02-05 12:16                                   ` Russell King - ARM Linux
2012-02-08 15:50                                 ` Paul Walmsley
2012-02-04 16:39                         ` Russell King - ARM Linux
2012-02-04 16:49                           ` Paul Walmsley
2012-02-04 16:55                             ` Paul Walmsley
2012-02-04 17:01                             ` Russell King - ARM Linux
2012-02-04 17:22                               ` Paul Walmsley
2012-02-04 17:47                                 ` Russell King - ARM Linux
2012-02-04 18:59                                   ` Tony Lindgren
2012-02-04 19:24                                   ` Paul Walmsley
2012-02-04 20:07                                     ` Russell King - ARM Linux
2012-02-05 15:37                           ` Woodruff, Richard
2012-02-05 16:03                             ` Russell King - ARM Linux
2012-02-05 17:57                               ` Woodruff, Richard
2012-02-06 23:58                                 ` NeilBrown
2012-02-07  1:13                                   ` Woodruff, Richard
2012-02-03 19:34                   ` Paul Walmsley
2012-02-03 20:10                   ` Paul Walmsley
2012-02-03 21:59                     ` NeilBrown
2012-02-03 23:02                       ` Paul Walmsley
2012-02-04  0:01                         ` NeilBrown
2012-02-04  2:06                           ` Paul Walmsley
2012-02-04  2:12                             ` Paul Walmsley
2012-02-04  3:09                             ` NeilBrown
2012-02-04  3:16                               ` Paul Walmsley
2012-02-04  3:43                                 ` NeilBrown
2012-02-04  3:56                                   ` Paul Walmsley
2012-02-04  4:17                                     ` NeilBrown
2012-02-03  6:56               ` Govindraj
2012-02-03 12:07                 ` NeilBrown
2012-02-03 12:20                   ` Russell King - ARM Linux
2012-02-03 19:54                     ` Paul Walmsley
2012-02-03 12:12               ` Felipe Contreras
2012-02-02 21:02           ` 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=20120204074427.5091fef5@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-arm-kernel@lists.infradead.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).