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: <20140204191609.GU22609@sirena.org.uk>
Date:	Tue, 4 Feb 2014 19:16:09 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Ulf Hansson <ulf.hansson@...aro.org>
Cc:	Russell King <linux@....linux.org.uk>,
	linux-arm-kernel@...ts.infradead.org,
	Alessandro Rubini <rubini@...pv.it>,
	Linus Walleij <linus.walleij@...aro.org>,
	Wolfram Sang <wsa@...-dreams.de>,
	Chris Ball <chris@...ntf.net>, linux-kernel@...r.kernel.org,
	linux-i2c@...r.kernel.org, linux-spi@...r.kernel.org,
	linux-mmc@...r.kernel.org
Subject: Re: [PATCH 07/17] spi: pl022: Don't ignore power domain and amba bus
 at system suspend

On Tue, Feb 04, 2014 at 04:58:48PM +0100, Ulf Hansson wrote:

> @@ -2328,8 +2300,23 @@ static int pl022_suspend(struct device *dev)
>  		return ret;
>  	}
>  
> -	pm_runtime_get_sync(dev);
> -	pl022_suspend_resources(pl022, false);
> +	pm_runtime_disable(dev);
> +
> +	if (!pm_runtime_status_suspended(dev)) {
> +		if (dev->pm_domain && dev->pm_domain->ops.runtime_suspend)
> +			ret = dev->pm_domain->ops.runtime_suspend(dev);
> +		else
> +			ret = dev->bus->pm->runtime_suspend(dev);
> +
> +		if (ret) {
> +			pm_runtime_enable(dev);
> +			return ret;
> +		}
> +
> +		pm_runtime_set_suspended(dev);
> +	}

This seems like a fairly hideous thing to be having to open code in an
individual driver, it all looks generic and like something that most if
not all devices ought to be doing and it looks very vulnerable to being
broken by changes in the core.  At the very least I would expect this to
be done in a helper function, though it would be even nicer if the
driver core were figuring this stuff out for us based on the device
level callback so that drivers didn't need to worry about being in power
domains or manually calling bus level callbacks.  

Putting it in a helper would at least mean that it's easier for the
mechanics to be transferred to the core proper later on.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ