From: Vladimir Murzin <vladimir.murzin-5wv7dgnIgG8@public.gmane.org>
To: Andy Shevchenko
<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
"Russell King" <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
"Greg Kroah-Hartman"
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
"Daniel Lezcano"
<daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Thomas Gleixner" <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
"Uwe Kleine-König"
<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
"Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"Pawel Moll" <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
ijc+devicetree
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
"Kumar Gala" <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"Jiri Slaby" <jslaby-AlSwsSmVLrQ@public.gmane.org>,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm Mailing List"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3 05/10] serial: mps2-uart: add support for early console
Date: Tue, 16 Feb 2016 13:38:09 +0000 [thread overview]
Message-ID: <56C32641.4020201@arm.com> (raw)
In-Reply-To: <CAHp75Vf_4MgdWunQy5hBMH5GGei+OkktFPYY-ZprY0qOEnD=wA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 16/02/16 13:13, Andy Shevchenko wrote:
> On Tue, Feb 16, 2016 at 3:09 PM, Vladimir Murzin
> <vladimir.murzin-5wv7dgnIgG8@public.gmane.org> wrote:
>> On 16/02/16 10:36, Andy Shevchenko wrote:
>>> On Tue, Feb 16, 2016 at 12:08 PM, Vladimir Murzin
>>> <vladimir.murzin-5wv7dgnIgG8@public.gmane.org> wrote:
>>>> This adds support early console for MPS2 UART which can be enabled via
>>>> earlycon=mps2,0x40004000
>
>>>> +static void mps2_early_putchar(struct uart_port *port, int ch)
>>>> +{
>>>> +
>>>> + while (readb(port->membase + UARTn_STATE) & UARTn_STATE_TX_FULL)
>>>> + cpu_relax();
>>>
>>> Infinite busy loop?
>>
>> In case of broken hw, yes, but I'm quite unsure how we can help to fix
>> it. Do you have something in mind?
>
> Set sane amount of loops like
>
> int count = 100;
> …
> while (… && --count)
>
> Though I have no idea what to do if count == 0. Perhaps it's a TX overrun state.
I thought about counter too, like some of drivers do, but had no idea
what to do next after counter reaches zero. In case of TX overrun we
could get it either because of broken hw or because we entered Linux
with that state already set. In both cases, it looks handy to me to
attach a debugger and see that we are spinning in this putchar loop.
If you do insist to have a counter I'll add one, but if you are not
strong about it I'd prefer to leave it as is.
>
> You may try to recover by flushing TX queue in HW (fifo and / or Tx
> shift register) if HW supports it.
>
I'm afraid this is not supported.
Thanks
Vladimir
next prev parent reply other threads:[~2016-02-16 13:38 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 10:08 [PATCH v3 00/10] Support for Cortex-M Prototyping System Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 01/10] dt-bindings: document the MPS2 timer bindings Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 02/10] clockevents/drivers: add MPS2 Timer driver Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 03/10] dt-bindings: document the MPS2 UART bindings Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 04/10] serial: mps2-uart: add MPS2 UART driver Vladimir Murzin
[not found] ` <1455617295-23736-5-git-send-email-vladimir.murzin-5wv7dgnIgG8@public.gmane.org>
2016-02-16 10:48 ` Andy Shevchenko
2016-02-16 14:25 ` Vladimir Murzin
2016-02-16 11:02 ` One Thousand Gnomes
2016-02-16 15:09 ` Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 05/10] serial: mps2-uart: add support for early console Vladimir Murzin
2016-02-16 10:36 ` Andy Shevchenko
2016-02-16 13:09 ` Vladimir Murzin
2016-02-16 13:13 ` Andy Shevchenko
[not found] ` <CAHp75Vf_4MgdWunQy5hBMH5GGei+OkktFPYY-ZprY0qOEnD=wA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-16 13:38 ` Vladimir Murzin [this message]
[not found] ` <56C32641.4020201-5wv7dgnIgG8@public.gmane.org>
2016-02-16 14:00 ` Andy Shevchenko
2016-02-16 16:12 ` One Thousand Gnomes
[not found] ` <56C31F9F.10000-5wv7dgnIgG8@public.gmane.org>
2016-02-19 9:45 ` Vladimir Murzin
[not found] ` <56C6E42E.5070601-5wv7dgnIgG8@public.gmane.org>
2016-02-19 9:57 ` Andy Shevchenko
[not found] ` <CAHp75VcosaVcz_aYbpfL-nUH0kBf72SshXU5k95s48Z3wnA5nQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-19 15:46 ` Peter Hurley
[not found] ` <56C738F1.2070307-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2016-02-19 16:27 ` Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 06/10] ARM: mps2: introduce MPS2 platform Vladimir Murzin
[not found] ` <1455617295-23736-7-git-send-email-vladimir.murzin-5wv7dgnIgG8@public.gmane.org>
2016-02-16 10:56 ` Arnd Bergmann
2016-02-16 14:35 ` Vladimir Murzin
[not found] ` <56C333BF.1020108-5wv7dgnIgG8@public.gmane.org>
2016-02-16 14:39 ` Arnd Bergmann
2016-02-16 10:08 ` [PATCH v3 07/10] ARM: mps2: add low-level debug support Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 08/10] ARM: configs: add MPS2 defconfig Vladimir Murzin
2016-02-16 10:58 ` Arnd Bergmann
2016-02-16 14:51 ` Vladimir Murzin
[not found] ` <56C3378F.2010008-5wv7dgnIgG8@public.gmane.org>
2016-02-16 15:08 ` Arnd Bergmann
2016-02-16 15:14 ` Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 09/10] ARM: dts: introduce MPS2 AN385/AN386 Vladimir Murzin
[not found] ` <1455617295-23736-10-git-send-email-vladimir.murzin-5wv7dgnIgG8@public.gmane.org>
2016-02-16 11:01 ` Arnd Bergmann
2016-02-16 16:10 ` Vladimir Murzin
2016-02-17 16:48 ` Vladimir Murzin
[not found] ` <56C4A46C.50506-5wv7dgnIgG8@public.gmane.org>
2016-02-17 16:58 ` Arnd Bergmann
2016-02-18 10:11 ` Vladimir Murzin
2016-02-18 10:45 ` Arnd Bergmann
2016-02-18 11:13 ` Vladimir Murzin
[not found] ` <56C5A742.8010304-5wv7dgnIgG8@public.gmane.org>
2016-02-18 12:16 ` Arnd Bergmann
2016-02-18 12:47 ` Vladimir Murzin
2016-02-16 15:17 ` Linus Walleij
2016-02-16 15:37 ` Vladimir Murzin
2016-02-16 10:08 ` [PATCH v3 10/10] ARM: dts: introduce MPS2 AN399/AN400 Vladimir Murzin
2016-02-16 11:05 ` [PATCH v3 00/10] Support for Cortex-M Prototyping System Arnd Bergmann
2016-02-16 16:14 ` Vladimir Murzin
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=56C32641.4020201@arm.com \
--to=vladimir.murzin-5wv7dgnigg8@public.gmane.org \
--cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jslaby-AlSwsSmVLrQ@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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).