mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: "Alexander Shi" <alexandershi@nanometrics.ca>
Cc: "James Nuss" <jamesnuss@nanometrics.ca>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Unreliable register being read in max310x UART driver
Date: Tue, 03 Nov 2015 10:27:23 +0300	[thread overview]
Message-ID: <1446535643.874287476@f26.i.mail.ru> (raw)
In-Reply-To: <CAESxSQttZTWe8byjD+0u34=NtsnFysWfLBTmyTKGCBmpHQPaTA@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1536 bytes --]

Hello.

> Понедельник,  2 ноября 2015, 10:24 -05:00 от Alexander Shi <alexandershi@nanometrics.ca>:
> 
> Hello all,
>  
> The datasheet for MAX3107 UART ( http://datasheets.maximintegrated.com/en/ds/MAX3107.pdf ) was updated in February 2015 with a notice that the RxFIFOLvl register may be inaccurate if read while being updated. The respective max310x.c driver in the kernel actively makes use of the RxFIFOLvl register, but has not been updated since the notice was posted. Does anyone have a workaround to this bug?
>  
> The notice was phrased as follows:
> “The RxFIFOLvl register represents the current number of words in the receive FIFO whenever the receive UART is idle. When the receive UART actively receives characters, the value in this register can sometimes be inaccurate if this register is read at the same time that the receive UART updates the receive FIFO. To manage the receive FIFO even when the receive UART is active, do not use this register to determine receive FIFO state. Use the RFIFOEmptyInt bit, the RxTrgInt bit, and the RTimeOut bit instead.”
>  
> Thanks,
> Alex

On my opinion this should not be a problem.
The RX interrupt will be triggered once again if we lost RX level value.
Anyway, you can add one check after reading rxfifolvl register:
  if (!(ists & MAX310X_IRQ_RXEMPTY_BIT))
    rxlen = 1;

Thanks.
---

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

       reply	other threads:[~2015-11-03  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAESxSQttZTWe8byjD+0u34=NtsnFysWfLBTmyTKGCBmpHQPaTA@mail.gmail.com>
2015-11-03  7:27 ` Alexander Shiyan [this message]
2015-11-02 15:30 Alexander Shi

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=1446535643.874287476@f26.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=alexandershi@nanometrics.ca \
    --cc=jamesnuss@nanometrics.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®