Re: [PATCH] OMAP3: PM: Fix Smartreflex when used with PM_NOOP layer

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

 



Roger Quadros <ext-roger.quadros@xxxxxxxxx> writes:

> omap_pm_vddX_get_opp() returns 0 if PM layer is PM_NOOP or PM_NONE.
> This is not a valid OPP so we must sanity check this correctly before using.
>
> This patch fixes system lockup when we enable smartreflex
> "echo 1 > /sys/power/sr_vdd1_autocomp"
>
> Signed-off-by: Roger Quadros <ext-roger.quadros@xxxxxxxxx>

Oops, this looks like a side effect of my merge of Rajendra's and Phil's
patches.   

Thanks, pushing to PM branch.

Kevin

> ---
>  arch/arm/mach-omap2/smartreflex.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 42e16a6..b032366 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -787,8 +787,10 @@ static ssize_t omap_sr_vdd1_autocomp_store(struct kobject *kobj,
>  		sr_stop_vddautocomap(SR1);
>  	} else {
>  		u32 current_vdd1opp_no = omap_pm_vdd1_get_opp();
> -		if (IS_ERR_VALUE(current_vdd1opp_no))
> -			return -ENODEV;
> +		if (!current_vdd1opp_no) {
> +			pr_err("sr_vdd1_autocomp: Current VDD1 opp unknown\n");
> +			return -EINVAL;
> +		}
>  		sr_start_vddautocomap(SR1, current_vdd1opp_no);
>  	}
>  	return n;
> @@ -825,8 +827,10 @@ static ssize_t omap_sr_vdd2_autocomp_store(struct kobject *kobj,
>  		sr_stop_vddautocomap(SR2);
>  	} else {
>  		u32 current_vdd2opp_no = omap_pm_vdd2_get_opp();
> -		if (IS_ERR_VALUE(current_vdd2opp_no))
> -			return -ENODEV;
> +		if (!current_vdd2opp_no) {
> +			pr_err("sr_vdd2_autocomp: Current VDD2 opp unknown\n");
> +			return -EINVAL;
> +		}
>  		sr_start_vddautocomap(SR2, current_vdd2opp_no);
>  	}
>  	return n;
> -- 
> 1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux