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]
Date:   Tue,  9 Nov 2021 13:55:05 +0100
From:   Martin Kepplinger <martin.kepplinger@...i.sm>
To:     sakari.ailus@...ux.intel.com, mchehab@...nel.org
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...i.sm, linux-pm@...r.kernel.org,
        Martin Kepplinger <martin.kepplinger@...i.sm>
Subject: [PATCH] media: i2c: dw9714: use pm_runtime_force_suspend/resume for system suspend

Using the same suspend function for runtime and system suspend doesn't
work in this case (when controlling regulators and clocks). suspend() and
resume() are clearly meant to stay balanced.

Use the pm_runtime_force_* helpers for system suspend and fix error like the
following when transitioning to system suspend:

[  559.685921] dw9714 3-000c: I2C write fail
[  559.685941] dw9714 3-000c: dw9714_vcm_suspend I2C failure: -5

Signed-off-by: Martin Kepplinger <martin.kepplinger@...i.sm>
---
 drivers/media/i2c/dw9714.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c
index fcbebb3558b5..f6ddd7c4a1ff 100644
--- a/drivers/media/i2c/dw9714.c
+++ b/drivers/media/i2c/dw9714.c
@@ -267,7 +267,8 @@ static const struct of_device_id dw9714_of_table[] = {
 MODULE_DEVICE_TABLE(of, dw9714_of_table);
 
 static const struct dev_pm_ops dw9714_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(dw9714_vcm_suspend, dw9714_vcm_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 	SET_RUNTIME_PM_OPS(dw9714_vcm_suspend, dw9714_vcm_resume, NULL)
 };
 
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ