Re: [PATCH] clk: tegra: dfll: Properly protect OPP list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/10, Thierry Reding wrote:
> 
> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>

Fixes: ?

> ---
>  drivers/clk/tegra/clk-dfll.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
> index aa026bcf5b00..8e25bd52da8c 100644
> --- a/drivers/clk/tegra/clk-dfll.c
> +++ b/drivers/clk/tegra/clk-dfll.c
> @@ -632,11 +632,15 @@ static int find_lut_index_for_rate(struct tegra_dfll *td, unsigned long rate)
>  	struct dev_pm_opp *opp;
>  	int i, uv;
>  
> +	rcu_read_lock();
> +
>  	opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate);
>  	if (IS_ERR(opp))
>  		return PTR_ERR(opp);
>  	uv = dev_pm_opp_get_voltage(opp);
>  
> +	rcu_read_unlock();
> +
>  	for (i = 0; i < td->i2c_lut_size; i++) {
>  		if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv)
>  			return i;
> @@ -1450,6 +1454,8 @@ static int dfll_build_i2c_lut(struct tegra_dfll *td)
>  	td->i2c_lut[0] = lut;
>  
>  	for (j = 1, rate = 0; ; rate++) {
> +		rcu_read_lock();

Don't we already have an rcu_read_lock() at the beginning of this
function? I don't understand why we need to nest them in the same
function.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux