: Fixing wrong target level being passed during Core DVFS.
Subsystems (3)
PATCH v2 1/1 : Fixing wrong target level being passed during Core DVFS.
As per the current implementaion (u8*)&target_level is being passed to freq_to_opp in set_opp. This would result in updating just the first 8 bits of a u32 variable. Later target_level is passed to resource_set_opp_level as a u32 parameter. This maens
a. Initially target_level was 0xabcdefgh.
b. freq_to_opp updates the lower eight bits of target_level to 0xXX. Now target_level = 0xabcdefXX.
c. We pass 0xabcdefXX as target_level to resource_set_opp_level when we want to pass just 0xXX.
This is leading to some corrupted bookkeeping later on in the dvfs path.
This patch ensures that target_level passed to resource_set_opp_level is actually the level that is intended by freq_to_opp API.
--- arch/arm/mach-omap2/resource34xx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/resource34xx.c +1 -0
@@ -478,6 +478,7 @@ int set_opp(struct shared_resource *resp, u32 target_level)/* uh uh.. no OPPs?? */ BUG_ON (IS_ERR (oppx)); + target_level =0 ; ret =freq_to_opp ((u8 *)&target_level,OPP_L3 , req_l3_freq);/* we dont expect this to fail */ BUG_ON (ret);
Signature · 1 line
1.5.4.7
Quoted 12 lines · Thara Gopinath
As per the current implementaion (u8*)&target_level is being passed to
freq_to_oppinset_opp. This would result in updating just the first 8 bits of a u32 variable. Latertarget_levelis passed toresource_set_opp_levelas a u32 parameter. This maens
a. Initiallytarget_levelwas 0xabcdefgh.
b.freq_to_oppupdates the lower eight bits oftarget_levelto 0xXX. Nowtarget_level= 0xabcdefXX.
c. We pass 0xabcdefXX astarget_leveltoresource_set_opp_levelwhen we want to pass just 0xXX.
This is leading to some corrupted bookkeeping later on in the dvfs path.
Quoted 5 lines
This patch ensures that
target_levelpassed toresource_set_opp_levelis actually the level that is intended byfreq_to_oppAPI.Signed-off-by Thara Gopinath <[email protected]>Cc Kevin Hilman <[email protected]>
Thanks, applying to pm-wip-opp after cleaning up the formatting in the changelog to be a little more readable.
Kevin
Quoted 18 lines
--- arch/arm/mach-omap2/resource34xx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/arm/mach-omap2/resource34xx.c +1
-0@@ -478,6 +478,7 @@ int set_opp(struct shared_resource *resp, u32 target_level)/* uh uh.. no OPPs?? */ BUG_ON (IS_ERR (oppx)); + target_level =0 ; ret =freq_to_opp ((u8 *)&target_level,OPP_L3 , req_l3_freq);/* we dont expect this to fail */ BUG_ON (ret);Signature · 1 line
1.5.4.7