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: <20120709074158.GS30009@pengutronix.de>
Date:	Mon, 9 Jul 2012 09:41:58 +0200
From:	Sascha Hauer <s.hauer@...gutronix.de>
To:	Fabio Estevam <fabio.estevam@...escale.com>
Cc:	kernel@...gutronix.de, linux-arm-kernel@...ts.infradead.org,
	Theodore Ts'o <tytso@....edu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] hw_random: mxc-rnga: Adapt clocks to new i.mx clock
 framework

On Fri, Jul 06, 2012 at 05:20:19PM -0300, Fabio Estevam wrote:
> Cc: Theodore Ts'o <tytso@....edu>
> Cc: Herbert Xu <herbert@...dor.apana.org.au> 
> Cc: <linux-kernel@...r.kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@...escale.com>
> ---
>  drivers/char/hw_random/mxc-rnga.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c
> index 85074de..c49c0b8 100644
> --- a/drivers/char/hw_random/mxc-rnga.c
> +++ b/drivers/char/hw_random/mxc-rnga.c
> @@ -152,14 +152,14 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
>  	if (rng_dev)
>  		return -EBUSY;
>  
> -	clk = clk_get(&pdev->dev, "rng");
> +	clk = clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(clk)) {
>  		dev_err(&pdev->dev, "Could not get rng_clk!\n");
>  		err = PTR_ERR(clk);
>  		goto out;
>  	}
>  
> -	clk_enable(clk);
> +	clk_prepare_enable(clk);
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -201,7 +201,7 @@ err_ioremap:
>  	release_mem_region(res->start, resource_size(res));
>  
>  err_region:
> -	clk_disable(clk);
> +	clk_disable_unprepare(clk);
>  	clk_put(clk);
>  
>  out:
> @@ -212,7 +212,7 @@ static int __exit mxc_rnga_remove(struct platform_device *pdev)
>  {
>  	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	void __iomem *rng_base = (void __iomem *)mxc_rnga.priv;
> -	struct clk *clk = clk_get(&pdev->dev, "rng");
> +	struct clk *clk = clk_get(&pdev->dev, NULL);

Uhh, that's a driver bug that should be fixed. Although right now there
is no reference counting for clocks, the driver should keep the clk
internally instead of simply calling clk_get whenever it needs access to
a clk.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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