mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <david@lechnology.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-clk@vger.kernel.org,
	linux-devicetree <devicetree@vger.kernel.org>,
	arm-soc <linux-arm-kernel@lists.infradead.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Sekhar Nori <nsekhar@ti.com>,
	Kevin Hilman <khilman@kernel.org>, Adam Ford <aford173@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 10/42] clk: davinci: New driver for davinci PSC clocks
Date: Mon, 5 Mar 2018 10:23:55 -0600	[thread overview]
Message-ID: <d1b91c10-fe11-452e-2c68-86e95fb58266@lechnology.com> (raw)
In-Reply-To: <CAMRc=Mdhi=byn4gPY6tVxgGjn9cgvc3smUkjV=Ku9i3euaZZtQ@mail.gmail.com>

On 03/05/2018 07:02 AM, Bartosz Golaszewski wrote:
> 2018-03-01 17:44 GMT+01:00 David Lechner <david@lechnology.com>:
>> On 03/01/2018 02:36 AM, Bartosz Golaszewski wrote:
>>>
>>> 2018-02-28 22:40 GMT+01:00 David Lechner <david@lechnology.com>:
>>>>
>>>> On 02/28/2018 06:38 AM, Bartosz Golaszewski wrote:
>>>>>
>>>>>
>>>>>
>>>>> I think I found the reason for the strange crashes we were
>>>>> experiencing (emac core->name being NULL) thanks to Sekhar who pointed
>>>>> me in the right direction.
>>>>>
>>>>> The mdio driver fails to probe with v7 due to the supplied clock rate
>>>>> being wrong. Before failing we register the emac clock with
>>>>> pm_clk_add_clk(). When clock_ops puts the clock, it decreases the
>>>>> reference count of the clock, but we never actually increased it in
>>>>> the first place in the line above. The core clock code then destroys
>>>>> the associated clk_core structure. When the next user comes around (in
>>>>> our case the clk debug functions) the system crashes.
>>>>>
>>>>> I believe there to be two issues: one is with v7 - we need to increase
>>>>> the clock reference count in davinci_psc_genpd_attach_dev().
>>>>>
>>>>> Second is the error path in the clock framework - we should remove the
>>>>> destroyed clk_core from the debug list, which is not being done now.
>>>>>
>>>>> Why we even need to track the refcount of clk_core is a mistery for me
>>>>> though. Stephen, Mike?
>>>>>
>>>>> Best regards,
>>>>> Bartosz Golaszewski
>>>>
>>>>
>>>>
>>>> Great find. I figured it had to be something like this, but I wasn't
>>>> able to reproduce the problem yet.
>>>>
>>>> I suppose it is time to spin up a v8 with some fixes.
>>>
>>>
>>> I still don't know why the mdio clock rate is much lower than in
>>> mainline though. Any ideas?
>>>
>>> Thanks,
>>> Bart
>>>
>>
>> Now that you have fixed the crash, can you answer the questions I have
>> asked earlier?
>>
>>> Can you post the output of this command so that I can see how your
>>
>> clocks are setup:
>>
>> cat /sys/kernel/debug/clk/clk_summary
>>
>>> Using your workaround, can you run:
>>
>>
>> cat /sys/kernel/debug/pm_genpd/pm_genpd_summary
>>
>> If you see:
>>    1e27000.clock-controller: emac  off-0
>>
>> then genpd is not working like it is supposed to. You should see something
>> like this for device that are working:
>>            1e27000.clock-controller: uart2  on
>>      /devices/platform/soc@1c00000/1d0d000.serial        active
> 
> Hi David, Sekhar,
> 
> I tried booting the board today over tftp but didn't succeed. I then
> switched to a normal boot from SD card and the boot process froze at
> the same moment (right after the DHCP config, or after rtc config if I
> disabled DHCP in bootargs). I then realized that the emac clock can't
> be the culprit. After some digging I found out that the late_initcall
> to clk_disable_unused() disables sysclk6 - the parent of the arm
> clock, which of course freezes the device.
> 
> If I remove the call to clk_disable_unused(), I can boot just fine.
> 
> The following other clocks are disabled before pll0_sysclk6:
> pll1_sysclk3
> pll0_obsclk
> pll0_sysclk7
> 
> davinci_lpsc_clk_enable() is never called for these clocks - in fact
> it's not called for any parent that's not explicitly defined in
> psc-da850.c - I believe this may be one of the reasons. I will get
> back to debugging it tomorrow.
> 
> Best regards,
> Bartosz Golaszewski
> 

Thanks for continuing to dig into this. I think I know what needs to
be done now. I think I don't have the dependencies quite right where
the PSC clocks are being registered before the PLL clocks, in which
case they aren't getting the correct parent clock.

  reply	other threads:[~2018-03-05 16:23 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 20:21 [PATCH v7 00/42] ARM: davinci: convert to common clock framework​ David Lechner
2018-02-19 20:21 ` [PATCH v7 01/42] dt-bindings: clock: Add new bindings for TI Davinci PLL clocks David Lechner
2018-03-01 21:41   ` Rob Herring
2018-02-19 20:21 ` [PATCH v7 02/42] clk: davinci: New driver for davinci " David Lechner
2018-02-19 20:21 ` [PATCH v7 03/42] clk: davinci: Add platform information for TI DA830 PLL David Lechner
2018-02-19 20:21 ` [PATCH v7 04/42] clk: davinci: Add platform information for TI DA850 PLL David Lechner
2018-02-19 20:21 ` [PATCH v7 05/42] clk: davinci: Add platform information for TI DM355 PLL David Lechner
2018-02-19 20:21 ` [PATCH v7 06/42] clk: davinci: Add platform information for TI DM365 PLL David Lechner
2018-02-19 20:21 ` [PATCH v7 07/42] clk: davinci: Add platform information for TI DM644x PLL David Lechner
2018-02-19 20:21 ` [PATCH v7 08/42] clk: davinci: Add platform information for TI DM646x PLL David Lechner
2018-02-19 20:21 ` [PATCH v7 09/42] dt-bindings: clock: New bindings for TI Davinci PSC David Lechner
2018-03-01 21:13   ` Rob Herring
2018-02-19 20:21 ` [PATCH v7 10/42] clk: davinci: New driver for davinci PSC clocks David Lechner
2018-02-28 12:38   ` Bartosz Golaszewski
2018-02-28 21:40     ` David Lechner
2018-03-01  8:36       ` Bartosz Golaszewski
2018-03-01 16:44         ` David Lechner
2018-03-02 17:39           ` Bartosz Golaszewski
2018-03-05 13:02           ` Bartosz Golaszewski
2018-03-05 16:23             ` David Lechner [this message]
2018-03-05 17:46               ` David Lechner
2018-03-16 17:55     ` Stephen Boyd
2018-03-19 10:26       ` Bartosz Golaszewski
2018-02-19 20:21 ` [PATCH v7 11/42] clk: davinci: Add platform information for TI DA830 PSC David Lechner
2018-02-19 20:21 ` [PATCH v7 12/42] clk: davinci: Add platform information for TI DA850 PSC David Lechner
2018-02-19 20:21 ` [PATCH v7 13/42] clk: davinci: Add platform information for TI DM355 PSC David Lechner
2018-02-19 20:21 ` [PATCH v7 14/42] clk: davinci: Add platform information for TI DM365 PSC David Lechner
2018-02-19 20:21 ` [PATCH v7 15/42] clk: davinci: Add platform information for TI DM644x PSC David Lechner
2018-02-19 20:21 ` [PATCH v7 16/42] clk: davinci: Add platform information for TI DM646x PSC David Lechner
2018-02-19 20:21 ` [PATCH v7 17/42] dt-bindings: clock: Add bindings for DA8XX CFGCHIP clocks David Lechner
2018-02-19 20:21 ` [PATCH v7 18/42] clk: davinci: New driver for TI " David Lechner
2018-02-19 20:21 ` [PATCH v7 19/42] clk: davinci: cfgchip: Add TI DA8XX USB PHY clocks David Lechner
2018-02-19 20:21 ` [PATCH v7 20/42] ARM: davinci: pass clock as parameter to davinci_timer_init() David Lechner
2018-02-19 20:21 ` [PATCH v7 21/42] ARM: davinci: da830: add new clock init using common clock framework David Lechner
2018-02-19 20:21 ` [PATCH v7 22/42] ARM: davinci: da850: " David Lechner
2018-02-19 20:21 ` [PATCH v7 23/42] ARM: davinci: dm355: " David Lechner
2018-02-19 20:21 ` [PATCH v7 24/42] ARM: davinci: dm365: " David Lechner
2018-02-19 20:21 ` [PATCH v7 25/42] ARM: davinci: dm644x: " David Lechner
2018-02-19 20:21 ` [PATCH v7 26/42] ARM: davinci: dm646x: " David Lechner
2018-02-19 20:21 ` [PATCH v7 27/42] ARM: davinci: da8xx: add new USB PHY " David Lechner
2018-02-19 20:21 ` [PATCH v7 28/42] ARM: davinci: da8xx: add new sata_refclk " David Lechner
2018-02-19 20:21 ` [PATCH v7 29/42] ARM: davinci: remove CONFIG_DAVINCI_RESET_CLOCKS David Lechner
2018-02-19 20:21 ` [PATCH v7 30/42] ARM: davinci_all_defconfig: " David Lechner
2018-02-19 20:21 ` [PATCH v7 31/42] ARM: davinci: switch to common clock framework David Lechner
2018-02-19 20:21 ` [PATCH v7 32/42] ARM: davinci: da830: Remove legacy clock init David Lechner
2018-02-19 20:21 ` [PATCH v7 33/42] ARM: davinci: da850: " David Lechner
2018-02-19 20:21 ` [PATCH v7 34/42] ARM: davinci: dm355: " David Lechner
2018-02-19 20:21 ` [PATCH v7 35/42] ARM: davinci: dm365: " David Lechner
2018-02-19 20:21 ` [PATCH v7 36/42] ARM: davinci: dm644x: " David Lechner
2018-02-19 20:21 ` [PATCH v7 37/42] ARM: davinci: dm646x: " David Lechner
2018-02-19 20:21 ` [PATCH v7 38/42] ARM: davinci: da8xx: Remove legacy USB and SATA " David Lechner
2018-02-19 20:22 ` [PATCH v7 39/42] ARM: davinci: remove legacy clocks David Lechner
2018-02-19 20:22 ` [PATCH v7 40/42] ARM: davinci: add device tree support to timer David Lechner
2018-02-19 20:22 ` [PATCH v7 41/42] ARM: davinci: da8xx-dt: switch to device tree clocks David Lechner
2018-02-19 20:22 ` [PATCH v7 42/42] ARM: dts: da850: Add clocks David Lechner
2018-02-20 13:33 ` [PATCH v7 00/42] ARM: davinci: convert to common clock framework​ Bartosz Golaszewski
2018-02-20 18:39   ` David Lechner
2018-02-21 12:01     ` Bartosz Golaszewski
2018-02-21 17:05       ` David Lechner
2018-02-21 17:46         ` Bartosz Golaszewski
2018-02-22 13:36           ` Bartosz Golaszewski

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=d1b91c10-fe11-452e-2c68-86e95fb58266@lechnology.com \
    --to=david@lechnology.com \
    --cc=aford173@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=nsekhar@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.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

Powered by JetHome