From: Saravana Kannan <saravanak@google.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux-OMAP <linux-omap@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Tony Lindgren <tony@atomide.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Android Kernel Team <kernel-team@android.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path
Date: Fri, 2 Oct 2020 10:48:22 -0700 [thread overview]
Message-ID: <CAGETcx-wkZZQyfnkc59e2ECg_kho-O_c2ms4OOtM4=-Hd125+Q@mail.gmail.com> (raw)
In-Reply-To: <e0ef8816-11ea-3a1a-cac6-14b9f6c92bcf@ti.com>
On Fri, Oct 2, 2020 at 8:03 AM 'Grygorii Strashko' via kernel-team
<kernel-team@android.com> wrote:
>
>
>
> On 02/10/2020 14:40, Grygorii Strashko wrote:
> >
> >
> > On 02/10/2020 02:19, Laurent Pinchart wrote:
> >> Hi Saravana,
> >>
> >> Thank you for the patch.
> >>
> >> On Thu, Oct 01, 2020 at 03:59:51PM -0700, Saravana Kannan wrote:
> >>> When commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when
> >>> adding all top level devices") optimized the fwnode parsing when all top
> >>> level devices are added, it missed out optimizing this for platform
> >>> where the top level devices are added through the init_machine() path.
> >>>
> >>> This commit does the optimization for all paths by simply moving the
> >>> fw_devlink_pause/resume() inside of_platform_default_populate().
> >>
> >> Based on v5.9-rc5, before the patch:
> >>
> >> [ 0.652887] cpuidle: using governor menu
> >> [ 12.349476] No ATAGs?
> >>
> >> After the patch:
> >>
> >> [ 0.650460] cpuidle: using governor menu
> >> [ 12.262101] No ATAGs?
> >>
> >> :-(
> >
> > This is kinda expected :( because omap2 arch doesn't call of_platform_default_populate()
> >
> > Call path:
> > board-generic.c
> > DT_MACHINE_START()
> > .init_machine = omap_generic_init,
> >
> > omap_generic_init()
> > pdata_quirks_init(omap_dt_match_table);
> > of_platform_populate(NULL, omap_dt_match_table,
> > omap_auxdata_lookup, NULL);
> >
> > Other affected platforms
> > arm: mach-ux500
> > some mips
> > some powerpc
> >
> > there are also case when a lot of devices placed under bus node, in such case
> > of_platform_populate() calls from bus drivers will also suffer from this issue.
> >
> > I think one option could be to add some parameter to _populate() or introduce new api.
> >
> > By the way, is there option to disable this feature at all?
> > Is there Kconfig option?
> > Is there any reasons why such complex and time consuming code added to the kernel and not implemented on DTC level?
> >
> >
> > Also, I've came with another diff, pls check.
> >
> > [ 0.000000] Booting Linux on physical CPU 0x0
> > [ 0.000000] Linux version 5.9.0-rc6-01791-g9acba6b38757-dirty (grygorii@grygorii-XPS-13-9370) (arm-linux-gnueabihf-gcc (GNU Toolcha0
> > [ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d
> > [ 0.000000] CPU: div instructions available: patching division code
> > [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
> > [ 0.000000] OF: fdt: Machine model: TI AM5718 IDK
> > ...
> > [ 0.053443] cpuidle: using governor ladder
> > [ 0.053470] cpuidle: using governor menu
> > [ 0.089304] No ATAGs?
> > ...
> > [ 3.092291] devtmpfs: mounted
> > [ 3.095804] Freeing unused kernel memory: 1024K
> > [ 3.100483] Run /sbin/init as init process
> >
> >
> >
> > ------ >< ---
> > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> > index 071f04da32c8..4521b26e7745 100644
> > --- a/drivers/of/platform.c
> > +++ b/drivers/of/platform.c
> > @@ -514,6 +514,12 @@ static const struct of_device_id reserved_mem_matches[] = {
> > {}
> > };
> >
> > +static int __init of_platform_fw_devlink_pause(void)
> > +{
> > + fw_devlink_pause();
> > +}
> > +core_initcall(of_platform_fw_devlink_pause);
> > +
> > static int __init of_platform_default_populate_init(void)
> > {
> > struct device_node *node;
> > @@ -538,9 +544,7 @@ static int __init of_platform_default_populate_init(void)
> > }
> >
> > /* Populate everything else. */
> > - fw_devlink_pause();
> > of_platform_default_populate(NULL, NULL, NULL);
> > - fw_devlink_resume();
> >
> > return 0;
> > }
> > @@ -548,6 +552,7 @@ arch_initcall_sync(of_platform_default_populate_init);
> >
> > static int __init of_platform_sync_state_init(void)
> > {
> > + fw_devlink_resume();
>
> ^ it seems has to be done earlier, like
> +static int __init of_platform_fw_devlink_resume(void)
> +{
> + fw_devlink_resume();
> + return 0;
> +}
> +device_initcall_sync(of_platform_fw_devlink_resume);
This will mean no device will probe until device_initcall_sync().
Unfortunately, I don't think we can make such a sweeping assumption.
-Saravana
next prev parent reply other threads:[~2020-10-02 17:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200924055313.GC9471@atomide.com>
[not found] ` <fe0a4fa8-53fc-d316-261f-52f631f12469@ti.com>
[not found] ` <20200924060826.GE9471@atomide.com>
[not found] ` <20200924133049.GH3968@pendragon.ideasonboard.com>
[not found] ` <20200925115147.GM9471@atomide.com>
[not found] ` <20200925115817.GB3933@pendragon.ideasonboard.com>
[not found] ` <20200930052057.GP9471@atomide.com>
[not found] ` <d8d81891-7e22-81a2-19df-6e9a5f8679c4@ti.com>
[not found] ` <20201001075344.GU9471@atomide.com>
[not found] ` <20201001081748.GW9471@atomide.com>
[not found] ` <20201001082256.GA3722@pendragon.ideasonboard.com>
2020-10-01 12:56 ` Slow booting on x15 Grygorii Strashko
2020-10-01 13:11 ` Geert Uytterhoeven
2020-10-01 13:49 ` Grygorii Strashko
2020-10-01 18:24 ` Saravana Kannan
2020-10-01 19:43 ` Grygorii Strashko
2020-10-01 22:22 ` Saravana Kannan
2020-10-01 22:30 ` Saravana Kannan
2020-10-01 22:38 ` Laurent Pinchart
2020-10-01 22:44 ` Saravana Kannan
2020-10-01 22:59 ` [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path Saravana Kannan
2020-10-01 23:19 ` Laurent Pinchart
2020-10-02 11:40 ` Grygorii Strashko
2020-10-02 15:03 ` Grygorii Strashko
2020-10-02 17:48 ` Saravana Kannan [this message]
2020-10-02 18:11 ` Grygorii Strashko
2020-10-02 14:07 ` Rob Herring
2020-10-02 17:51 ` Saravana Kannan
2020-10-02 17:54 ` Laurent Pinchart
2020-10-02 17:58 ` Saravana Kannan
2020-10-02 18:27 ` Laurent Pinchart
2020-10-02 18:35 ` Grygorii Strashko
2020-10-02 19:56 ` Saravana Kannan
2020-10-03 0:13 ` Laurent Pinchart
2020-10-27 3:29 ` Saravana Kannan
2020-10-28 7:34 ` Tomi Valkeinen
2020-10-02 20:29 ` Rob Herring
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='CAGETcx-wkZZQyfnkc59e2ECg_kho-O_c2ms4OOtM4=-Hd125+Q@mail.gmail.com' \
--to=saravanak@google.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=grygorii.strashko@ti.com \
--cc=kernel-team@android.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=rjw@rjwysocki.net \
--cc=robh+dt@kernel.org \
--cc=tomi.valkeinen@ti.com \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.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).