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:	Mon, 21 Oct 2013 11:42:33 +0200
From:	Sylwester Nawrocki <s.nawrocki@...sung.com>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Ben Dooks <ben-linux@...ff.org>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Mark Brown <broonie@...nel.org>
Cc:	linux-arm-kernel@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org, linux-spi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH] spi/s3c64xx: Fix doubled clock disable on suspend

On 21/10/13 11:35, Krzysztof Kozlowski wrote:
> Fix doubled clock disable and unprepare during PM suspend which triggered
> the warnings:
[...]
> The clocks are already disabled before suspending.
> 
> Additionally add PM runtime get() and put() during resume so device
> won't sleep for the time of s3c64xx_spi_hwinit().
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
> ---
>  drivers/spi/spi-s3c64xx.c |   15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index a80376d..374be7d 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -1482,10 +1482,6 @@ static int s3c64xx_spi_suspend(struct device *dev)
>  
>  	spi_master_suspend(master);
>  
> -	/* Disable the clock */
> -	clk_disable_unprepare(sdd->src_clk);
> -	clk_disable_unprepare(sdd->clk);
> -
>  	sdd->cur_speed = 0; /* Output Clock is stopped */
>  
>  	return 0;
> @@ -1496,16 +1492,19 @@ static int s3c64xx_spi_resume(struct device *dev)
>  	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
>  	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
> +	int ret;
>  
> +	ret = pm_runtime_get_sync(dev);

pm_runtime_{get,put}* must not be called from drivers's system suspend/resume
callbacks. Please use pm_runtime_suspended() to check device runtime PM status
in s3c64xx_spi_{suspend,resume} callbacks and handle the clocks appropriately.

Thanks,
Sylwester
--
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