From: Chad LeClair <leclair@gmail.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>,
Ilya K <me@0upti.me>
Cc: "andy.yan@rock-chips.com" <andy.yan@rock-chips.com>,
"heiko@sntech.de" <heiko@sntech.de>,
"huangtao@rock-chips.com" <huangtao@rock-chips.com>,
"kernel@collabora.com" <kernel@collabora.com>,
"kever.yang@rock-chips.com" <kever.yang@rock-chips.com>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
"mturquette@baylibre.com" <mturquette@baylibre.com>,
"sboyd@kernel.org" <sboyd@kernel.org>,
"zhangqing@rock-chips.com" <zhangqing@rock-chips.com>
Subject: Re: [PATCH v8 7/7] clk: rockchip: implement proper GATE_LINK support
Date: Sun, 17 Mar 2024 19:34:41 -0400 [thread overview]
Message-ID: <7f4b3f38-50ee-480f-a341-ab577e19bb32@gmail.com> (raw)
In-Reply-To: <uwr335fla4nfvv3mdppcoly6hcsayav26r4r6txmbwrb25ftw7@rxwjtan7evww>
On 3/8/24 08:27, Sebastian Reichel wrote:
> [removed DT people from CC, since this is all about clocks now]
>
> Hello Ilya,
>
> On Fri, Mar 08, 2024 at 10:23:31AM +0300, Ilya K wrote:
>> This change seems to make my Orange Pi 5 (RK3588S) lock up on boot
>> :( Any suggestions on how to debug this? It doesn't really log
>> much...
>
> I suppose with this change you explicitly mean the last patch, which
> has not yet been applied? That patch effectively allows some clocks
> to be disabled, that have previously been marked as critical (and
> thus always-on).
>
> If that results in a boot lockup, I expect you have a peripheral
> driver, that does not enable a required clock (e.g. because of a
> missing clock reference).
Sebastian,
Another Orange Pi 5 owner here... I likewise ran into trouble with
this patch. I have been playing with your rk3588 branch from the
Collabora gitlab and was also experiencing hangs on boot on my OPi5. I
bisected your branch and found that the GATE_LINK support commit was the
problem for me.
Digging in, I found that the problem behind the hang was that I was not
getting the aclk_nvm_root which in turn caused DMA transactions to the
SFC driver to hang.
...
[ 2.804519] rockchip-sfc fe2b0000.spi: DMA wait for transfer finish
timeout
[ 2.805127] rockchip-sfc fe2b0000.spi: xfer data failed ret -110 dir 1
...
Setting aclk_nvm_root to critical allows the system to boot. However
not all is well as I do get errors like the following which also seem to
indicate further clock problems:
[ 6.296554] rockchip-pm-domain
fd8d8000.power-management:power-controller: failed to set idle on domain
'vo0', val=0
I assume that the con-ops of your patch is analogous to the downstream
"clock-link" driver. (ie. you are looking for PM events to cause the
pm_clk_suspend()/pm_clk_resume() routines to enable/disable the linked
(second parent) clocks). This wasn't happening for me. Unlike in the
downstream implementation, the gate_link devices' dev->driver pointer
was null. So that when rpm_resume() was being called, it would make its
way to pm_generic_runtime_resume() which then would do nothing. The end
result is that I would have a prepare count of 1 on aclk_nvm_root, but
an enable count of 0 so it would get disabled (orig patch w/o marking
this critical).
I did a quick hacky proof of concept where I set up the pm ops on the
clk-rk3588 driver to point to the pm_clk_suspend/pm_clk_resume routines
like downstream did. I used device_bind_driver() to forceably bind the
clk-rk3588 driver to the gate link devices it was setting up.
This worked for me. With those changes I then was able to boot without
needing to set aclk_nvm_root as critical. Further, it cleaned up the
power-controller error messages on the sdio and vo0 domains.
The force bind I did doesn't feel like a particularly clean solution to
me. However, I am not knowledgeable enough in the (platform) device
model to know what the right way to do this is without fully doing what
downstream did and having DT nodes for the various gate link devices.
But it seems to prove out that having the driver bound to the devices
with the relevant runtime pm ops is the missing piece in my use case on
the OPi5.
Hope this additional data point helps!
--
Chad LeClair
next prev parent reply other threads:[~2024-03-17 23:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1456131709882456@mail.yandex.ru>
2024-03-08 13:27 ` [PATCH v8 7/7] clk: rockchip: implement proper GATE_LINK support Sebastian Reichel
[not found] ` <20561709904626@c6cdvt45gvthiay5.myt.yp-c.yandex.net>
2024-03-08 13:59 ` Sebastian Reichel
2024-03-17 23:34 ` Chad LeClair [this message]
2024-03-20 16:36 ` Sebastian Reichel
2024-03-20 17:20 ` Ilya K
2024-03-21 2:50 ` Chad LeClair
2024-03-21 18:31 ` Sebastian Reichel
2024-03-21 19:01 ` Ilya K
2024-03-21 20:45 ` Sebastian Reichel
2024-03-22 0:57 ` Chad LeClair
2024-03-22 7:06 ` Ilya K
2024-01-26 18:18 [PATCH v8 0/7] rockchip: clk: improve " Sebastian Reichel
2024-01-26 18:18 ` [PATCH v8 7/7] clk: rockchip: implement proper " Sebastian Reichel
2024-01-26 19:36 ` Dmitry Osipenko
2024-01-30 14:47 ` Sebastian Reichel
2024-01-31 16:10 ` Dmitry Osipenko
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=7f4b3f38-50ee-480f-a341-ab577e19bb32@gmail.com \
--to=leclair@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=heiko@sntech.de \
--cc=huangtao@rock-chips.com \
--cc=kernel@collabora.com \
--cc=kever.yang@rock-chips.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=me@0upti.me \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=zhangqing@rock-chips.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