Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Oct 2013 22:36:16 +0200
From:      Zbigniew Bodek <zbb@freebsd.org>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org>
Subject:   Re: Changes to UART ns8250
Message-ID:  <CALF_TxmfGGeTzgMNVdz-HUn6G=mdgZjiTo8%2BLC8tcrn%2BVvShHg@mail.gmail.com>
In-Reply-To: <CAJ-VmokZHvLpUvvD9s8ES0PT%2BE1oVfHWhdbiXF77osBOK2_Yqg@mail.gmail.com>
References:  <CALF_Tx=AwVnr0d75-K-yu97iVgmTJC7aaABoix73zHD%2B5eKJnQ@mail.gmail.com> <CAJ-VmokZHvLpUvvD9s8ES0PT%2BE1oVfHWhdbiXF77osBOK2_Yqg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Adrian,

Thank you for your remarks.
Please check my answers in-line.

Best regards
Zbigniew Bodek


2013/10/7 Adrian Chadd <adrian@freebsd.org>

> Hi,
>
> You should add:
>
> * a loop counter, to break out after a while;
>
[ZBB] In general as long as UART is busy we cannot proceed but if the
timeout occurs we could return an error. Do you agree?

> * a DELAY(1) or something.
>
[ZBB] DELAY is also a busy wait after all. The reasonable solution might be
to use ns8250_delay() to get the transmission time and use it for timeout
from the first point. I would DELAY(1) in each loop and decrement value
acquired from ns8250_delay(). The loop should break during that time or we
return an error. What do you think?


>
>
>
> -adrian
>
>
>
> On 7 October 2013 12:54, Zbigniew Bodek <zbb@freebsd.org> wrote:
>
>> Hello.
>>
>> I would like to present a patch for ns8250 serial that I would like to
>> commit in the near future (if there are no objections).
>>
>> The patch is fixing newest DesignWare UART with busy detection.
>> During frequency divisors configuration when UART is busy transferring or
>> receiving data, line control register manipulation will not take effect.
>> Therefore, we will not set divisor latch access bit and we will corrupt
>> LCR
>> instead of configuring divisors.
>> It is necessary to wait until UART finishes all transfers to proceed with
>> the configuration.
>>
>> This was detected on Armada XP as UART fails on this issue 100/100
>> attempts.
>> The patch was tested by kevlo@ and me and it works on our Armada XP -
>> based
>> systems.
>>
>> Please send your comment or remarks if there are any.
>>
>> Best regards
>> Zbigniew Bodek
>>
>> _______________________________________________
>> freebsd-current@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-current
>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org
>> "
>>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALF_TxmfGGeTzgMNVdz-HUn6G=mdgZjiTo8%2BLC8tcrn%2BVvShHg>