From: Ionela Voinescu <ionela.voinescu@arm.com>
To: linux-kernel@vger.kernel.org,
Saravana Kannan <saravanak@google.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-tip-commits@vger.kernel.org, x86 <x86@kernel.org>,
liviu.dudau@arm.com, sudeep.holla@arm.com,
lorenzo.pieralisi@arm.com
Subject: Re: [tip: timers/core] clocksource/drivers/timer-probe: Avoid creating dead devices
Date: Tue, 24 Mar 2020 17:59:55 +0000 [thread overview]
Message-ID: <20200324175955.GA16972@arm.com> (raw)
In-Reply-To: <158460766637.28353.11325960928759668587.tip-bot2@tip-bot2>
Hi guys,
On Thursday 19 Mar 2020 at 08:47:46 (-0000), tip-bot2 for Saravana Kannan wrote:
> The following commit has been merged into the timers/core branch of tip:
>
> Commit-ID: 4f41fe386a94639cd9a1831298d4f85db5662f1e
> Gitweb: https://git.kernel.org/tip/4f41fe386a94639cd9a1831298d4f85db5662f1e
> Author: Saravana Kannan <saravanak@google.com>
> AuthorDate: Fri, 10 Jan 2020 21:21:25 -08:00
> Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
> CommitterDate: Tue, 17 Mar 2020 13:10:07 +01:00
>
> clocksource/drivers/timer-probe: Avoid creating dead devices
>
> Timer initialization is done during early boot way before the driver
> core starts processing devices and drivers. Timers initialized during
> this early boot period don't really need or use a struct device.
>
> However, for timers represented as device tree nodes, the struct devices
> are still created and sit around unused and wasting memory. This change
> avoid this by marking the device tree nodes as "populated" if the
> corresponding timer is successfully initialized.
>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Link: https://lore.kernel.org/r/20200111052125.238212-1-saravanak@google.com
> ---
> drivers/clocksource/timer-probe.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/clocksource/timer-probe.c b/drivers/clocksource/timer-probe.c
> index ee9574d..a10f28d 100644
> --- a/drivers/clocksource/timer-probe.c
> +++ b/drivers/clocksource/timer-probe.c
> @@ -27,8 +27,10 @@ void __init timer_probe(void)
>
> init_func_ret = match->data;
>
> + of_node_set_flag(np, OF_POPULATED);
> ret = init_func_ret(np);
> if (ret) {
> + of_node_clear_flag(np, OF_POPULATED);
> if (ret != -EPROBE_DEFER)
> pr_err("Failed to initialize '%pOF': %d\n", np,
> ret);
>
This patch is creating problems on some vexpress platforms - ones that
are using CLKSRC_VERSATILE (drivers/clocksource/timer-versatile.c).
I noticed issues on TC2 and FVPs (fixed virtual platforms) starting with
next-20200318 and still reproducible with next-20200323.
It seems the issue this patch causes on TC2 and FVP is related to the
vexpress-sysreg node being used early for sched_clock_init
(timer_versatile.c: versatile_sched_clock_init). At this point (at
time_init) the node will be marked as OF_POPULATED, which flags that a
device is already created for it, but it is not, in this case.
Later at sysreg_init (vexpress-sysreg.c) a device will fail to be created
for it, as one already exists. This will result in a failure to create a
bridge and a system controller for a bunch of devices (mostly clocks and
regulators).
I think on the FVP it does not cause many issues as clocks are fixed and
regulator settings are probably nops so it boots fine and throws only
some warnings. On TC2 on the other hand it fails to boot and it hangs at
starting the kernel.
In my opinion the idea of the patch is not bad, but I'm not an expert on
this so the most I can offer for now is the basic understanding of the
issue. I've Cc-ed a few folks to potentially suggest alternatives/fixes.
For now, reverting this patch solves the problems on both platforms.
I tested this on next-20200318 which introduced the problem.
Hope it helps,
Ionela.
next prev parent reply other threads:[~2020-03-24 17:59 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-11 5:21 [PATCH v1] clocksource: Avoid creating dead devices Saravana Kannan
2020-02-19 2:20 ` Saravana Kannan
2020-02-27 9:06 ` Daniel Lezcano
2020-02-27 21:22 ` Saravana Kannan
2020-03-04 19:30 ` Saravana Kannan
2020-03-04 19:56 ` Daniel Lezcano
2020-03-08 5:53 ` Saravana Kannan
2020-03-16 14:57 ` Daniel Lezcano
2020-03-16 17:49 ` Saravana Kannan
2020-03-16 18:07 ` Daniel Lezcano
2020-03-16 18:15 ` Saravana Kannan
[not found] ` <5e70b653.1c69fb81.b03d8.d2bbSMTPIN_ADDED_MISSING@mx.google.com>
2020-03-17 18:08 ` Saravana Kannan
2020-03-17 18:18 ` Daniel Lezcano
2020-03-19 8:47 ` [tip: timers/core] clocksource/drivers/timer-probe: " tip-bot2 for Saravana Kannan
2020-03-24 17:59 ` Ionela Voinescu [this message]
2020-03-24 18:34 ` Saravana Kannan
2020-03-24 19:56 ` Saravana Kannan
2020-03-25 21:47 ` Thomas Gleixner
2020-03-25 22:56 ` Saravana Kannan
2020-03-25 23:06 ` Saravana Kannan
2020-03-26 10:17 ` Daniel Lezcano
2020-03-26 17:35 ` Saravana Kannan
2020-03-26 10:33 ` Thomas Gleixner
2020-03-26 15:02 ` Rob Herring
2020-03-26 18:08 ` Saravana Kannan
2020-03-28 2:23 ` Rob Herring
2020-03-25 21:29 ` Jon Hunter
2020-03-26 1:21 ` Dmitry Osipenko
2020-03-28 10:30 ` [tip: timers/core] Revert "clocksource/drivers/timer-probe: Avoid creating dead devices" tip-bot2 for Thomas Gleixner
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=20200324175955.GA16972@arm.com \
--to=ionela.voinescu@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=saravanak@google.com \
--cc=sudeep.holla@arm.com \
--cc=x86@kernel.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