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: <20230803-samsung_tty_pm_ops-v1-1-1ea7be72194d@axis.com>
Date:   Thu, 3 Aug 2023 13:26:42 +0200
From:   Anton Eliasson <anton.eliasson@...s.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-samsung-soc@...r.kernel.org>,
        <linux-serial@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <kernel@...s.com>, Anton Eliasson <anton.eliasson@...s.com>
Subject: [PATCH] tty: serial: samsung: Set missing PM ops for hibernation
 support

At least freeze, restore and thaw need to be set in order for the driver
to support system hibernation. The existing suspend/resume functions can
be reused since those functions don't touch the device's power state or
wakeup capability. Use the helper macros SET_SYSTEM_SLEEP_PM_OPS and
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for symmetry with similar drivers.

Signed-off-by: Anton Eliasson <anton.eliasson@...s.com>
---
I have not investigated the impact of adding the additional noirq
handler functions. The hardware that I tested on (Axis ARTPEC-8) appears
to work both with and without them assigned. Other similar drivers that
use noirq handlers assign them to both resume, thaw and restore so I
follow that style also.
---
 drivers/tty/serial/samsung_tty.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index b29e9dfd81a6..e2247c11067d 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2273,9 +2273,8 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
 }
 
 static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
-	.suspend = s3c24xx_serial_suspend,
-	.resume = s3c24xx_serial_resume,
-	.resume_noirq = s3c24xx_serial_resume_noirq,
+	SET_SYSTEM_SLEEP_PM_OPS(s3c24xx_serial_suspend, s3c24xx_serial_resume)
+	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, s3c24xx_serial_resume_noirq)
 };
 #define SERIAL_SAMSUNG_PM_OPS	(&s3c24xx_serial_pm_ops)
 

---
base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
change-id: 20230731-samsung_tty_pm_ops-7c98f309a4e9

Best regards,
-- 
Anton Eliasson <anton.eliasson@...s.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ