Skip to content

Commit 86cef45

Browse files
jwrdegoedeij-intel
authored andcommitted
platform/x86: pmc_atom: Check state of PMC clocks on s2idle
Extend the s2idle check with checking that none of the PMC clocks is in the forced-on state. If one of the clocks is in forced on state then S0i3 cannot be reached. Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 1bde4af commit 86cef45

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/platform/x86/pmc_atom.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ static void pmc_s2idle_check(void)
477477
u32 func_dis, func_dis_2;
478478
u32 d3_sts_0, d3_sts_1;
479479
u32 false_pos_sts_0, false_pos_sts_1;
480+
int i;
480481

481482
func_dis = pmc_reg_read(pmc, PMC_FUNC_DIS);
482483
func_dis_2 = pmc_reg_read(pmc, PMC_FUNC_DIS_2);
@@ -501,6 +502,16 @@ static void pmc_s2idle_check(void)
501502

502503
pmc_dev_state_check(d3_sts_0, m->d3_sts_0, func_dis, m->func_dis, false_pos_sts_0);
503504
pmc_dev_state_check(d3_sts_1, m->d3_sts_1, func_dis_2, m->func_dis_2, false_pos_sts_1);
505+
506+
/* Forced-on PMC clocks prevent S0i3 */
507+
for (i = 0; i < PMC_CLK_NUM; i++) {
508+
u32 ctl = pmc_reg_read(pmc, PMC_CLK_CTL_OFFSET + 4 * i);
509+
510+
if ((ctl & PMC_MASK_CLK_CTL) != PMC_CLK_CTL_FORCE_ON)
511+
continue;
512+
513+
pr_err("clock %d is ON prior to freeze (ctl 0x%08x)\n", i, ctl);
514+
}
504515
}
505516

506517
static struct acpi_s2idle_dev_ops pmc_s2idle_ops = {

0 commit comments

Comments
 (0)