kernel_samsung_a53x/kernel/power
Brian Geffon 0180700f83 PM: hibernate: Clean up sync_read handling in snapshot_write_next()
commit d08970df1980476f27936e24d452550f3e9e92e1 upstream.

In snapshot_write_next(), sync_read is set and unset in three different
spots unnecessiarly. As a result there is a subtle bug where the first
page after the meta data has been loaded unconditionally sets sync_read
to 0. If this first PFN was actually a highmem page, then the returned
buffer will be the global "buffer," and the page needs to be loaded
synchronously.

That is, I'm not sure we can always assume the following to be safe:

	handle->buffer = get_buffer(&orig_bm, &ca);
	handle->sync_read = 0;

Because get_buffer() can call get_highmem_page_buffer() which can
return 'buffer'.

The easiest way to address this is just set sync_read before
snapshot_write_next() returns if handle->buffer == buffer.

Signed-off-by: Brian Geffon <bgeffon@google.com>
Fixes: 8357376d3df2 ("[PATCH] swsusp: Improve handling of highmem")
Cc: All applicable <stable@vger.kernel.org>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 11:43:24 +01:00
..
autosleep.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
console.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
energy_model.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hibernate.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
power.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
poweroff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
process.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
snapshot.c PM: hibernate: Clean up sync_read handling in snapshot_write_next() 2024-11-18 11:43:24 +01:00
suspend.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
suspend_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
swap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
user.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wakelock.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wakeup_reason.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00