lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Oct 2020 02:19:22 +0300
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Saravana Kannan <saravanak@...gle.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>, geert+renesas@...der.be,
        gregkh@...uxfoundation.org, grygorii.strashko@...com,
        linux-omap@...r.kernel.org, linux-pm@...r.kernel.org,
        peter.ujfalusi@...com, rjw@...ysocki.net, tomi.valkeinen@...com,
        tony@...mide.com, ulf.hansson@...aro.org, kernel-team@...roid.com,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the
 init_machine() path

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?

:-(

> Reported-by: Tomi Valkeinen <tomi.valkeinen@...com>
> Signed-off-by: Saravana Kannan <saravanak@...gle.com>
> ---
>  drivers/of/platform.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 071f04da32c8..79972e49b539 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -501,8 +501,21 @@ int of_platform_default_populate(struct device_node *root,
>  				 const struct of_dev_auxdata *lookup,
>  				 struct device *parent)
>  {
> -	return of_platform_populate(root, of_default_bus_match_table, lookup,
> -				    parent);
> +	int ret;
> +
> +	/*
> +	 * fw_devlink_pause/resume() are only safe to be called around top
> +	 * level device addition due to locking constraints.
> +	 */
> +	if (!root)
> +		fw_devlink_pause();
> +
> +	ret = of_platform_populate(root, of_default_bus_match_table, lookup,
> +				   parent);
> +
> +	if (!root)
> +		fw_devlink_resume();
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(of_platform_default_populate);
>  
> @@ -538,9 +551,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;
>  }

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ