All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Tushar Behera <tushar.b@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	kgene.kim@samsung.com, mturquette@linaro.org, t.figa@samsung.com,
	trblinux@gmail.com
Subject: Re: [PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks
Date: Mon, 14 Jul 2014 17:34:34 +0200	[thread overview]
Message-ID: <53C3F88A.8080005@samsung.com> (raw)
In-Reply-To: <1405080036-6651-4-git-send-email-tushar.b@samsung.com>

On 11/07/14 14:00, Tushar Behera wrote:
> @@ -103,17 +140,11 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
>  		return PTR_ERR(reg_base);
>  	}
>  
> -	clk_table = devm_kzalloc(&pdev->dev,
> -				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> -				GFP_KERNEL);
> -	if (!clk_table)
> +	ctx = samsung_clk_init(pdev->dev.of_node, reg_base, nr_clks);

There is an issue here that this registers the clk provider before all
its clocks are registered with the clk core. Therefore it introduces
a race condition.

Please have a look at patch [1], you may want to rebase this series
onto that patch.

> +	samsung_clk_register_div(ctx, exynos_audss_div_clks,
> +				ARRAY_SIZE(exynos_audss_div_clks));
[...]
> +	samsung_clk_register_gate(ctx, exynos_audss_gate_clks,
> +				ARRAY_SIZE(exynos_audss_gate_clks));
[...]
> -	ret = of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
> -					&clk_data);
> -	if (ret) {
> -		dev_err(&pdev->dev, "failed to add clock provider\n");
> -		goto unregister;
> +		samsung_clk_register_gate(ctx, exynos5420_audss_gate_clks,
> +					ARRAY_SIZE(exynos5420_audss_gate_clks));
>  	}

[1]
https://git.kernel.org/cgit/linux/kernel/git/tfiga/samsung-clk.git/commit/?h=samsung-clk-next&id=d5e136a21b2028fb1f45143ea7112d5869bfc6c7

--
Regards,
Sylwester

WARNING: multiple messages have this Message-ID (diff)
From: s.nawrocki@samsung.com (Sylwester Nawrocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks
Date: Mon, 14 Jul 2014 17:34:34 +0200	[thread overview]
Message-ID: <53C3F88A.8080005@samsung.com> (raw)
In-Reply-To: <1405080036-6651-4-git-send-email-tushar.b@samsung.com>

On 11/07/14 14:00, Tushar Behera wrote:
> @@ -103,17 +140,11 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
>  		return PTR_ERR(reg_base);
>  	}
>  
> -	clk_table = devm_kzalloc(&pdev->dev,
> -				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> -				GFP_KERNEL);
> -	if (!clk_table)
> +	ctx = samsung_clk_init(pdev->dev.of_node, reg_base, nr_clks);

There is an issue here that this registers the clk provider before all
its clocks are registered with the clk core. Therefore it introduces
a race condition.

Please have a look at patch [1], you may want to rebase this series
onto that patch.

> +	samsung_clk_register_div(ctx, exynos_audss_div_clks,
> +				ARRAY_SIZE(exynos_audss_div_clks));
[...]
> +	samsung_clk_register_gate(ctx, exynos_audss_gate_clks,
> +				ARRAY_SIZE(exynos_audss_gate_clks));
[...]
> -	ret = of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
> -					&clk_data);
> -	if (ret) {
> -		dev_err(&pdev->dev, "failed to add clock provider\n");
> -		goto unregister;
> +		samsung_clk_register_gate(ctx, exynos5420_audss_gate_clks,
> +					ARRAY_SIZE(exynos5420_audss_gate_clks));
>  	}

[1]
https://git.kernel.org/cgit/linux/kernel/git/tfiga/samsung-clk.git/commit/?h=samsung-clk-next&id=d5e136a21b2028fb1f45143ea7112d5869bfc6c7

--
Regards,
Sylwester

  reply	other threads:[~2014-07-14 15:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 12:00 [PATCH V2 0/3] clk: exynos-audss: Adapt to exising clock framework Tushar Behera
2014-07-11 12:00 ` Tushar Behera
2014-07-11 12:00 ` [PATCH V2 1/3] clk: exynos-audss: Simplify code to get clock names Tushar Behera
2014-07-11 12:00   ` Tushar Behera
2014-07-11 12:00 ` [PATCH V2 2/3] clk: samsung: Add API to unregister clocks Tushar Behera
2014-07-11 12:00   ` Tushar Behera
2014-07-11 12:00 ` [PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks Tushar Behera
2014-07-11 12:00   ` Tushar Behera
2014-07-14 15:34   ` Sylwester Nawrocki [this message]
2014-07-14 15:34     ` Sylwester Nawrocki
2014-07-15  3:02     ` Tushar Behera
2014-07-15  3:02       ` Tushar Behera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C3F88A.8080005@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=t.figa@samsung.com \
    --cc=trblinux@gmail.com \
    --cc=tushar.b@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.