<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/power, branch next/HEAD</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=next%2FHEAD</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=next%2FHEAD'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2026-04-09T13:23:30Z</updated>
<entry>
<title>Merge branch 'linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git</title>
<updated>2026-04-09T13:23:30Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2026-04-09T13:23:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32f28d4273b8fc9192101a251da39be7f2e6826b'/>
<id>urn:sha1:32f28d4273b8fc9192101a251da39be7f2e6826b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'mm-unstable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm</title>
<updated>2026-04-09T12:55:29Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2026-04-09T12:55:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=49dc0f3de080190d48dcd5464e27cdefacd2e74c'/>
<id>urn:sha1:49dc0f3de080190d48dcd5464e27cdefacd2e74c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mm/swap, PM: hibernate: fix swapoff race in uswsusp by pinning swap device</title>
<updated>2026-04-08T23:26:28Z</updated>
<author>
<name>Youngjun Park</name>
<email>youngjun.park@lge.com</email>
</author>
<published>2026-03-23T16:08:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9c4b213b6a4106d88a2bbd9b076ec1c07659f296'/>
<id>urn:sha1:9c4b213b6a4106d88a2bbd9b076ec1c07659f296</id>
<content type='text'>
Patch series "mm/swap, PM: hibernate: fix swapoff race in uswsusp by
pinning swap device", v8.

Currently, in the uswsusp path, only the swap type value is retrieved at
lookup time without holding a reference. If swapoff races after the type
is acquired, subsequent slot allocations operate on a stale swap device.

Additionally, grabbing and releasing the swap device reference on every
slot allocation is inefficient across the entire hibernation swap path.

This patch series addresses these issues:
- Patch 1: Fixes the swapoff race in uswsusp by pinning the swap device
  from the point it is looked up until the session completes.
- Patch 2: Removes the overhead of per-slot reference counting in alloc/free
  paths and cleans up the redundant SWP_WRITEOK check.


This patch (of 8):

Hibernation via uswsusp (/dev/snapshot ioctls) has a race window: after
selecting the resume swap area but before user space is frozen, swapoff
may run and invalidate the selected swap device.

Fix this by pinning the swap device with SWP_HIBERNATION while it is in
use.  The pin is exclusive, which is sufficient since hibernate_acquire()
already prevents concurrent hibernation sessions.

The kernel swsusp path (sysfs-based hibernate/resume) uses
find_hibernation_swap_type() which is not affected by the pin.  It freezes
user space before touching swap, so swapoff cannot race.

Introduce dedicated helpers:
- pin_hibernation_swap_type(): Look up and pin the swap device.
  Used by the uswsusp path.
- find_hibernation_swap_type(): Lookup without pinning.
  Used by the kernel swsusp path.
- unpin_hibernation_swap_type(): Clear the hibernation pin.

While a swap device is pinned, swapoff is prevented from proceeding.

Link: https://lkml.kernel.org/r/20260323160822.1409904-1-youngjun.park@lge.com
Link: https://lkml.kernel.org/r/20260323160822.1409904-2-youngjun.park@lge.com
Signed-off-by: Youngjun Park &lt;youngjun.park@lge.com&gt;
Reviewed-by: Kairui Song &lt;kasong@tencent.com&gt;
Cc: Baoquan He &lt;bhe@redhat.com&gt;
Cc: Barry Song &lt;baohua@kernel.org&gt;
Cc: Chris Li &lt;chrisl@kernel.org&gt;
Cc: Kemeng Shi &lt;shikemeng@huaweicloud.com&gt;
Cc: Nhat Pham &lt;nphamcs@gmail.com&gt;
Cc: "Rafael J . Wysocki" &lt;rafael@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branches 'pm-cpuidle', 'pm-opp' and 'pm-sleep' into linux-next</title>
<updated>2026-04-07T19:59:20Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2026-04-07T19:59:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=388a9ebde4720ab0f66f73c6331ec32c3ed04217'/>
<id>urn:sha1:388a9ebde4720ab0f66f73c6331ec32c3ed04217</id>
<content type='text'>
* pm-cpuidle:
  cpuidle: Simplify cpuidle_register_device() with guard()
  cpuidle: clean up dead dependencies on CPU_IDLE in Kconfig
  intel_idle: Add Panther Lake C-states table
  cpuidle: governors: teo: Rearrange stopped tick handling
  cpuidle: governors: menu: Refine stopped tick handling

* pm-opp:
  OPP: Move break out of scoped_guard in dev_pm_opp_xlate_required_opp()
  OPP: debugfs: Use performance level if available to distinguish between rates

* pm-sleep:
  PM: hibernate: return -ENODATA if the snapshot image is not loaded
  PM: hibernate: x86: Remove inclusion of crypto/hash.h
</content>
</entry>
<entry>
<title>PM: EM: Fix NULL pointer dereference when perf domain ID is not found</title>
<updated>2026-03-30T19:43:51Z</updated>
<author>
<name>Changwoo Min</name>
<email>changwoo@igalia.com</email>
</author>
<published>2026-03-29T07:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9badc2a84e688be1275bb740942d5f6f51746908'/>
<id>urn:sha1:9badc2a84e688be1275bb740942d5f6f51746908</id>
<content type='text'>
dev_energymodel_nl_get_perf_domains_doit() calls
em_perf_domain_get_by_id() but does not check the return value before
passing it to __em_nl_get_pd_size(). When a caller supplies a
non-existent perf domain ID, em_perf_domain_get_by_id() returns NULL,
and __em_nl_get_pd_size() immediately dereferences pd-&gt;cpus
(struct offset 0x30), causing a NULL pointer dereference.

The sister handler dev_energymodel_nl_get_perf_table_doit() already
handles this correctly via __em_nl_get_pd_table_id(), which returns
NULL and causes the caller to return -EINVAL. Add the same NULL check
in the get-perf-domains do handler.

Fixes: 380ff27af25e ("PM: EM: Add dump to get-perf-domains in the EM YNL spec")
Reported-by: Yi Lai &lt;yi1.lai@linux.intel.com&gt;
Closes: https://lore.kernel.org/lkml/aXiySM79UYfk+ytd@ly-workstation/
Signed-off-by: Changwoo Min &lt;changwoo@igalia.com&gt;
Cc: 6.19+ &lt;stable@vger.kernel.org&gt; # 6.19+
[ rjw: Subject and changelog edits ]
Link: https://patch.msgid.link/20260329073615.649976-1-changwoo@igalia.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge back earlier material related to system sleep for 7.1</title>
<updated>2026-03-27T10:56:38Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2026-03-27T10:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=949a5ed0826b4270ced45af9d86d74e1505be923'/>
<id>urn:sha1:949a5ed0826b4270ced45af9d86d74e1505be923</id>
<content type='text'>
</content>
</entry>
<entry>
<title>PM: sleep: Drop spurious WARN_ON() from pm_restore_gfp_mask()</title>
<updated>2026-03-23T12:54:53Z</updated>
<author>
<name>Youngjun Park</name>
<email>youngjun.park@lge.com</email>
</author>
<published>2026-03-22T12:05:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a8d51efb5929ae308895455a3e496b5eca2cd143'/>
<id>urn:sha1:a8d51efb5929ae308895455a3e496b5eca2cd143</id>
<content type='text'>
Commit 35e4a69b2003f ("PM: sleep: Allow pm_restrict_gfp_mask()
stacking") introduced refcount-based GFP mask management that warns
when pm_restore_gfp_mask() is called with saved_gfp_count == 0.

Some hibernation paths call pm_restore_gfp_mask() defensively where
the GFP mask may or may not be restricted depending on the execution
path. For example, the uswsusp interface invokes it in
SNAPSHOT_CREATE_IMAGE, SNAPSHOT_UNFREEZE, and snapshot_release().
Before the stacking change this was a silent no-op; it now triggers
a spurious WARNING.

Remove the WARN_ON() wrapper from the !saved_gfp_count check while
retaining the check itself, so that defensive calls remain harmless
without producing false warnings.

Fixes: 35e4a69b2003f ("PM: sleep: Allow pm_restrict_gfp_mask() stacking")
Signed-off-by: Youngjun Park &lt;youngjun.park@lge.com&gt;
[ rjw: Subject tweak ]
Link: https://patch.msgid.link/20260322120528.750178-1-youngjun.park@lge.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: hibernate: Drain trailing zero pages on userspace restore</title>
<updated>2026-03-23T12:33:06Z</updated>
<author>
<name>Alberto Garcia</name>
<email>berto@igalia.com</email>
</author>
<published>2026-03-09T17:39:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=734eba62cd32cb9ceffa09e57cdc03d761528525'/>
<id>urn:sha1:734eba62cd32cb9ceffa09e57cdc03d761528525</id>
<content type='text'>
Commit 005e8dddd497 ("PM: hibernate: don't store zero pages in the
image file") added an optimization to skip zero-filled pages in the
hibernation image. On restore, zero pages are handled internally by
snapshot_write_next() in a loop that processes them without returning
to the caller.

With the userspace restore interface, writing the last non-zero page
to /dev/snapshot is followed by the SNAPSHOT_ATOMIC_RESTORE ioctl. At
this point there are no more calls to snapshot_write_next() so any
trailing zero pages are not processed, snapshot_image_loaded() fails
because handle-&gt;cur is smaller than expected, the ioctl returns -EPERM
and the image is not restored.

The in-kernel restore path is not affected by this because the loop in
load_image() in swap.c calls snapshot_write_next() until it returns 0.
It is this final call that drains any trailing zero pages.

Fixed by calling snapshot_write_next() in snapshot_write_finalize(),
giving the kernel the chance to drain any trailing zero pages.

Fixes: 005e8dddd497 ("PM: hibernate: don't store zero pages in the image file")
Signed-off-by: Alberto Garcia &lt;berto@igalia.com&gt;
Acked-by: Brian Geffon &lt;bgeffon@google.com&gt;
Link: https://patch.msgid.link/ef5a7c5e3e3dbd17dcb20efaa0c53a47a23498bb.1773075892.git.berto@igalia.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: hibernate: return -ENODATA if the snapshot image is not loaded</title>
<updated>2026-03-20T18:55:42Z</updated>
<author>
<name>Alberto Garcia</name>
<email>berto@igalia.com</email>
</author>
<published>2026-03-09T17:39:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2b27ea5b644d7da9bc84f4539e53d1b31c601566'/>
<id>urn:sha1:2b27ea5b644d7da9bc84f4539e53d1b31c601566</id>
<content type='text'>
snapshot_image_loaded() is used in both the in-kernel and the
userspace restore path to ensure that the snapshot image has been
completely loaded. However the latter path returns -EPERM in such
situations, which is meant for cases where the operation is neither
write-only nor ready.

This patch updates the check so the returned error code is -ENODATA in
both cases.

Suggested-by: Brian Geffon &lt;bgeffon@google.com&gt;
Signed-off-by: Alberto Garcia &lt;berto@igalia.com&gt;
Acked-by: Brian Geffon &lt;bgeffon@google.com&gt;
Link: https://patch.msgid.link/8cfda38659c623f5392f3458cb32504ffd556a74.1773075892.git.berto@igalia.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T00:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>urn:sha1:bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
