All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP3:PM: reject disabled OPP
@ 2009-09-25 23:14 Nishanth Menon
  2009-09-30 16:46 ` Kevin Hilman
  0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Menon @ 2009-09-25 23:14 UTC (permalink / raw)
  To: linux-omap; +Cc: Kevin H, Nishanth Menon

when the omap_opp structures are disabled by setting the
frequency as 0 as below (as an example)
{0, VDD2_OPP1, 0x1E},
program_opp attempts to set voltage even after frequency
setting fails. we can instead return if we see invalid
values for either frequency or voltage

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/resource34xx.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c
index 1693e9b..491e1dc 100644
--- a/arch/arm/mach-omap2/resource34xx.c
+++ b/arch/arm/mach-omap2/resource34xx.c
@@ -282,6 +282,11 @@ static int program_opp(int res, struct omap_opp *opp, int target_level,
 	t_opp = ID_VDD(res) | ID_OPP_NO(opp[target_level].opp_id);
 	c_opp = ID_VDD(res) | ID_OPP_NO(opp[current_level].opp_id);
 #endif
+
+	/* Sanity check of the OPP params before attempting to set */
+	if (!opp[target_level].rate || !opp[target_level].vsel)
+		return -EINVAL;
+
 	if (target_level > current_level)
 		raise = 1;
 	else
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] OMAP3:PM: reject disabled OPP
  2009-09-25 23:14 [PATCH] OMAP3:PM: reject disabled OPP Nishanth Menon
@ 2009-09-30 16:46 ` Kevin Hilman
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2009-09-30 16:46 UTC (permalink / raw)
  To: Nishanth Menon; +Cc: linux-omap

Nishanth Menon <nm@ti.com> writes:

> when the omap_opp structures are disabled by setting the
> frequency as 0 as below (as an example)
> {0, VDD2_OPP1, 0x1E},
> program_opp attempts to set voltage even after frequency
> setting fails. we can instead return if we see invalid
> values for either frequency or voltage
>
> Signed-off-by: Nishanth Menon <nm@ti.com>

Looks good, pushing to PM branch.

Kevin

> ---
>  arch/arm/mach-omap2/resource34xx.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c
> index 1693e9b..491e1dc 100644
> --- a/arch/arm/mach-omap2/resource34xx.c
> +++ b/arch/arm/mach-omap2/resource34xx.c
> @@ -282,6 +282,11 @@ static int program_opp(int res, struct omap_opp *opp, int target_level,
>  	t_opp = ID_VDD(res) | ID_OPP_NO(opp[target_level].opp_id);
>  	c_opp = ID_VDD(res) | ID_OPP_NO(opp[current_level].opp_id);
>  #endif
> +
> +	/* Sanity check of the OPP params before attempting to set */
> +	if (!opp[target_level].rate || !opp[target_level].vsel)
> +		return -EINVAL;
> +
>  	if (target_level > current_level)
>  		raise = 1;
>  	else
> -- 
> 1.6.0.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-30 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 23:14 [PATCH] OMAP3:PM: reject disabled OPP Nishanth Menon
2009-09-30 16:46 ` Kevin Hilman

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.