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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 May 2013 10:04:03 -0500
From:	Nishanth Menon <nm@...com>
To:	<Sudeep.KarkadaNagesha@....com>
CC:	<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <rob.herring@...xeda.com>,
	Rob Landley <rob@...dley.net>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Shawn Guo <shawn.guo@...aro.org>,
	<devicetree-discuss@...ts.ozlabs.org>, <linux-doc@...r.kernel.org>
Subject: Re: [PATCH 2/2] PM / OPP: check for existing OPP list when
 initialising from device tree

On 12:11-20130501, Sudeep.KarkadaNagesha@....com wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@....com>
> 
> CPUs are registered as devices and their OPPs can be initialised from
> the device tree. Whenever CPUs can be hotplugged out, the corresponding
> cpu devices are not removed. As a result all their OPPs remain intact
> even when they are offlined.
> 
> But when they are hotplugged back-in, the cpufreq along with other cpu
> related subsystem gets re-initialised. Since its almost same as secondary
> cpu being brought up, no special consideration is taken in the hotplug
> path. As a result of this the cpufreq will try to initialise the OPPs
> again though the cpu device already contains the OPPs.
> 
> This patch checks if there exist an OPP list associated with the device,
> before attempting to initialise it.
> 
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@....com>
> ---
>  drivers/base/power/opp.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index 4dfdc01..66d52d2 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -706,6 +706,11 @@ static int of_init_opp_table_from_ofnode(struct device *dev,
>  	const __be32 *val;
>  	int nr;
>  
> +	/* Check for existing list for 'dev' */
> +	dev_opp = find_device_opp(dev);
> +	if (!IS_ERR(dev_opp))
> +		return 0; /* Device OPP already initialized */
> +
It gets a little touchy here -> the normal expectation is for the OPP
entries to be populated onetime at boot.
For example - driver bug where same device was attempted twice Vs the
usecase you mention here - how'd we differentiate between the two?
>  	prop = of_find_property(of_node, "operating-points", NULL);
>  	if (!prop)
>  		return -ENODEV;
> -- 
> 1.7.10.4
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ