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: <20130403044555.GN20693@game.jcrosoft.org>
Date:	Wed, 3 Apr 2013 06:45:55 +0200
From:	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
To:	Boris BREZILLON <linux-arm@...rkiz.com>
Cc:	Nicolas Ferre <nicolas.ferre@...el.com>,
	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org,
	Rob Herring <rob.herring@...xeda.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Andrew Victor <linux@...im.org.za>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] ARM: at91/tc: fix clock source id for tc block > 1

On 18:46 Tue 02 Apr     , Boris BREZILLON wrote:
> This patch fixes wrong clock request for TC block 2.
> The second block was using t0_clk, t1_clk and t2_clk clks instead of
> t3_clk, t4_clk and t5_clk clks.
> 
this is intended as we have 3 clock per device

Best Regards,
J.
> 
> Signed-off-by: Boris BREZILLON <linux-arm@...rkiz.com>
> ---
>  drivers/misc/atmel_tclib.c |   24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c
> index c8d8e38..768a988 100644
> --- a/drivers/misc/atmel_tclib.c
> +++ b/drivers/misc/atmel_tclib.c
> @@ -142,6 +142,8 @@ static int __init tc_probe(struct platform_device *pdev)
>  	struct atmel_tc *tc;
>  	struct clk	*clk;
>  	int		irq;
> +	char		clk_id[7];
> +	int		clk_offset;
>  
>  	if (!platform_get_resource(pdev, IORESOURCE_MEM, 0))
>  		return -EINVAL;
> @@ -156,25 +158,31 @@ static int __init tc_probe(struct platform_device *pdev)
>  
>  	tc->pdev = pdev;
>  
> -	clk = clk_get(&pdev->dev, "t0_clk");
> -	if (IS_ERR(clk)) {
> -		kfree(tc);
> -		return -EINVAL;
> -	}
> -
>  	/* Now take SoC information if available */
>  	if (pdev->dev.of_node) {
>  		const struct of_device_id *match;
>  		match = of_match_node(atmel_tcb_dt_ids, pdev->dev.of_node);
>  		if (match)
>  			tc->tcb_config = match->data;
> +		clk_offset = of_alias_get_id(tc->pdev->dev.of_node, "tcb");
> +	} else
> +		clk_offset = pdev->id;
> +	clk_offset *= 3;
> +
> +	snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++);
> +	clk = clk_get(&pdev->dev, clk_id);
> +	if (IS_ERR(clk)) {
> +		kfree(tc);
> +		return -EINVAL;
>  	}
>  
>  	tc->clk[0] = clk;
> -	tc->clk[1] = clk_get(&pdev->dev, "t1_clk");
> +	snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++);
> +	tc->clk[1] = clk_get(&pdev->dev, clk_id);
>  	if (IS_ERR(tc->clk[1]))
>  		tc->clk[1] = clk;
> -	tc->clk[2] = clk_get(&pdev->dev, "t2_clk");
> +	snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++);
> +	tc->clk[2] = clk_get(&pdev->dev, clk_id);
>  	if (IS_ERR(tc->clk[2]))
>  		tc->clk[2] = clk;
>  
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
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