lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1517308346-25299-1-git-send-email-geert+renesas@glider.be>
Date:   Tue, 30 Jan 2018 11:32:26 +0100
From:   Geert Uytterhoeven <geert+renesas@...der.be>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Chunyan Zhang <zhang.chunyan@...aro.org>
Cc:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH] regulator: core: Fix s2idle

Systems using regulators can no longer be frozen:

$ echo 0 > /sys/module/printk/parameters/console_suspend
$ echo freeze > /sys/power/state

    PM: suspend entry (s2idle)
    PM: Syncing filesystems ... done.
    Freezing user space processes ... (elapsed 0.011 seconds) done.
    OOM killer disabled.
    Freezing remaining freezable tasks ... (elapsed 0.009 seconds) done.
    dpm_run_callback(): regulator_suspend_late+0x0/0x44 returns -22
    PM: Device regulator.7 failed to suspend late: error -22
    PM: late suspend of devices failed

Fix this by adding the missing case for s2idle.  Treat s2idle the same
as standby, as there are no separate constraints defined for s2idle.

Fixes: f7efad10b5c49289 ("regulator: add PM suspend and resume hooks")
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
regulator_check_states() also considers PM_SUSPEND_TO_IDLE an invalid
state:

    /* return 0 if the state is valid */
    static int regulator_check_states(suspend_state_t state)
    {
	    return (state > PM_SUSPEND_MAX || state == PM_SUSPEND_TO_IDLE);
    }

But I have no idea what impact it has.  So far it doesn't seem to hurt,
though.

 drivers/regulator/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 42681c10cbe4fa9f..5f411b0cca9aa838 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -333,6 +333,7 @@ regulator_get_suspend_state(struct regulator_dev *rdev, suspend_state_t state)
 		return NULL;
 
 	switch (state) {
+	case PM_SUSPEND_TO_IDLE:
 	case PM_SUSPEND_STANDBY:
 		return &rdev->constraints->state_standby;
 	case PM_SUSPEND_MEM:
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ