mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel: power: swap: Suppress expected 'Image not found'  error on Ubuntu
@ 2022-12-15  6:20 Shradha Gupta
  2023-01-13 20:14 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Shradha Gupta @ 2022-12-15  6:20 UTC (permalink / raw)
  To: linux-kernel, linux-pm
  Cc: Shradha Gupta, Rafael J. Wysocki, Pavel Machek, Len Brown,
	Dexuan Cui, Michael Kelley

In 'systemctl hibernate' if resume device is written to the sysfs
resume parameter, a software_resume() call is triggerred. This call
is expected to fail in swsusp_check() call with -EBUSY error and an
'Image not found' error message. This fix suppresses the expected
failure message from getting logged in Ubuntu setups where
CONFIG_DYNAMIC_DEBUG is enabled by default.

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
---
 kernel/power/swap.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 277434b6c0bf..9cbd3edc8339 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -1552,6 +1552,14 @@ int swsusp_check(void)
 			pr_debug("Image signature found, resuming\n");
 	} else {
 		error = PTR_ERR(hib_resume_bdev);
+		/*
+		 * If this call is triggered by `systemctl hibernate`, the
+		 * call is expected to fail with -EBUSY error.
+		 * TODO: Figure out a better way to suppress the error msg
+		 * in this case.
+		 */
+		if (error == -EBUSY)
+			return error;
 	}
 
 	if (error)
-- 
2.37.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-14  0:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15  6:20 [PATCH] kernel: power: swap: Suppress expected 'Image not found' error on Ubuntu Shradha Gupta
2023-01-13 20:14 ` Rafael J. Wysocki
2023-01-14  0:11   ` Dexuan Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®