Skip to content

Commit 296302d

Browse files
noglitchclaudiubeznea
authored andcommitted
ARM: at91: pm: fix MCKx restore routine
The at91_mckx_ps_restore() assembly function is responsible for setting back MCKx system bus clocks after exiting low power modes. Fix a typo and use tmp3 variable instead of tmp2 to correctly set MCKx to previously saved state. Tmp2 was used without the needed changes in CSS and DIV. Moreover the required bit 7, telling that MCR register's content is to be changed (CMD/write), was not set. Fix function comment to match tmp variables actually used. Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> Fixes: 28eb1d4 ("ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes") Link: https://lore.kernel.org/r/20250827145427.46819-3-nicolas.ferre@microchip.com Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> [claudiu.beznea: s/sate/state in commit description] Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
1 parent 6a3f890 commit 296302d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/arm/mach-at91/pm_suspend.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ e_done:
904904
/**
905905
* at91_mckx_ps_restore: restore MCKx settings
906906
*
907-
* Side effects: overwrites tmp1, tmp2
907+
* Side effects: overwrites tmp1, tmp2 and tmp3
908908
*/
909909
.macro at91_mckx_ps_restore
910910
#ifdef CONFIG_SOC_SAMA7
@@ -980,7 +980,7 @@ r_ps:
980980
bic tmp3, tmp3, #AT91_PMC_MCR_V2_ID_MSK
981981
orr tmp3, tmp3, tmp1
982982
orr tmp3, tmp3, #AT91_PMC_MCR_V2_CMD
983-
str tmp2, [pmc, #AT91_PMC_MCR_V2]
983+
str tmp3, [pmc, #AT91_PMC_MCR_V2]
984984

985985
wait_mckrdy tmp1
986986

0 commit comments

Comments
 (0)