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: <47446717.2V0dGQkMbA@vostro.rjw.lan>
Date:	Fri, 30 Jan 2015 01:18:06 +0100
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc:	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] PM / QoS: Use lockdep asserts to find missing hold of power.lock

On Friday, January 09, 2015 09:27:58 AM Krzysztof Kozlowski wrote:
> Add lockdep asserts for holding the dev->power.lock to non-static
> functions which require this. They could be used outside of the file so
> asserts may help in detecting locking misuse.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>

Queued up for 3.20, thanks!

> ---
>  drivers/base/power/qos.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
> index a8fe4c1a8d07..e56d538d039e 100644
> --- a/drivers/base/power/qos.c
> +++ b/drivers/base/power/qos.c
> @@ -64,6 +64,8 @@ enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask)
>  	struct pm_qos_flags *pqf;
>  	s32 val;
>  
> +	lockdep_assert_held(&dev->power.lock);
> +
>  	if (IS_ERR_OR_NULL(qos))
>  		return PM_QOS_FLAGS_UNDEFINED;
>  
> @@ -104,6 +106,8 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_flags);
>   */
>  s32 __dev_pm_qos_read_value(struct device *dev)
>  {
> +	lockdep_assert_held(&dev->power.lock);
> +
>  	return IS_ERR_OR_NULL(dev->power.qos) ?
>  		0 : pm_qos_read_value(&dev->power.qos->resume_latency);
>  }
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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