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]
Message-ID: <ad20a727-bc3e-4408-8d87-fc6a16627bca@arm.com>
Date: Tue, 26 Mar 2024 11:51:09 +0100
From: Dietmar Eggemann <dietmar.eggemann@....com>
To: Lukasz Luba <lukasz.luba@....com>, linux-kernel@...r.kernel.org,
 linux-pm@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org, sboyd@...nel.org, nm@...com,
 linux-samsung-soc@...r.kernel.org, daniel.lezcano@...aro.org,
 rafael@...nel.org, viresh.kumar@...aro.org, krzysztof.kozlowski@...aro.org,
 alim.akhtar@...sung.com, m.szyprowski@...sung.com, mhiramat@...nel.org
Subject: Re: [RESEND][PATCH v2 2/4] PM: EM: Change the
 em_adjust_new_capacity() to re-use code

On 22/03/2024 12:08, Lukasz Luba wrote:

Maybe better : "PM: EM: Refactoring em_adjust_new_capacity()" ?

> There is going to be a new update function addressing chip binning.
> Therefore, some common code which can be refactored and called from
> upcoming changes and em_adjust_new_capacity(). In this way the code
> duplication can be avoided.

IMHO, that's hard to digest.

Extract em_table_dup() and em_recalc_and_update() from
em_adjust_new_capacity(). Both functions will be later reused by the
'update EM due to chip binning' functionality.

[...]

> +static int em_recalc_and_update(struct device *dev, struct em_perf_domain *pd,
> +				struct em_perf_table __rcu *em_table)
> +{
> +	int ret;
> +
> +	ret = em_compute_costs(dev, em_table->state, NULL, pd->nr_perf_states,
>  			       pd->flags);
> -	if (ret) {
> -		dev_warn(dev, "EM: compute costs failed\n");
> -		return;
> -	}
> +	if (ret)
> +		goto free_em_table;

There seems to be a subtle change in this patch. When em_compute_costs()
fails now em_table_free() is called. This wasn't the case before when
em_compute_costs() was directly called from em_adjust_new_capacity().

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ