linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Sperl <kernel@martin.sperl.org>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Eric Anholt <eric@anholt.net>,
	linux-arm-kernel@lists.infradead.org,
	linux-serial@vger.kernel.org,
	linux-clk <linux-clk@vger.kernel.org>,
	linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>
Subject: Re: serial: clk: bcm2835: Strange effects when using aux-uart in console
Date: Fri, 12 Feb 2016 20:44:25 +0100	[thread overview]
Message-ID: <6CD3FC59-BA17-43D9-897C-A2D122D26EF8@martin.sperl.org> (raw)
In-Reply-To: <F7A2533A-D64C-4187-ABD4-416C446D1637@martin.sperl.org>


> On 12.02.2016, at 18:34, Martin Sperl <kernel@martin.sperl.org> wrote:
> 
> The screen is still blinking and UART does not work.
> Maybe the driver is not able to handle the “remapping”
> of registers to a different range and is touching ram
> used by the FW?
> 
> The only solution that I found is using fixed clocks
> in the device-tree (which is not what we intended:
> / {
>                clk_uart0: clock@3 {
>                        compatible = "fixed-clock";
>                        reg = <3>;
>                        #clock-cells = <0>;
>                        clock-output-names = "uart0_pclk";
>                        clock-frequency = <3000000>;
>                };
> 
>                clk_apb_p: clock@4 {
>                        compatible = "fixed-clock";
>                        reg = <4>;
>                        #clock-cells = <0>;
>                        clock-output-names = "apb_pclk";
>                        clock-frequency = <126000000>;
>                };
> };
> &uart0 {
>        clocks = <&clk_uart0 &clk_apb_p>;
> };
> 
> (so I have ruled out that the amba-pl011 writes to
> the wrong addresses).
> 
> So as far as I can tell it is only clock related
> and when the new clock-framework is used it fails...

So the issue is triggered as soon as the plld_per
pll divider gets disabled/reenabled.

This happens because the clk_hw.core.prepare_count
drops down to 0 and then unprepare is called.

So we need to increase the ref-count for the pll
and pll_dividers to at least 1 so that these never
get disabled - at least for now until we can come
up with a better contract with the firmware.

Obviously this may impact other drivers as well
where a pll is used for the first time - if nothing
else uses it and the clock gets released, then
the clock would trigger a unprepare of the whole
branch of the clock tree.

The question is: how can we solve it in an acceptable
manner?

Do we need a driver that just holds a reference to
those clocks? Or should we just prepare the clock
after registering it in clk-bcm2835.c?

As for why does this not show up when compiled in?
It seems that in that case the amba_pl011 driver
never gets removed and then probed again.

This is possibly related to the optional use of DMA,
with the amba-pl011 driver that retries the install,
which is not supported on the bcm2835 - at least that
is what the datasheet says. And DMA is (probably) not
enabled during the early boot stages, so it does not
fail once when it tries to register DMA.

Thanks,
	Martin



  reply	other threads:[~2016-02-12 19:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 15:12 serial: clk: bcm2835: Strange effects when using aux-uart in console Martin Sperl
2016-02-10 17:21 ` Stefan Wahren
2016-02-10 17:42   ` Martin Sperl
2016-02-11 13:15 ` Martin Sperl
2016-02-11 17:55   ` Stefan Wahren
2016-02-12 11:56     ` Martin Sperl
2016-02-12 17:34       ` Martin Sperl
2016-02-12 19:44         ` Martin Sperl [this message]
2016-02-13 10:01           ` Stefan Wahren
2016-02-13 11:24             ` Martin Sperl
2016-02-16 18:57               ` Michael Turquette
2016-02-17 10:43                 ` Martin Sperl
2016-02-13 11:53             ` Martin Sperl
2016-02-13 20:45               ` Stefan Wahren
2016-02-16 16:31                 ` Martin Sperl
2016-02-16 19:29                   ` Stefan Wahren

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=6CD3FC59-BA17-43D9-897C-A2D122D26EF8@martin.sperl.org \
    --to=kernel@martin.sperl.org \
    --cc=eric@anholt.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stefan.wahren@i2se.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;
as well as URLs for NNTP newsgroup(s).