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] [day] [month] [year] [list]
Message-ID: <20140901144700.GA18134@opensource.wolfsonmicro.com>
Date:	Mon, 1 Sep 2014 15:47:00 +0100
From:	Richard Fitzgerald <rf@...nsource.wolfsonmicro.com>
To:	broonie@...nel.org, lee.jones@...aro.org, sameo@...ux.intel.com,
	lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.de
Cc:	alsa-devel@...a-project.org, patches@...nsource.wolfsonmicro.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3 v4 RESEND] mfd: arizona: Export function to control
	subsystem DVFS

>  
> +
> +int arizona_dvfs_down(struct arizona *arizona, unsigned int flags)
> +{
> +	int ret = 0;
> +
> +	mutex_lock(&arizona->subsys_max_lock);
> +
> +	if ((arizona->subsys_max_rq & flags) != flags)
> +		dev_warn(arizona->dev, "Unbalanced DVFS down: %x\n", flags);

This warning is bogus and should be removed. These are just simple on/off bit
flags, not a reference count. If a requestor is already at the lower DVFS
state we just do nothing.

It was done this way to keep the code simple and lower risk. None of the
blocks that need to move the DVFS frequency up and down have multiple users
so they are simple either/or cases that don't currently reference count
themselves. So having a boolean flag to match the state of each block
keeps the change set smaller.

> +
> +	arizona->subsys_max_rq &= ~flags;
> +
> +	if (arizona->subsys_max_rq == 0) {
> +		switch (arizona->type) {
> +		case WM5102:
> +		case WM8997:
> +			ret = regmap_update_bits(arizona->regmap,
> +					ARIZONA_DYNAMIC_FREQUENCY_SCALING_1,
> +					ARIZONA_SUBSYS_MAX_FREQ, 0);
> +			if (ret != 0)
> +				dev_err(arizona->dev,
> +					"Failed to disable subsys max: %d\n",
> +					ret);
> +
> +			ret = regulator_set_voltage(arizona->dcvdd,
> +						    1200000, 1800000);
> +			if (ret != 0)
> +				dev_err(arizona->dev,
> +					"Failed to set DCVDD (DVFS down): %d\n",
> +					ret);
> +			break;
> +
> +		default:
> +			break;
> +		}
> +	}
> +
> +	mutex_unlock(&arizona->subsys_max_lock);
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(arizona_dvfs_down);
> +
--
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