Commit Graph

7032 Commits

Author SHA1 Message Date
Linus Torvalds
2a500a04d6 Driver core fixes for 7.4-rc1
- Revert TAINT_FORCED_BIND, introduced to flag manual sysfs bind/unbind
   operations associated with misleading fuzzing reports. It also taints
   established workflows, including VFIO device passthrough; a more
   targeted approach will be revisited after 7.4.
 
 - Rate limit synthetic uevent failure messages to prevent log flooding
   from repeated invalid writes to sysfs uevent files
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS2q/xV6QjXAdC7k+1FlHeO1qrKLgUCauOoegAKCRBFlHeO1qrK
 Li9DAP40jVb0AyHVlniDMGwdCajihY4NweTKKMAdiJJ5f+FX/AEAtm5ZK7rflqQn
 z5b4dHsFFGPEWfaKZ+w1Qx7L39njJQo=
 =UZoc
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-7.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull more driver core fixes from Danilo Krummrich:

 - Revert TAINT_FORCED_BIND, introduced to flag manual sysfs bind/unbind
   operations associated with misleading fuzzing reports. It also taints
   established workflows, including VFIO device passthrough; a more
   targeted approach will be revisited after 7.4.

 - Rate limit synthetic uevent failure messages to prevent log flooding
   from repeated invalid writes to sysfs uevent files

* tag 'driver-core-7.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
  Revert "driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers"
  driver core: Limit the messages on a refused uevent
2026-10-30 14:38:34 -10:00
Linus Torvalds
a4395d81ec regmap: Fix for v7.4
One fix for a real issue that fortunately doesn't affect any in tree
 configurations.
 -----BEGIN PGP SIGNATURE-----
 
 iHQEABYKAB0WIQReagvpf3TrrA7BoYYv73Ows9A4iQUCauTIrQAKCRAv73Ows9A4
 iRrKAPdioxxMXzhqymnjt+qqFxZU+WEM1dI7wwN5ErfdgvJ/AQC90hBD/MfPflW1
 L8vwD8jogi6VKRw8vYGEVQe/IAugAw==
 =yYQu
 -----END PGP SIGNATURE-----

Merge tag 'regmap-fix-v7.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "One fix for a real issue that fortunately doesn't affect any in tree
  configurations"

* tag 'regmap-fix-v7.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: irq: fix incorrect index calculation for read_sub_irq_data()
2026-10-30 08:20:58 -10:00
Greg Kroah-Hartman
a287f97d42 Revert "driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers"
This reverts commit fcbfaffee5.

Turns out that vfio is a crazy beast and people have been "relying" on
the bind/unbind debugging feature as a way to handle passing through
devices to guest instances.  Because of this (https://xkcd.com/1172/),
let's revert the feature for now until we can figure out a more agreeable
way to handle this such that normal workflows do not taint the kernel.

Odds are something like what Uwe proposes at:
	https://lore.kernel.org/lkml/cover.1790612298.git.u.kleine-koenig@baylibre.com/
will be the best way forward and will be revisited after for after 7.4.

The feature was originally intended to stem the flow of unnecessary
fuzzing reports of "broken" drivers where random devices were being
bound to random drivers and of course things were going wrong.  The main
syzbot tool is now not doing this anymore, and hopefully no one else
starts it up again (but in this madness of LLMs these days, you can't be
sure.)

Thanks to everyone for telling me just how wrong I was to implement
this, I appreciated the feedback :)

Link: https://lore.kernel.org/all/DLIL9H50MALI.3JROXYEEUM3KU@kernel.org/
To: Jonathan Corbet <corbet@lwn.net>
To: Shuah Khan <skhan@linuxfoundation.org>
To: Randy Dunlap <rdunlap@infradead.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
To: Johan Hovold <johan@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reported-by: Leon Romanovsky <leon@kernel.org>
Reported-by: Jason Gunthorpe <jgg@ziepe.ca>
Reported-by: Michal Pecio <michal.pecio@gmail.com>
Reported-by: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20261028-bind_taint-revert-v1-1-7c6b9cef30c9@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Revert the change in Documentation/admin-guide/tainted-kernels.rst.
  - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-10-29 21:01:16 +01:00
Josef Bacik
a01c8e5b1d driver core: Limit the messages on a refused uevent
A write to a "uevent" file which is no valid action makes
kobject_synth_uevent() print a warning and uevent_store() an error every
time.  This is generally considered a bad thing so rate limit these
messages.

Fixes: b0e37c0d8a ("net-sysfs: make sure objects belong to container's owner")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/2026102718-conduit-glorious-a8dc@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-29 10:14:50 +01:00
Linus Torvalds
8a36f53fd5 mm.git review status for linus..mm-stable
Everything:
 
 Total patches:       213
 Fixes: tags:         69
 cc:stable patches:   43
 Reviews/patch:       2.04
 Reviewed rate:       86%
 
 Excluding DAMON:
 
 Total patches:       192
 Fixes: tags:         63
 cc:stable patches:   39
 Reviews/patch:       2.18
 Reviewed rate:       89%
 
 Excluding DAMON and selftests:
 
 Total patches:       182
 Fixes: tags:         57
 cc:stable patches:   39
 Reviews/patch:       2.23
 Reviewed rate:       89%
 
 Summary of series in this merge:
 
 - "mm: make VMA flag semantics explicit, eliminate VM_SPECIAL"
   (Lorenzo Stoakes (ARM)):
 
   Replace VM_SPECIAL with helpers describing mapping ownership and
   behavior.  Enforce the mmap flag rules and convert affected drivers,
   removing ambiguous tests shared by driver mappings and ordinary memory.
 
 - "support kselftest on nommu platform" (Hajime Tazaki):
 
   Add opt-in mmap and mremap tests for NOMMU systems.  Teach the runner to
   avoid its fork-dependent timeout command and document the build and
   runtime requirements.
 
 - "mm/collapse: separate a collapse from its callers"
   (Kiryl Shutsemau (Meta)):
 
   Separate huge-page collapse from caller policy.  Replace khugepaged
   identity checks with explicit permissions, and separate scanning from
   collapse with the mmap_lock drop in one place.
 
 - "mm: implement and use vma_has_anon_rmap(), silence KCSAN"
   (Lorenzo Stoakes (ARM)):
 
   Provide a common helper for testing whether a VMA has anonymous reverse
   mappings.  Document the locking rules, annotate intentional concurrent
   reads for KCSAN, and convert the core MM callers.
 
 - "mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups"
   (David Hildenbrand (Arm)):
 
   Remove SECTION_MARKED_PRESENT in favor of the early-section flag.
   Simplify sparse memory initialization, section metadata handling and
   related PFN validity checks.
 
 - "sh: remove NUMA and SPARSEMEM support" (Mike Rapoport (Microsoft)):
 
   Remove SuperH NUMA and SPARSEMEM support.  The extra memory banks have
   been unusable since the NO_BOOTMEM conversion, leaving only the code and
   data overhead.
 
 - "mm: Unify device DAX and HugeTLB vmemmap population paths"
   (Muchun Song):
 
   Unify the generic device DAX and HugeTLB vmemmap population paths and
   shared tail-page handling.  Remove the duplicate DAX machinery while
   retaining the powerpc radix implementation.
 
 - "kselftest: mm: fix some failure of split_huge_page_test" (Yeoreum Yun):
 
   Fix huge-page split tests racing with khugepaged recollapse.  Use pagemap
   and page flags instead of VMA-boundary assumptions which fail when glibc
   has already enabled THP.
 
 - "memcg: move memcgid refcount to objcg to unpin dying memcgs"
   (Bingfang Guo):
 
   Let dying memcgs be freed while swapped-out shmem still holds their IDs.
   Move ID references to reparentable objcgs, with the necessary swap
   accounting and RCU lifetime changes.
 
 - "mm/truncate: fix data loss when truncating straddling large folios"
   (Zhang Yi):
 
   Preserve out-of-range data when truncating straddling large folios.  Fix
   a lookup race and split-failure handling, and handle minimum folio orders
   for the forthcoming ext4 iomap buffered I/O path.
 
 - "mm/damon: introduce damos quota goal target metric complement flag"
   (SJ Park):
 
   Let DAMOS quota goals use a metric's complement, so utilization can also
   express free-memory goals without adding separate metrics.  Add the sysfs
   interface, documentation and tests.
 
 - "arm64/mm: Standardize printing for pgtable entries" (Anshuman Khandual):
 
   Use the generic formatter for arm64 page-table entries, ready for future
   wider entries.  Move the safe-PTE-update check out of the header to avoid
   an include cycle.
 
 - "mm: kmsan: fix iounmap metadata teardown" (Dima Koziuk):
 
   Fix KMSAN metadata leaks on iounmap and failed ioremap allocations.  Free
   backing pages before removing their mappings, and share the teardown with
   partial-allocation cleanup.
 
 - "mm/damon/core: preserve quota state when constructing schemes"
   (Karl Mehltretter):
 
   Preserve running DAMOS quota state while validating parameter updates.
   Even rejected updates could reset accounting and exceed the quota window;
   add tests for both accepted and rejected updates.
 
 - "mm/vmalloc: fix vmalloc_dump_obj VA lookup" (Ye Liu):
 
   Fix vmalloc_dump_obj() lookups for last-page addresses and allocations
   spanning vmap zones.  These allocations were being missed in diagnostic
   output.
 
 - "mm: various (urgent?) fixes" (David Hildenbrand (Arm)):
 
   Fix mmap charge leaks and hugetlb use-after-free, wrong-address
   unmapping, stuck locks and endless faults.  Also preserve reservations on
   failed mremap and handle stale userfaultfd bits.
 
 - "maple_tree: fix maple_range_64 crashes in RCU mode" (Dimitris Charisis):
 
   Fix pointer and metadata confusion during RCU destruction of
   maple_range_64 nodes, avoiding double frees and invalid accesses.  Add a
   regression test; no in-tree user currently uses this combination.
 
 - "mm: fix hugetlb NR_HUGETLB accounting on folio migration" (Hongfu Li):
 
   Fix hugetlb migration and preallocation accounting so /proc/vmstat
   retains the correct count and memory.numa_stat follows the folio to its
   new node.
 
 - "mm/damon: fix a minor bug, clean code, and add a test" (SJ Park):
 
   Fix 32-bit DAMON age overflow which made old regions look young.  Share
   hugetlb folio acquisition code and add a regression test for the
   previously fixed last-region skipping bug.
 
 - "mm/damon/core: cleanup code, reduce stack usage, and add kunit"
   (SJ Park):
 
   Reduce kdamond stack usage and remove unused enums.  Add deterministic
   PSI quota-goal tests which do not depend on the machine's current memory
   pressure.
 
 - "mm/damon: fix the temporal goal tuner's size quota conversion"
   (Donggeun Yoo):
 
   Bound the temporal tuner's quota conversion to prevent overflow and zero
   effective quotas, which could stop schemes making progress.  Add boundary
   tests.
 
 - "Don't use GFP_DMA when calling dma_alloc_coherent" (Baoquan He):
 
   Remove redundant GFP_DMA flags from coherent DMA allocation calls.  The
   DMA API already selects the zone from device limits and ignores the
   caller's flag.
 
 - "kselftest: mm: fix intermittent failure khugepaged test" (Yeoreum Yun):
 
   Propagate child-process failures in the khugepaged tests and prevent
   background collapse from racing their checks.  This removes false passes
   and intermittent failures.
 
 - "MAINTAINERS: cover all hugetlb headers under HUGETLB SUBSYSTEM"
   (Enze Li):
 
   Cover all hugetlb headers in MAINTAINERS so get_maintainer.pl finds the
   right maintainers.  Also label the closing hugetlb_cgroup.h include
   guard.
 
 Summary of the 65 singletons in this merge:
 
 The singletons include a few worthwhile performance fixes. Avoiding
 unnecessary reverse-map tree updates gave a reported 15.9% improvement
 in UnixBench's execl test on a 192-core x86 system. A reclaim retry fix
 stops defrag_mode from spinning under memory.low protection; a reported
 file-creation stress test ran 5.7 times faster, with far less memory
 pressure. Narrower hugetlb invalidations also spare KVM guests needless
 refaults: the reported Redis-in-VM P99 QPS penalty while punching holes
 fell from 7.09% to 1.45%.
 
 Several fixes prevent lost data or corrupted memory. Lazyfree huge-page
 races with mremap()/munmap() could lose data or access freed memory, and
 MADV_COLD could lose a concurrent write's dirty bit. Another fix
 prevents stale migration entries from outliving large folios. On
 filesystems with blocks smaller than a page, extending a file by 4 GiB
 or more could expose bytes written past the old EOF through mmap instead
 of zeroes. That is fixed, along with use-after-free races in
 PAGEMAP_SCAN during process exit and in memory-cgroup accounting on
 PREEMPT_RT kernels.
 
 Other fixes stop UFFDIO_MOVE spinning forever on pinned large folios,
 which could wedge other memory operations, and stop mremap() leaking
 commit charges until allocations fail under strict overcommit. A further
 fix keeps userfaultfd tracking intact on neighboring mappings. NUMA
 binding no longer prevents long-term pins when the chosen node has only
 movable memory, fixing QEMU/VFIO startup and io_uring buffer
 registration failures. MGLRU also gets a fix for early-boot crashes with
 memory cgroups disabled at boot, notably in small crash kernels.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCat66sAAKCRDdBJ7gKXxA
 jrQrAP99kgSXRdlmRZbHeRBHQ6KvI4XnLvQ78MDIzZ3zmBaOugEA5jiIsK2/snFD
 3VaV0oipVZpuwJkVJE6zFkh0tcHgTAo=
 =DHrN
 -----END PGP SIGNATURE-----

Merge tag 'mm-stable-2026-10-25-19-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull more MM updates from Andrew Morton:

 - "mm: make VMA flag semantics explicit, eliminate VM_SPECIAL" (Lorenzo
   Stoakes):

   Replace VM_SPECIAL with helpers describing mapping ownership and
   behavior. Enforce the mmap flag rules and convert affected drivers,
   removing ambiguous tests shared by driver mappings and ordinary
   memory.

 - "support kselftest on nommu platform" (Hajime Tazaki):

   Add opt-in mmap and mremap tests for NOMMU systems. Teach the runner
   to avoid its fork-dependent timeout command and document the build
   and runtime requirements.

 - "mm/collapse: separate a collapse from its callers" (Kiryl
   Shutsemau):

   Separate huge-page collapse from caller policy. Replace khugepaged
   identity checks with explicit permissions, and separate scanning from
   collapse with the mmap_lock drop in one place.

 - "mm: implement and use vma_has_anon_rmap(), silence KCSAN" (Lorenzo
   Stoakes):

   Provide a common helper for testing whether a VMA has anonymous
   reverse mappings. Document the locking rules, annotate intentional
   concurrent reads for KCSAN, and convert the core MM callers.

 - "mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups"
   (David Hildenbrand):

   Remove SECTION_MARKED_PRESENT in favor of the early-section flag.
   Simplify sparse memory initialization, section metadata handling and
   related PFN validity checks.

 - "sh: remove NUMA and SPARSEMEM support" (Mike Rapoport):

   Remove SuperH NUMA and SPARSEMEM support. The extra memory banks have
   been unusable since the NO_BOOTMEM conversion, leaving only the code
   and data overhead.

 - "mm: Unify device DAX and HugeTLB vmemmap population paths" (Muchun
   Song):

   Unify the generic device DAX and HugeTLB vmemmap population paths and
   shared tail-page handling. Remove the duplicate DAX machinery while
   retaining the powerpc radix implementation.

 - "kselftest: mm: fix some failure of split_huge_page_test" (Yeoreum
   Yun):

   Fix huge-page split tests racing with khugepaged recollapse. Use
   pagemap and page flags instead of VMA-boundary assumptions which fail
   when glibc has already enabled THP.

 - "memcg: move memcgid refcount to objcg to unpin dying memcgs"
   (Bingfang Guo):

   Let dying memcgs be freed while swapped-out shmem still holds their
   IDs. Move ID references to reparentable objcgs, with the necessary
   swap accounting and RCU lifetime changes.

 - "mm/truncate: fix data loss when truncating straddling large folios"
   (Zhang Yi):

   Preserve out-of-range data when truncating straddling large folios.
   Fix a lookup race and split-failure handling, and handle minimum
   folio orders for the forthcoming ext4 iomap buffered I/O path.

 - "mm/damon: introduce damos quota goal target metric complement flag"
   (SJ Park):

   Let DAMOS quota goals use a metric's complement, so utilization can
   also express free-memory goals without adding separate metrics. Add
   the sysfs interface, documentation and tests.

 - "arm64/mm: Standardize printing for pgtable entries" (Anshuman
   Khandual):

   Use the generic formatter for arm64 page-table entries, ready for
   future wider entries. Move the safe-PTE-update check out of the
   header to avoid an include cycle.

 - "mm: kmsan: fix iounmap metadata teardown" (Dima Koziuk):

   Fix KMSAN metadata leaks on iounmap and failed ioremap allocations.
   Free backing pages before removing their mappings, and share the
   teardown with partial-allocation cleanup.

 - "mm/damon/core: preserve quota state when constructing schemes" (Karl
   Mehltretter):

   Preserve running DAMOS quota state while validating parameter
   updates. Even rejected updates could reset accounting and exceed the
   quota window; add tests for both accepted and rejected updates.

 - "mm/vmalloc: fix vmalloc_dump_obj VA lookup" (Ye Liu):

   Fix vmalloc_dump_obj() lookups for last-page addresses and
   allocations spanning vmap zones. These allocations were being missed
   in diagnostic output.

 - "mm: various (urgent?) fixes" (David Hildenbrand):

   Fix mmap charge leaks and hugetlb use-after-free, wrong-address
   unmapping, stuck locks and endless faults. Also preserve reservations
   on failed mremap and handle stale userfaultfd bits.

 - "maple_tree: fix maple_range_64 crashes in RCU mode" (Dimitris
   Charisis):

   Fix pointer and metadata confusion during RCU destruction of
   maple_range_64 nodes, avoiding double frees and invalid accesses. Add
   a regression test; no in-tree user currently uses this combination.

 - "mm: fix hugetlb NR_HUGETLB accounting on folio migration" (Hongfu
   Li):

   Fix hugetlb migration and preallocation accounting so /proc/vmstat
   retains the correct count and memory.numa_stat follows the folio to
   its new node.

 - "mm/damon: fix a minor bug, clean code, and add a test" (SJ Park):

   Fix 32-bit DAMON age overflow which made old regions look young.
   Share hugetlb folio acquisition code and add a regression test for
   the previously fixed last-region skipping bug.

 - "mm/damon/core: cleanup code, reduce stack usage, and add kunit" (SJ
   Park):

   Reduce kdamond stack usage and remove unused enums. Add deterministic
   PSI quota-goal tests which do not depend on the machine's current
   memory pressure.

 - "mm/damon: fix the temporal goal tuner's size quota conversion"
   (Donggeun Yoo):

   Bound the temporal tuner's quota conversion to prevent overflow and
   zero effective quotas, which could stop schemes making progress. Add
   boundary tests.

 - "Don't use GFP_DMA when calling dma_alloc_coherent" (Baoquan He):

   Remove redundant GFP_DMA flags from coherent DMA allocation calls.
   The DMA API already selects the zone from device limits and ignores
   the caller's flag.

 - "kselftest: mm: fix intermittent failure khugepaged test" (Yeoreum
   Yun):

   Propagate child-process failures in the khugepaged tests and prevent
   background collapse from racing their checks. This removes false
   passes and intermittent failures.

 - "MAINTAINERS: cover all hugetlb headers under HUGETLB SUBSYSTEM"
   (Enze Li):

   Cover all hugetlb headers in MAINTAINERS so get_maintainer.pl finds
   the right maintainers. Also label the closing hugetlb_cgroup.h
   include guard.

Summary of the 65 singletons in this merge:

  The singletons include a few worthwhile performance fixes. Avoiding
  unnecessary reverse-map tree updates gave a reported 15.9% improvement
  in UnixBench's execl test on a 192-core x86 system. A reclaim retry
  fix stops defrag_mode from spinning under memory.low protection; a
  reported file-creation stress test ran 5.7 times faster, with far less
  memory pressure. Narrower hugetlb invalidations also spare KVM guests
  needless refaults: the reported Redis-in-VM P99 QPS penalty while
  punching holes fell from 7.09% to 1.45%.

  Several fixes prevent lost data or corrupted memory. Lazyfree
  huge-page races with mremap()/munmap() could lose data or access freed
  memory, and MADV_COLD could lose a concurrent write's dirty bit.
  Another fix prevents stale migration entries from outliving large
  folios. On filesystems with blocks smaller than a page, extending a
  file by 4 GiB or more could expose bytes written past the old EOF
  through mmap instead of zeroes. That is fixed, along with
  use-after-free races in PAGEMAP_SCAN during process exit and in
  memory-cgroup accounting on PREEMPT_RT kernels.

  Other fixes stop UFFDIO_MOVE spinning forever on pinned large folios,
  which could wedge other memory operations, and stop mremap() leaking
  commit charges until allocations fail under strict overcommit. A
  further fix keeps userfaultfd tracking intact on neighboring mappings.
  NUMA binding no longer prevents long-term pins when the chosen node
  has only movable memory, fixing QEMU/VFIO startup and io_uring buffer
  registration failures. MGLRU also gets a fix for early-boot crashes
  with memory cgroups disabled at boot, notably in small crash kernels.

* tag 'mm-stable-2026-10-25-19-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (213 commits)
  mm: multi-gen LRU: fix NULL lruvec->pgdat deref with memcg disabled on cmdline
  mm/page_counter: use WRITE_ONCE() for emin/elow when parent is the root
  mm/memcontrol: publish null pointer before dropping css reference
  test_maple_tree: test maple_range_64 node in RCU mode
  maple_tree: fix maple_range_64 crashes in RCU mode
  mm/vma: avoid broken uffd merge on mremap
  tools/testing/shared: catch a failed posix_memalign()
  mm/damon/core: remove unreachable damos charge_{target,addr}_from
  mm/shrinker: allocate shrinker_info_unit from a dedicated kmem_cache
  riscv: mm: exclude invalid THP PMDs from page table check
  mm/damon/core: filter out damos address filter-split failed region
  fs/proc/task_mmu: pin mm_users in do_pagemap_scan()
  mm/mempolicy: apply bind policies against the scoped allocation zone
  mm/vmscan: reclaim every zone in per-node proactive reclaim
  mm/mremap: correctly uncharge accountable VMAs in error path
  mm/mremap: populate calculated fields in vrm state correctly
  MAINTAINERS: add an entry for MEMORY MANAGEMENT - MEMORY MAP
  mm: bdi: reset min_ratio after the sysfs attributes are gone
  mm/page_vma_mapped: continue past nonmatching huge PMDs
  selftests/mm: skip hugetlb cgroup v2 tests without the needed controllers
  ...
2026-10-27 12:23:17 -10:00
Linus Torvalds
0cc3ad8f4d Driver core fixes for 7.4-rc1
- Make parent-lock requirements per device type instead of per bus,
   fixing a use-after-free on USB disconnect by limiting the requirement
   to USB interfaces, which retain a reference to their parent
 
 - Honor parent-lock requirements during deferred and asynchronous
   probing, fixing USB interface probe races, including duplicate
   endpoint creation attempts in sysfs
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS2q/xV6QjXAdC7k+1FlHeO1qrKLgUCat5gLQAKCRBFlHeO1qrK
 LtDiAP42G5THtYuYWgtS1S42wNJGEFLAxD5FheBMDu7AfL8QuQD+KbI0FmAhQRp7
 avf4YvdeDWE1QZWV5THYvBDqzNB8BQ4=
 =6oMk
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core fixes from Danilo Krummrich:

 - Make parent-lock requirements per device type instead of per bus,
   fixing a use-after-free on USB disconnect by limiting the requirement
   to USB interfaces, which retain a reference to their parent

 - Honor parent-lock requirements during deferred and asynchronous
   probing, fixing USB interface probe races, including duplicate
   endpoint creation attempts in sysfs

* tag 'driver-core-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
  driver core: take parent lock in async device attach
  driver core: take parent lock on deferred probe
  driver core: fix parent lock use-after-free on USB disconnect
2026-10-26 07:04:41 -10:00
David Hildenbrand (Arm)
da7acb8982 mm/sparse: remove SECTION_MARKED_PRESENT
All present section iterators run before memory hotplug added any further
memory sections, Therefore, we can simply use the SECTION_IS_EARLY flag by
setting that flag earlier in sparse_sections_init().

Get rid of SECTION_MARKED_PRESENT entirely and rename
for_each_present_section_nr() to for_each_early_section_nr().

Take care of the .clang-format for_each_present_section_nr() handling.

No functional change intended.

Link: https://lore.kernel.org/20260921-b4-sparsemem_cleanups-v2-10-54d81d65e125@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Kairui Song <kasong@tencent.com>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Barry Song <baohua@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>
2026-10-24 01:56:08 -07:00
Linus Torvalds
2ee2475e15 Core memory management updates for 7.4
This includes updates to:
 
  - MEMHP (Memory Hotplug)
  - GUP (Get User Pages)
 
 The main change is:
 
  - Reduce zone contiguity checking overhead during memory
    hot(un)plug (Yuan Liu)
 
 Other changes include smaller fixes along with various cleanups.
 
 Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRSU98w6emufXtGDgPH6csYRVW7eQUCatuGDwAKCRDH6csYRVW7
 eYrPAP9lQRauBQFuovBx6tjJkJfHMYnJS9mpcmLoKmNImPPetQEA9KoahYxrPtjg
 TsC9H01QzZkILup3UiMUnE7FXYju1gs=
 =NqJG
 -----END PGP SIGNATURE-----

Merge tag 'mm-core-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/core

Pull core memory management updates from David Hildenbrand:
 "This includes updates to:

   - MEMHP (Memory Hotplug)

   - GUP (Get User Pages)

  The main change is:

   - Reduce zone contiguity checking overhead during memory hot(un)plug
     (Yuan Liu)

  Other changes include smaller fixes along with various cleanups"

* tag 'mm-core-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/core:
  mm/memory_hotplug: fix missing rollback in __add_pages()
  mm/memory_hotplug: optimize zone contiguous check when changing pfn range
  mm/memory_hotplug: make shrink_zone_span() more robust
  mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()
  mm/gup_test: report actual pinned bytes
  mm/gup_test: safely calculate GUP batch size
  mm: gup: cleanup the gup_fast_*() call chain
  mm: gup: move pmd_protnone() into gup_fast_pmd_leaf()
2026-10-23 09:13:11 -10:00
Linus Torvalds
9aa54fb74e regmap: Changes for v7.4
This is a relatively busy release, mostly due to the general cleanup
 work which people have been doing throughout the kernel - for regmap
 that's mostly been some work from Peng Fan.  I also added some more
 tests for the sparse caches to catch some gotchas people might run into
 trying to improve the maple cache.
 
  - Test very high register numbers to help people avoid a nasty gotcha
    trying to optimise the maple cache.
  - Make more use of scoped lock and allocation guards.
  - A couple of other smaller improvements and fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQReagvpf3TrrA7BoYYv73Ows9A4iQUCatoASwAKCRAv73Ows9A4
 iSPBAP98TCBcSIIBzaeq0mYWqL9VwSQdDIfoltF8TiEEaq9lhAD+P+xTs2R1J4R1
 9sy2+oYEiZgrVwIn/xHi0oDtUD8bTwE=
 =5AGY
 -----END PGP SIGNATURE-----

Merge tag 'regmap-v7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap updates from Mark Brown:
 "This is a relatively busy release, mostly due to the general cleanup
  work which people have been doing throughout the kernel - for regmap
  that's mostly been some work from Peng Fan.

  I also added some more tests for the sparse caches to catch some
  gotchas people might run into trying to improve the maple cache.

   - Test very high register numbers to help people avoid a nasty gotcha
     trying to optimise the maple cache

   - Make more use of scoped lock and allocation guards

   - A couple of other smaller improvements and fixes"

* tag 'regmap-v7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: debugfs: Use __free(kfree) for regmap_reg_ranges_read_file
  regmap: debugfs: Use guard to simplify code
  regmap: debugfs: Use __free(kfree) in regmap_name_read_file()
  regmap: fix potential double-free of map->reg_defaults on cache reinit
  regmap: use krealloc_array() in regmap_register_patch()
  regcache: simplify control flow and reduce nesting
  regcache: extract __regcache_sync() to deduplicate sync dispatch
  regcache: extract locked helpers to replace open-coded lock/unlock pairs
  regmap: debugfs: use the regmap scoped lock guard
  regcache: rbtree: use the regmap scoped lock guard
  regcache: use the regmap scoped lock guard
  regmap: convert lock/unlock to a scoped guard
  regmap: fix typo "asynchrnous" in comment
  regmap: Test rbtree and maple caches for very high register numbers
  regmap: Allow a base register to be specified for the RAM regmap
2026-10-22 07:23:27 -10:00
Linus Torvalds
7be4bc52fd Driver core changes for 7.4-rc1
- core:
 
   - Add TAINT_FORCED_BIND to taint the kernel and driver module before manual
     sysfs bind/unbind operations; make add_taint_module() available to
     driver core and update taint decoding tools and documentation
 
   - Constify device_show/store_*() attribute parameters and adapt x86 MCE and
     perf users to prepare for const dev_ext_attribute instances
 
   - Fix UAF in NUMA access node registration failure handling by dropping
     the device reference with put_device() instead of directly freeing the node
 
 - debugfs:
 
   - Make debugfs_create_str() read-only to eliminate double-free races between
     concurrent writers; reject writable modes; convert interconnect and
     SoundWire users to local file operations with mutex-protected strings
 
 - kobject:
 
   - Fix out-of-bounds access in kobject_action_type() when parsing action
     strings containing embedded NUL bytes
 
   - Fix the kobject_set_name() reference in kset_register() kernel-doc
 
 - Rust:
 
   - DMA:
 
     - Tie Coherent, CoherentBox and CoherentHandle to the device's bound
       lifetime to prevent retaining DMA allocations beyond driver unbind;
       propagate the lifetime through nova-core and the DMA sample driver
 
   - I/O:
 
     - Require explicit base types for registers and replace relative registers
       with typed subregion projections; reimplement register!() as a proc
       macro, support registers using existing types without inline bitfields,
       and convert nova-core, Tyr and the PCI sample; add AsRepr/AsReprMut and
       transmute helpers with deferred size checks for representation
       conversions
 
     - Wrap ResourceSize in a transparent newtype with explicit conversions,
       including checked conversion to usize
 
   - PCI:
 
     - Add typed PCIe extended capability lookup and SR-IOV accessors for the
       First VF Offset and decoded VF BAR addresses and widths, keeping raw
       SR-IOV registers private to preserve PCI core ownership of their state
 
   - scatterlist:
 
     - Honor the device's maximum segment size as well as the DMA mapping limit
       when constructing SG tables
 
     - Return u32 from SGEntry::dma_len() to match the C segment length type
 
   - misc:
 
     - Validate auxiliary DeviceId name length explicitly to improve
       compile-time diagnostics for oversized device ID table entries
 
     - Drop unnecessary 'static bounds from debugfs ScopedDir file creation
       methods to support data containing non-'static references, including DMA
       buffers
 
 - misc:
 
   - Add Johan Hovold as driver core maintainer
 
   - Simplify platform_device_alloc() by returning early on allocation failure
 
   - Fix typos in driver core and kernfs comments
 -----BEGIN PGP SIGNATURE-----
 
 iJEEABYKADkWIQS2q/xV6QjXAdC7k+1FlHeO1qrKLgUCatNacRsUgAAAAAAEAA5t
 YW51MiwyLjUrMS4xMiwwLDMACgkQRZR3jtaqyi7YegD8ChAjvp7WireJHjodlAMA
 j2Ty0NLjR8715/Ml/QNxnTUA/1/Auj3pXS5/VesKPp+PU6VVB4IdjjHzuzSY+7sz
 y7wN
 =GYmP
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core updates from Danilo Krummrich:
 "Core:

   - Add TAINT_FORCED_BIND to taint the kernel and driver module before
     manual sysfs bind/unbind operations; make add_taint_module()
     available to driver core and update taint decoding tools and
     documentation

   - Constify device_show/store_*() attribute parameters and adapt x86
     MCE and perf users to prepare for const dev_ext_attribute instances

   - Fix UAF in NUMA access node registration failure handling by
     dropping the device reference with put_device() instead of directly
     freeing the node

  debugfs:

   - Make debugfs_create_str() read-only to eliminate double-free races
     between concurrent writers; reject writable modes; convert
     interconnect and SoundWire users to local file operations with
     mutex-protected strings

  kobject:

   - Fix out-of-bounds access in kobject_action_type() when parsing
     action strings containing embedded NUL bytes

   - Fix the kobject_set_name() reference in kset_register() kernel-doc

  Rust:

   - DMA:

      - Tie Coherent, CoherentBox and CoherentHandle to the device's
        bound lifetime to prevent retaining DMA allocations beyond
        driver unbind; propagate the lifetime through nova-core and the
        DMA sample driver

   - I/O:

      - Require explicit base types for registers and replace relative
        registers with typed subregion projections; reimplement
        register!() as a proc macro, support registers using existing
        types without inline bitfields, and convert nova-core, Tyr and
        the PCI sample; add AsRepr/AsReprMut and transmute helpers with
        deferred size checks for representation conversions

      - Wrap ResourceSize in a transparent newtype with explicit
        conversions, including checked conversion to usize

   - PCI:

      - Add typed PCIe extended capability lookup and SR-IOV accessors
        for the First VF Offset and decoded VF BAR addresses and widths,
        keeping raw SR-IOV registers private to preserve PCI core
        ownership of their state

   - scatterlist:

      - Honor the device's maximum segment size as well as the DMA
        mapping limit when constructing SG tables

      - Return u32 from SGEntry::dma_len() to match the C segment length
        type

   - misc:

      - Validate auxiliary DeviceId name length explicitly to improve
        compile-time diagnostics for oversized device ID table entries

      - Drop unnecessary 'static bounds from debugfs ScopedDir file
        creation methods to support data containing non-'static
        references, including DMA buffers

  Misc:

   - Add Johan Hovold as driver core maintainer

   - Simplify platform_device_alloc() by returning early on allocation
     failure

   - Fix typos in driver core and kernfs comments"

* tag 'driver-core-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: (41 commits)
  rust: pci: add extended capability and SR-IOV support
  kobject: Fix the kobj_set_name reference in kset_register() kernel-doc
  rust: io: convert ResourceSize into a transparent newtype
  rust: scatterlist: return u32 from SGEntry::dma_len()
  MAINTAINERS: add myself as driver core maintainer
  debugfs: make debugfs_create_str() read-only
  soundwire: debugfs: replace writable string helper
  interconnect: debugfs: replace writable string helper
  docs: admin-guide: Handle TAINT_FORCED_BIND when parsing /proc/sys/kernel/tainted
  driver core: platform: Simplify platform_device_alloc()
  kobject: fix out-of-bounds access in kobject_action_type()
  rust: scatterlist: honor the device's maximum segment size
  driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers
  module: fix up documentation for add_taint() and add_taint_module()
  module: pull out add_taint_module() to be public
  driver core: Constify the signature of device_show/store_*()
  drivers: perf: Use __DEVICE_ATTR() macro to initialize dev_ext_attribute
  x86/mce: Use __DEVICE_ATTR() macro to initialize dev_ext_attribute
  rust: auxiliary: validate DeviceId name length
  driver core: fix typos in comments
  ...
2026-10-21 18:53:14 -10:00
Linus Torvalds
df37e39242 Power management updates for 7.4-rc1
- Fix multiple issues related to input validation, synchronization,
    access safety, memory layout and register field validation, and error
    handling in the ACPI CPPC library (Christian Loehle and Sumit Gupta)
 
  - Select the frequency-invariance callback per CPU in the CPPC cpufreq
    driver and create the FIE worker before enabling PCC callbacks in it
    to avoid queueing work through a missing worker and dereferencing a
    NULL pointer (Christian Loehle)
 
  - Update the CPPC cpufreq driver entry in MAINTAINERS and add a new
    entry for the ACPI CPPC library (Christian Loehle)
 
  - Minor fixes in various cpufreq drivers (Alexander Koskovich, Daniel
    Schwierzeck, Frank Zhang, Haotian Zhang, Kathiravan Thirumoorthy,
    Sumeet Pawnikar, and Xueqin Luo)
 
  - Fix wrong behaviors on multi-node servers in the Loongson cpufreq
    driver (Huacai Chen)
 
  - Reject NULL from cpufreq_cpu_get() in the Rust code (Mehmet Koseoglu)
 
  - Add suspend OPP to mediatek cpufreq driver and DT (Ryan Brue)
 
  - Fixups for a few bugs identified by Sashiko in the amd-pstate cpufreq
    driver (Mario Limoncielloi, Wentao Guan)
 
  - Initial support for maximum frequency capacity handling on Zen6
    client in amd-pstate (Mario Limonciello)
 
  - Fix for amd-pstate-ut with 'Requested CPU Min frequency' BIOS option
    (K Prateek Nayak)
 
  - New Zen6 tuning values for EPP in amd-pstate (Mario Limonciello,
    Vishal Badole)
 
  - amd-pstate documentation fix (Karl Mehltretter)
 
  - Restrict deferred downscaling to low load for shared policies in the
    conservative cpufreq governor to avoid undesirable CPU frequency
    reduction in some cases (Shengming Hu)
 
  - Serialize sugov_start() against rate limit updates in the schedutil
    cpufreq governor to avoid using a stale rate limit value (Hui Su)
 
  - Prevent cpuidle governors menu and teo from returning idle state 0
    after it has been disabled (Xueqin Luo)
 
  - Replace min_t() with the better alternatives in the intel_idle driver
    and make it use 2-argument strscpy() (Andy Shevchenko)
 
  - Fix two repeated phrase instances in cpuidle (Hemanth Selam, Syazwina
    Fazrul)
 
  - Add rugged Panther Lake support to the intel_rapl power capping
    driver and make it use %pe for printing error pointers (Srinivas
    Pandruvada and Sumeet Pawnikar)
 
  - Update and improve runtime PM documentation and add a kunit test for
    supplier idle/suspend (Brian Norris)
 
  - Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit()
    to ensure autosuspend disabling on driver teardown (Joshua Crofts)
 
  - Ignore page-zero RAM in E820 checksum during hibernation on x86 to
    avoid rejecting images created after kexec() (Matthias Goergens)
 
  - Add resume event mapping for PMSG_POWEROFF to the PM core to allow it
    to carry out device shutdown in the future (Mario Limonciello)
 
  - Add DPM watchdog to prepare/late/early/noirq/complete phases of
    device suspend and resume (Mayank Rungta)
 
  - Update swsusp.txt references to swsusp.rst in hibernation
    documentation (Li Jun)
 
  - Fix use-after-free of perf domain in netlink doit handlers for energy
    models (Fan Wu)
 
  - Add synchronize_rcu() back to cpu_pm_unregister_notifier() after it
    was removed inadvertently in previous development cycles to avoid
    use-after-free (Bradley Morgan)
 
  - Unregister CPU PM notifier outside the timer lock in the timer-ti-dm
    clocksource driver (Bradley Morgan)
 
  - Fix typo "sucessfully" in a comment in pm_clk_add_clk() kerneldoc
    comment and typo "hierachy" in a comment in pm-graph (Hemanth Selam)
 
  - Fix the return value in dev_pm_opp_get_of_node() kernel-doc (Karl
    Mehltretter)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrWNkISHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1M7QH/RyTpxMUHI3eLqhPIczecdsQxoJ9gCZS
 wGMQmvBRrNEw/Cp+X+j5Swo8iOJRKQ5Na+h53Ebg4EFJg5Fkh8SDO/VhQDaC0GUp
 t9y9MpVfXq/Fc/gOimzJ/MGhRmBXl5HKva586pg5TdFg4adDs4kPcDj9zDFnKMhf
 Kb0FHgjRjli1iDT1HSOV7KDsH1bZBWD1P04jMaVQ1zJb6Ngwi1msyBaRlE3A1mqX
 W31C3pi7qtfbs1v1JPmrnaVAJEZmv38t7x/G3o5FL35P2bwlgN/KXD0aMNHZ0Rnl
 A6Jz4p5ugop+gBLzyQo4W8SNcLk9cRvlp3FUwuEax4MEPbg+rhfjdDs=
 =4ccu
 -----END PGP SIGNATURE-----

Merge tag 'pm-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "This time, the most visible part are the ACPI CPPC updates from
  Christian Loehle, including CPPC cpufreq driver changes, even though
  updates of cpufreq drivers proper are still the largest topic group.
  However, the updates of cpufreq drivers depend on the ACPI CPPC
  updates, so they should really be counted together and that is well
  over 1/2 of the total commit count.

  Interestingly enough, almost all of the updates included here are
  fixes or cleanups, with some new feature support in the amd-pstate
  cpufreq driver and IPQ9650 support in the qcom-nvmem cpufreq driver.
  The runtime PM documentation improvements from Brian Norris can also
  be mostly regarded as fixes, but a new kunit test goes along with
  them.

  Specifics:

   - Fix multiple issues related to input validation, synchronization,
     access safety, memory layout and register field validation, and
     error handling in the ACPI CPPC library (Christian Loehle and Sumit
     Gupta)

   - Select the frequency-invariance callback per CPU in the CPPC
     cpufreq driver and create the FIE worker before enabling PCC
     callbacks in it to avoid queueing work through a missing worker and
     dereferencing a NULL pointer (Christian Loehle)

   - Update the CPPC cpufreq driver entry in MAINTAINERS and add a new
     entry for the ACPI CPPC library (Christian Loehle)

   - Minor fixes in various cpufreq drivers (Alexander Koskovich, Daniel
     Schwierzeck, Frank Zhang, Haotian Zhang, Kathiravan Thirumoorthy,
     Sumeet Pawnikar, and Xueqin Luo)

   - Fix wrong behaviors on multi-node servers in the Loongson cpufreq
     driver (Huacai Chen)

   - Reject NULL from cpufreq_cpu_get() in the Rust code (Mehmet
     Koseoglu)

   - Add suspend OPP to mediatek cpufreq driver and DT (Ryan Brue)

   - Fixups for a few bugs identified by Sashiko in the amd-pstate
     cpufreq driver (Mario Limoncielloi, Wentao Guan)

   - Initial support for maximum frequency capacity handling on Zen6
     client in amd-pstate (Mario Limonciello)

   - Fix for amd-pstate-ut with 'Requested CPU Min frequency' BIOS
     option (K Prateek Nayak)

   - New Zen6 tuning values for EPP in amd-pstate (Mario Limonciello,
     Vishal Badole)

   - amd-pstate documentation fix (Karl Mehltretter)

   - Restrict deferred downscaling to low load for shared policies in
     the conservative cpufreq governor to avoid undesirable CPU
     frequency reduction in some cases (Shengming Hu)

   - Serialize sugov_start() against rate limit updates in the schedutil
     cpufreq governor to avoid using a stale rate limit value (Hui Su)

   - Prevent cpuidle governors menu and teo from returning idle state 0
     after it has been disabled (Xueqin Luo)

   - Replace min_t() with the better alternatives in the intel_idle
     driver and make it use 2-argument strscpy() (Andy Shevchenko)

   - Fix two repeated phrase instances in cpuidle (Hemanth Selam,
     Syazwina Fazrul)

   - Add rugged Panther Lake support to the intel_rapl power capping
     driver and make it use %pe for printing error pointers (Srinivas
     Pandruvada and Sumeet Pawnikar)

   - Update and improve runtime PM documentation and add a kunit test
     for supplier idle/suspend (Brian Norris)

   - Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit()
     to ensure autosuspend disabling on driver teardown (Joshua Crofts)

   - Ignore page-zero RAM in E820 checksum during hibernation on x86 to
     avoid rejecting images created after kexec() (Matthias Goergens)

   - Add resume event mapping for PMSG_POWEROFF to the PM core to allow
     it to carry out device shutdown in the future (Mario Limonciello)

   - Add DPM watchdog to prepare/late/early/noirq/complete phases of
     device suspend and resume (Mayank Rungta)

   - Update swsusp.txt references to swsusp.rst in hibernation
     documentation (Li Jun)

   - Fix use-after-free of perf domain in netlink doit handlers for
     energy models (Fan Wu)

   - Add synchronize_rcu() back to cpu_pm_unregister_notifier() after it
     was removed inadvertently in previous development cycles to avoid
     use-after-free (Bradley Morgan)

   - Unregister CPU PM notifier outside the timer lock in the
     timer-ti-dm clocksource driver (Bradley Morgan)

   - Fix typo "sucessfully" in a comment in pm_clk_add_clk() kerneldoc
     comment and typo "hierachy" in a comment in pm-graph (Hemanth
     Selam)

   - Fix the return value in dev_pm_opp_get_of_node() kernel-doc (Karl
     Mehltretter)"

* tag 'pm-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (89 commits)
  cpufreq: loongson3: Replace IOCSR read/write with MMIO ones
  cpufreq: loongson3: Use global physical CPU ID in get/target callbacks
  cpufreq: loongson3: Replace per-package mutex with per-node
  cpufreq: loongson3: Adjust the width of id and val in smc_message
  cpufreq: loongson3: Make this driver depend on MACH_LOONGSON64
  PM: runtime: Expand introduction with core concepts and structure
  cpufreq: schedutil: Serialize sugov_start() against rate limit updates
  MAINTAINERS: ACPI: Add a separate CPPC entry
  MAINTAINERS: cpufreq: Replace CPPC reviewer
  arm64: dts: mediatek: mt8173: Mark the lowest CPU OPPs for suspend
  cpufreq: mediatek: Enter system sleep at the suspend OPP
  cpufreq: qcom-cpufreq-hw: fix device node refcount leak in phandle parsing
  cpufreq: qcom-nvmem: Add IPQ9650 support
  cpufreq: Add Milos to cpufreq-dt-platdev blocklist
  cpufreq: Use %pe to print error pointers symbolically
  rust: rcpufreq_dt: add module alias
  cpufreq: sti: avoid NULL dereference in dev_err()
  cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
  cpufreq: sparc-us2e: fix frequency table index copy-paste error
  rust: cpufreq: reject NULL from cpufreq_cpu_get()
  ...
2026-10-21 14:24:26 -10:00
Linus Torvalds
4df4d2a577 ACPI support updates for 7.4-rc1
- Make the core ACPI device enumeration code stop attempting to
    initialize ACPI power management for devices before they are
    known to be present and functional (Rafael Wysocki)
 
  - Simplify and clean up the core ACPI device enumeration code on top of
    the previous adjustment and reduce debug noise coming from it (Rafael
    Wysocki)
 
  - Fix locking in the code binding devices to their ACPI companions,
    prevent it from replacing a valid ACPI companion pointer with NULL
    incidentally, improve its messaging (including debug noise
    reduction), and reduce its overhead by making it skip the cases in
    which no ACPI companion may exist early (Rafael Wysocki)
 
  - Reduce runtime memory footprint of struct acpi_device by rearranging
    fields in it (Andy Shevchenko)
 
  - Update the driver core to allow bus types without drivers to be
    registered as "companion bus types" without driver-related sysfs
    attributes and register the ACPI bus type as a companion one (Rafael
    Wysocki)
 
  - Use strscpy() instead of strcpy() in the ACPI sysfs interface (Ruslan
    Vagner)
 
  - Remove __meminitdata from hmat_adist_nb declaration preserving it
    even when CONFIG_MEMORY_HOTPLUG is not set to prevent notifier chain
    corruption in some cases (Alejandro Lucero)
 
  - Prevent a NULL pointer dereference when attempting to read the table
    length after a mapping bookkeeping failure during an initrd override
    invocation with permanent table mappings enabled (Slavin Liu)
 
  - Use for_each_populated_zone() in get_node_num() in the MRRM table
    pareser (Sang-Heon Jeon)
 
  - Use vsnprintf() in acpi_os_vprintf() to prevent memory corruption
    resulting from overly long diagnostic messages that may not fit into
    a static buffer used by ACPICA and may be produced by a malformed
    ACPI table (Vlatko Kosturjak)
 
  - Ignore leading root scope prefix in string _UID match to allow AMD
    IOMMU matching to work as expected in some cases (Mario Limonciello)
 
  - Adjust message printing macros for ACPI objects to use dev_fmt() for
    more consistency with the analogous dev_*() macros (Rafael Wysocki)
 
  - Add _Ixx GPE wake indicator support to the x86 suspend-to-idle
    handling code (Saranya Gopal)
 
  - Clear driver_data before free in the ACPI PCI Link driver to prevent
    a dangling pointer from being used later (Jiale Yao)
 
  - Accumulate the queued flag across error sections of a CPER record in
    ghes_do_proc() to prevent it from being cleared by a later section or
    entry that does not queue memory-failure work (Breno Leitao)
 
  - Map a raw PCI AER Capability image field by field to prevent
    information loss from occurring while processing it (Dave Jiang)
 
  - Update a stale driver source reference in the ACPI APEI EINJ driver
    documentation (Prabhakar Pujeri)
 
  - Reject CPER records with an out-of-range error_data_length or an
    error status block length wrapping a u32 in the EFI CPER driver (Dave
    Jiang)
 
  - Address multiple assorted issues in the ACPI extlog driver (Dave
    Jiang)
 
  - Address two issues related to CXL in the ACPI APEI GHES driver (Dave
    Jiang)
 
  - Read only validated fields in cper_mem_err_pack() (Dave Jiang)
 
  - Validate memory error section length before payload access, prevent
    writes past array bounds from occurring and sanitize software
    metadata in the ACPI APEI GHES driver (Dave Jiang)
 
  - Make cxl_cper_handle_prot_err() static (Dave Jiang)
 
  - Add IOVT IOMMU support to ACPICA (Bibo Mao)
 
  - Fix PCC OperationRegion command offsets in ACPICA (Sudeep Holla)
 
  - Fix memory leak in acpi_ds_create_field() related to the handling of
    internal_pcc_buffer allocations (Breno Leitao)
 
  - Fix memory leak due to leftover devm_kcalloc() argument in the ACPI
    fan driver (Rafael Wysocki)
 
  - Fix backlight unregistration ordering in the ACPI video bus device
    driver (Rafael Wysocki)
 
  - Update the thermal core to allow the registration of thermal class
    cooling devices under specific parents and convert the ACPI fan,
    ACPI processor, and ACPI video bus device drivers to do so (Rafael
    Wysocki)
 
  - Adjust the ACPI thermal zone driver to use thermal class cooling
    device parent information for binding cooling devices to trip points
    in thermal zones (Rafael Wysocki)
 
  - Use cooling device data that is a better match for a given driver
    instead of a struct acpi_device pointer that had to be used for
    this purpose previously in the ACPI fan and processor drivers (Rafael
    Wysocki)
 
  - Fix acpi_thermal_guess_offset() in the ACPI thermal zone driver for
    thermal zone devices with a 273.0°K offset (Hans de Goede)
 
  - Define a free for ACPI objects allocated by ACPICA helpers and use
    it to simplify AML error handling in the ACPI fan driver (Rafael
    Wysocki)
 
  - Switch over the users of acpi_get_first_physical_node(), that
    was inherently racy and therefore not really safe to use, to use
    its replacement acpi_bus_get_primary_device(), and eliminate the
    former (Rafael Wysocki)
 
  - Add !CONFIG_ACPI stubs for acpi_find_child_device() and
    acpi_device_uid() (Mario Limonciello and Robin Murphy)
 
  - Fix bogus cycle count values on systems without _BIX in the ACPI
    battery driver (Armin Wolf)
 
  - Fix NULL pointer dereference on allocation failure and report
    relative state of charge as CAPACITY in the ACPI SBS driver (Itay
    Shem-tov and Guangshuo Li)
 
  - Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020)
    RZ09-0310 to the ACPI button driver (Ian Gallagher)
 
  - Add new quirks to force the native backlight on Dell OptiPlex AIO
    7410 35W and Acer Nitro AN515-58 in the ACPI video bus device
    driver (Chitransh Mandhaniya and Dirga Yuza)
 
  - Fix the shared memory signature handling in the ACPI PCC address
    space handler, free the PCC mailbox channel on operation region
    deactivation, and avoid unnecessary repeated computations of the
    PCC operation region command timeout (Sudeep Holla)
 
  - Fix a log message typo in the ACPI NUMA support code (Hemanth Selam)
 
  - Zero-initialize capability query result in the ACPI Platform Firmware
    Runtime Update and Telemetry driver to avoid disclosure of kernel
    stack data to user space (Karl Mehltretter)
 
  - Replace the remaining built-in/module check for CONFIG_ACPI_WMI in a
    header file with IS_ENABLED() macro (Lalit Shankar Chowdhury)
 
  - Retry probing battery docks after hotplug in the ACPI docking station
    driver to avoid missing ACPI add notifications (Vibhor Goel)
 
  - Detach device after resource transition failure in pnp_device_probe()
    to avoid blocking later manual PNP configuration attempts (Myeonghun
    Pak)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrWLzASHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1tfwH/2mp9begKCySWSt5EDnCvn01sLQtzZGB
 2q5Iv7j6nO83M+CYhDkI9pay3yRnHP4a2PFC0OPez/628PD6EYiDnZHb6/jCA7tP
 ralr+su0PX8sDacysLmbnWe8JLOLfztmsYt+aJjXywypunaZ5FX4O0Ssh7Mx2U5b
 aJWHo6xLUBhUdCWUleEjPLRzhe9Yp9x5XER0XEcgifnqNAxUtRiWJBWGbpk7ObBO
 5QP8hkVmpkiHLvitjdNOeMF1ZvJLFhOK2sSodCaTYIowVmnccgFmb1xKyXsScrv3
 fa+zwCHuwYi1szbPVq6oWB5f3Fyn4S0N0Kajv+qqFLZv5MNXC6/aNsg=
 =Kc4q
 -----END PGP SIGNATURE-----

Merge tag 'acpi-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI support updates from Rafael Wysocki:
 "The most significant change here is the rework of the core ACPI device
  enumeration code to avoid initializing ACPI power management
  prematurely for devices with unmet dependencies. This essentially is a
  problem fix, but it requires taking PCI device enumeration ordering
  into account among other things, so it is far from straightforward.
  There was an attempt to do this in the 7.3 time frame that had to be
  reverted, so this time it is done much more carefully.

  There is also an ACPI thermal control update rearranging the code to
  register thermal class cooling devices under specific parents, which
  is visible in sysfs. This helps to figure out what is represented by
  those devices much more easily, but it also allows the binding of
  cooling devices to trip points in thermal zones to be adjusted so it
  need not rely on specific cooling device data usage in thermal
  drivers.

  From the number of commits perspective, the most visible part is the
  one replacing acpi_get_first_physical_node() with
  acpi_bus_get_primary_device() everywhere and dropping the former that
  was inherently racy and generally unsafe to use. Fortunately, the
  maintainers involved responded timely and all of that could be done
  within one development cycle.

  Another quite visible part is Dave Jiang's series fixing multiple
  issues reported by Sashiko in the ACPI APEI support code with a PCI
  AER improvement on top. It took several iterations of this to make
  Sashiko happy and the code in question should be much more robust
  going forward.

  One other thing worth mentioning separately is that the ACPI bus type
  is now going to be registered as a "companion" one and it will not be
  possible to register a driver binding directly to a struct
  acpi_device. All of the existing users of those drivers in the tree
  were converted to platform drivers in the previous cycles, so this is
  just a final step in a longer journey.

  Apart from the above, there are many fixes, mostly in drivers, with a
  noticeable exception of a fix in the code binding devices to their
  ACPI companions, new IOVT IOMMU support in ACPICA, new _Ixx object
  support for suspend-to-idle on x86, multiple new quirks, mostly
  related to unused ACPI power resources and backlight handling, and
  assorted cleanups.

  Specifics:

   - Make the core ACPI device enumeration code stop attempting to
     initialize ACPI power management for devices before they are known
     to be present and functional (Rafael Wysocki)

   - Simplify and clean up the core ACPI device enumeration code on top
     of the previous adjustment and reduce debug noise coming from it
     (Rafael Wysocki)

   - Fix locking in the code binding devices to their ACPI companions,
     prevent it from replacing a valid ACPI companion pointer with NULL
     incidentally, improve its messaging (including debug noise
     reduction), and reduce its overhead by making it skip the cases in
     which no ACPI companion may exist early (Rafael Wysocki)

   - Reduce runtime memory footprint of struct acpi_device by
     rearranging fields in it (Andy Shevchenko)

   - Update the driver core to allow bus types without drivers to be
     registered as "companion bus types" without driver-related sysfs
     attributes and register the ACPI bus type as a companion one
     (Rafael Wysocki)

   - Use strscpy() instead of strcpy() in the ACPI sysfs interface
     (Ruslan Vagner)

   - Remove __meminitdata from hmat_adist_nb declaration preserving it
     even when CONFIG_MEMORY_HOTPLUG is not set to prevent notifier
     chain corruption in some cases (Alejandro Lucero)

   - Prevent a NULL pointer dereference when attempting to read the
     table length after a mapping bookkeeping failure during an initrd
     override invocation with permanent table mappings enabled (Slavin
     Liu)

   - Use for_each_populated_zone() in get_node_num() in the MRRM table
     pareser (Sang-Heon Jeon)

   - Use vsnprintf() in acpi_os_vprintf() to prevent memory corruption
     resulting from overly long diagnostic messages that may not fit
     into a static buffer used by ACPICA and may be produced by a
     malformed ACPI table (Vlatko Kosturjak)

   - Ignore leading root scope prefix in string _UID match to allow AMD
     IOMMU matching to work as expected in some cases (Mario
     Limonciello)

   - Adjust message printing macros for ACPI objects to use dev_fmt()
     for more consistency with the analogous dev_*() macros (Rafael
     Wysocki)

   - Add _Ixx GPE wake indicator support to the x86 suspend-to-idle
     handling code (Saranya Gopal)

   - Clear driver_data before free in the ACPI PCI Link driver to
     prevent a dangling pointer from being used later (Jiale Yao)

   - Accumulate the queued flag across error sections of a CPER record
     in ghes_do_proc() to prevent it from being cleared by a later
     section or entry that does not queue memory-failure work (Breno
     Leitao)

   - Map a raw PCI AER Capability image field by field to prevent
     information loss from occurring while processing it (Dave Jiang)

   - Update a stale driver source reference in the ACPI APEI EINJ driver
     documentation (Prabhakar Pujeri)

   - Reject CPER records with an out-of-range error_data_length or an
     error status block length wrapping a u32 in the EFI CPER driver
     (Dave Jiang)

   - Address multiple assorted issues in the ACPI extlog driver (Dave
     Jiang)

   - Address two issues related to CXL in the ACPI APEI GHES driver
     (Dave Jiang)

   - Read only validated fields in cper_mem_err_pack() (Dave Jiang)

   - Validate memory error section length before payload access, prevent
     writes past array bounds from occurring and sanitize software
     metadata in the ACPI APEI GHES driver (Dave Jiang)

   - Make cxl_cper_handle_prot_err() static (Dave Jiang)

   - Add IOVT IOMMU support to ACPICA (Bibo Mao)

   - Fix PCC OperationRegion command offsets in ACPICA (Sudeep Holla)

   - Fix memory leak in acpi_ds_create_field() related to the handling
     of internal_pcc_buffer allocations (Breno Leitao)

   - Fix memory leak due to leftover devm_kcalloc() argument in the ACPI
     fan driver (Rafael Wysocki)

   - Fix backlight unregistration ordering in the ACPI video bus device
     driver (Rafael Wysocki)

   - Update the thermal core to allow the registration of thermal class
     cooling devices under specific parents and convert the ACPI fan,
     ACPI processor, and ACPI video bus device drivers to do so (Rafael
     Wysocki)

   - Adjust the ACPI thermal zone driver to use thermal class cooling
     device parent information for binding cooling devices to trip
     points in thermal zones (Rafael Wysocki)

   - Use cooling device data that is a better match for a given driver
     instead of a struct acpi_device pointer that had to be used for
     this purpose previously in the ACPI fan and processor drivers
     (Rafael Wysocki)

   - Fix acpi_thermal_guess_offset() in the ACPI thermal zone driver for
     thermal zone devices with a 273.0°K offset (Hans de Goede)

   - Define a free for ACPI objects allocated by ACPICA helpers and use
     it to simplify AML error handling in the ACPI fan driver (Rafael
     Wysocki)

   - Switch over the users of acpi_get_first_physical_node(), that was
     inherently racy and therefore not really safe to use, to use its
     replacement acpi_bus_get_primary_device(), and eliminate the former
     (Rafael Wysocki)

   - Add !CONFIG_ACPI stubs for acpi_find_child_device() and
     acpi_device_uid() (Mario Limonciello and Robin Murphy)

   - Fix bogus cycle count values on systems without _BIX in the ACPI
     battery driver (Armin Wolf)

   - Fix NULL pointer dereference on allocation failure and report
     relative state of charge as CAPACITY in the ACPI SBS driver (Itay
     Shem-tov and Guangshuo Li)

   - Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020)
     RZ09-0310 to the ACPI button driver (Ian Gallagher)

   - Add new quirks to force the native backlight on Dell OptiPlex AIO
     7410 35W and Acer Nitro AN515-58 in the ACPI video bus device
     driver (Chitransh Mandhaniya and Dirga Yuza)

   - Fix the shared memory signature handling in the ACPI PCC address
     space handler, free the PCC mailbox channel on operation region
     deactivation, and avoid unnecessary repeated computations of the
     PCC operation region command timeout (Sudeep Holla)

   - Fix a log message typo in the ACPI NUMA support code (Hemanth
     Selam)

   - Zero-initialize capability query result in the ACPI Platform
     Firmware Runtime Update and Telemetry driver to avoid disclosure of
     kernel stack data to user space (Karl Mehltretter)

   - Replace the remaining built-in/module check for CONFIG_ACPI_WMI in
     a header file with IS_ENABLED() macro (Lalit Shankar Chowdhury)

   - Retry probing battery docks after hotplug in the ACPI docking
     station driver to avoid missing ACPI add notifications (Vibhor
     Goel)

   - Detach device after resource transition failure in
     pnp_device_probe() to avoid blocking later manual PNP configuration
     attempts (Myeonghun Pak)"

* tag 'acpi-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (90 commits)
  ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]
  ACPI: video: force native backlight on Dell OptiPlex AIO 7410 35W
  ACPI: PM: sleep: Drop unused sleep_no_lps0 define
  ACPI: PM: Add unused power resource quirk for Casper Excalibur G900
  ACPI: dock: Retry probing battery docks after hotplug
  ACPI: PCI: pci_link: clear driver_data before free
  ACPI: APEI: accumulate the queued flag across error sections
  ACPICA: actbl2.h: Add bit constants of the Flags field in the IOVT IOMMU structure
  ACPI: bus: Drop acpi_get_first_physical_node()
  efi/dev-path-parser: Switch to use acpi_bus_get_primary_device()
  ALSA: hda: tas2781: Switch to use acpi_bus_get_primary_device()
  ALSA: hda: cs35l41: Switch to use acpi_bus_get_primary_device()
  iommu/arm-smmu-v3: Switch to use acpi_bus_get_primary_device()
  PCI/AER: Map a raw AER Capability image field by field
  ACPI: NUMA: fix typo in log message
  ACPI: Add stub for acpi_find_child_device()
  driver core/ACPI: Introduce companion_bus_register()
  ACPI: PCC: Cache OpRegion command timeout
  ACPI: PCC: Free channel on OpRegion deactivation
  ACPI: PCC: Preserve shared memory signature in OpRegion handler
  ...
2026-10-21 12:08:18 -10:00
Qinguang Xu
1ea2927c1b regmap: irq: fix incorrect index calculation for read_sub_irq_data()
While working on a PMIC driver that utilizes num_main_regs > 1, this
issue was noticed. Currently, no in-tree driver sets `num_main_regs >
1`, so this bug has not been triggered in practice.

Pass the global index calculated with `i` instead of the local bit
offset `b` to read_sub_irq_data().

Fix an off-by-one error in the index bounds check.

This patch has been compile-tested only.

Signed-off-by: Qinguang Xu <guang.cy2023@gmail.com>
Link: https://patch.msgid.link/20261020-debug-v1-1-44e0491ede30@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-21 17:53:15 +01:00
Linus Torvalds
cb95904b47 Scheduler updates:
Kconfig updates:
 
  - Simplify PREEMPT_DYNAMIC (Mark Rutland)
 
 Fair scheduler updates:
 
  - Remove redundant RUN_TO_PARITY check (Elif Topuz)
 
  - Declare augmented callbacks per field, fix rb_add_augmented_cached()
    descent (Yiwei Lin, Peter Zijlstra)
 
  - Restart fair hrtick after same-task repicks (Shubhang Kaushik)
 
  - Improve the scheduling latency of short slice tasks (Vincent Guittot)
 
 Deadline/RT scheduler updates:
 
  - Check start_dl_timer expiry with ktime_before()
    (Liang Hao)
 
  - irq_work: CPU-hotplug improvements on PREEMPT_RT (Sebastian Andrzej
    Siewior)
 
 Energy-aware scheduling updates:
 
  - Implement the steal_governor, introduce preferred CPUs and
    steal-driven vCPU backoff (Shrikanth Hegde)
 
 Multi-processor load-balancing updates:
 
  - Enable preferred SMT siblings on NVIDIA Olympus (Andrea Righi)
 
  - Randomize equally shallow idle CPU picks (Christian Loehle)
 
  - Remove redundant core_sched_seq (Hui Su)
 
 Cache-aware scheduling updates:
 
  - Avoid publishing partial LLC utilization (Jemmy Wong)
 
 NUMA-balancing updates:
 
  - Reset NUMA fault locality after scan period update (Eric Kim)
 
 Proxy execution updates:
 
  - Ongoing work to implement sleeping owner handling for proxy
    execution (John Stultz, Vasily Gorbik)
 
  - Preparatory steps to make sched_ext compatible with proxy
    execution (Andrea Righi)
 
 Scheduler infrastructure updates & fixes:
 
  - Remove the RCU wait from PSI trigger destruction (Shakeel Butt)
 
  - Avoid modifying wait-entry on failed priority registration
    (Hui Su)
 
  - Use the new static key API for sched_feat (Hongyan Xia)
 
  - Convert paravirt_steal to new static key APIs (Hongyan Xia)
 
  - cputime: Don't account idle time twice after dyntick-idle
    (Stian Halseth)
 
 Scheduler debugging updates:
 
  - Set TIF_NEED_RESCHED before calling __trace_set_need_resched()
    (Sechang Lim)
 
  - Fix context analysis errors in non-preferred CPU push (Shrikanth
    Hegde)
 
 Misc cleanups and fixes by Christian Loehle, Shubhang Kaushik,
 Thomas Huth and Vladimir Zapolskiy.
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmrUomIRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1ik+Q/+Jx0tXmwOm/wk1ba50zz/tkUL17APJzD1
 0TdHSf0sqssyVnQVmGBNWoKfp30zzrnd8Yf46PH5kUmyIxX0LqazAXsPA/0lxAY6
 jB2b5ZGosyQQPqyjM1q48K/BMB+GGO9xDKlFxxkBsICi+vS+6diBzXM70xla9M4O
 CcAO5DHb50otN/TljfnkmbxG7vgssCVZyS7XG6bSyhd6tUrcr4DVD7gYOMbSVcaL
 8Cgu+b54rOAcrcWU1454YKHI5etUOTjblCbFgISrdw7lwf4dKVtTAKSanFX9n522
 q9sQ1vzuRz6JfSak9nxFkCy5SMjuHJ53DkVNR4eUXNmM0tHdAcVd8jOexmQVBrug
 Yjloo/WydUqGT2TYYEVQPi4J+jMqMRyDIp3TL9UuQjwcjHRnUpd8EVmoNme0TOi+
 e3SoS+xOSVBLgbMFwrjJR/tQuqDPjgBrgIyg8wL+ed5cY6Equ+J3467wp8lO7RBN
 uGwChvxQAOaMlkh5tIR38Zjq9kzs79y85vz3uD2SNk17TcvijVw9UsmQKfAkpdZo
 5FUDM2AdyOhOtZkzMNLHfjjBLSMVCBRo726c6WbELibhuWN7xTAJSJx8o8JNOCrC
 vOBcNNAHpU7BwqA0gFIA3lL1uMXvKn9npKKjnB2C4WxhFGf23NF6uPapyA4sMZ00
 YwRGvOeDvu4=
 =cPCx
 -----END PGP SIGNATURE-----

Merge tag 'sched-core-2026-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler updates from Ingo Molnar:
 "Kconfig updates:

   - Simplify PREEMPT_DYNAMIC (Mark Rutland)

  Fair scheduler updates:

   - Remove redundant RUN_TO_PARITY check (Elif Topuz)

   - Declare augmented callbacks per field, fix
     rb_add_augmented_cached() descent (Yiwei Lin, Peter Zijlstra)

   - Restart fair hrtick after same-task repicks (Shubhang Kaushik)

   - Improve the scheduling latency of short slice tasks (Vincent
     Guittot)

  Deadline/RT scheduler updates:

   - Check start_dl_timer expiry with ktime_before() (Liang Hao)

   - irq_work: CPU-hotplug improvements on PREEMPT_RT (Sebastian Andrzej
     Siewior)

  Energy-aware scheduling updates:

   - Implement the steal_governor, introduce preferred CPUs and
     steal-driven vCPU backoff (Shrikanth Hegde)

  Multi-processor load-balancing updates:

   - Enable preferred SMT siblings on NVIDIA Olympus (Andrea Righi)

   - Randomize equally shallow idle CPU picks (Christian Loehle)

   - Remove redundant core_sched_seq (Hui Su)

  Cache-aware scheduling updates:

   - Avoid publishing partial LLC utilization (Jemmy Wong)

  NUMA-balancing updates:

   - Reset NUMA fault locality after scan period update (Eric Kim)

  Proxy execution updates:

   - Ongoing work to implement sleeping owner handling for proxy
     execution (John Stultz, Vasily Gorbik)

   - Preparatory steps to make sched_ext compatible with proxy execution
     (Andrea Righi)

  Scheduler infrastructure updates & fixes:

   - Remove the RCU wait from PSI trigger destruction (Shakeel Butt)

   - Avoid modifying wait-entry on failed priority registration
     (Hui Su)

   - Use the new static key API for sched_feat (Hongyan Xia)

   - Convert paravirt_steal to new static key APIs (Hongyan Xia)

   - cputime: Don't account idle time twice after dyntick-idle
     (Stian Halseth)

  Scheduler debugging updates:

   - Set TIF_NEED_RESCHED before calling __trace_set_need_resched()
     (Sechang Lim)

   - Fix context analysis errors in non-preferred CPU push (Shrikanth
     Hegde)

  Misc cleanups and fixes by Christian Loehle, Shubhang Kaushik,
  Thomas Huth and Vladimir Zapolskiy"

* tag 'sched-core-2026-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (64 commits)
  sched: Replace nr_iowait_cpu() with a bool accessor
  Revert "sched/fair: Remove dead code on enqueue_task_fair()"
  sched/cache: Avoid publishing partial LLC utilization
  sched/cputime: Don't account idle time twice after dyntick-idle
  sched/psi: Remove the RCU wait from trigger destruction
  sched/eevdf: Remove redundant RUN_TO_PARITY check
  sched/wait: Avoid modifying entry on failed priority registration
  rbtree_test: Use rb_add_augmented_cached() for the cached augmented test
  rbtree: Update augmented data on the way down in rb_add_augmented_cached()
  rbtree: Declare augmented callbacks per field with RB_AUG()
  rbtree_test: Use rb_add() and rb_add_cached() for the basic tests
  smpboot: Don't park the thread if work is pending
  irq_work: Flush lazy work CPU down on PREEMPT_RT
  irq_work: Update a comment regarding CPU hotplug invocation
  sched/topology: Add asymmetric SMT packing override
  sched/fair: Honor asymmetric SMT priority in idle selection
  sched: Set TIF_NEED_RESCHED before calling __trace_set_need_resched()
  sched/core: Fix context analysis errors in non-preferred CPU push
  virt/steal_governor: Enable the driver
  virt/steal_governor: Implement steal_governor policy loop
  ...
2026-10-20 12:35:35 -10:00
Linus Torvalds
ae171014b7 - Orphan several EDAC drivers: i82975x, x38, xgene, i3200. Those have been
receiving just drive-by updates and no one really uses them. At least there
   are no traces of usage on the mailing lists. So, with the advent of
   AI-generated fixes frenzy, and because no one can really test fixes on
   those, it is time to sunset them and point them towards the eternal happy
   hunting-grounds
 
 - Add a dummy EDAC driver with which the EDAC core glue can be exercised in
   a VM for the cases where one does not necessarily have access to the
   hardware. This glue should be extended with all the necessary functionality
   that needs and can be tested this way
 
 - Add an EDAC driver to reset bitfix filters in Intel hardware. Bitfix
   filters are a hw mechanism for tracking stuck bits in memory and CPU arrays
   due to, e.g., silicon aging. Those filters can become clogged by transient
   errors accumulating over a long system uptime so this intel-bff (LOL :))
   driver glue resets those filters on overflow. Work by Qiuxu Zhuo and Tony
   Luck
 
 - Export get_cpu_cacheinfo_id() for use by the new intel-bff driver
 
 - i10nm: Handle the case where hw disables memory controllers which leads to
   reporting the wrong memory controller when reporting an error
 
 - The now-usual AI-powered fixes and other misc cleanups and updates all over
   the place
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmrWVvwACgkQEsHwGGHe
 VUrXsRAAteG50/4VEksBuT4XiEx8HuNtP9Zec12ecpBqRartDKm3I/HiszvT7NT8
 Viqv3Rycdv4aE+oCw17ndK2+9w8kL9uY9UrF62MaXgq2VJUFEJzXS0LhNUq25Y6Y
 8ILyrhSEXvDplL2cDwuPX96I2aJJAdSAD1rxyHjzj6hufYgg5DIfxfWRKR3Qs9F2
 KnG3fxgxJZnT/9eo45Lo1y11r0MRUb8i5a3GNDGDtzP002H1VnOEcnis/BAyPNRR
 1U8cLk5Xx2x522NfhVrVj88YmQt+BQQpKdsNNP67ep2V1SIBjN3HR+GV7x0F1XXk
 q5DwfJWcw4qy9AaSo1/WecOt3cd68LA4DIj9alVM9j4ciWofw5zf8WlRqOaUZvSH
 n6tQECnzGWGs7EQIsPmE5xOwhrVBMDxNvra7NuImUJA/ArBoHnZpUURVygaWFone
 YEnufy2z9mDCi/ADqjqQGpkebYF7CxbqSPE5yUNe/0/fp1iWWZLVvLu1i75GoPxI
 yzvhwle5DUdrxCRzrlzD2Hsky7naFcBfNeARwZVMfO78LT7LopSmdKnx+qzQI3s5
 FWI88H5GN3QuROgJZ402SECWrQiRDMtE9VB6samqPdkIEsW7lR+mF8ZT6vMC6uza
 YujndnAZXQ3tZAuas2LuSqbo/Imr2+EL6LNPwMCLTfVQ14rcUxk=
 =dtPh
 -----END PGP SIGNATURE-----

Merge tag 'edac_updates_for_v7.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC updates from Borislav Petkov:

 - Orphan several EDAC drivers: i82975x, x38, xgene, i3200. Those have
   been receiving just drive-by updates and no one really uses them. At
   least there are no traces of usage on the mailing lists. So, with the
   advent of AI-generated fixes frenzy, and because no one can really
   test fixes on those, it is time to sunset them and point them towards
   the eternal happy hunting-grounds

 - Add a dummy EDAC driver with which the EDAC core glue can be
   exercised in a VM for the cases where one does not necessarily have
   access to the hardware. This glue should be extended with all the
   necessary functionality that needs and can be tested this way

 - Add an EDAC driver to reset bitfix filters in Intel hardware. Bitfix
   filters are a hw mechanism for tracking stuck bits in memory and CPU
   arrays due to, e.g., silicon aging. Those filters can become clogged
   by transient errors accumulating over a long system uptime so this
   intel-bff (LOL :)) driver glue resets those filters on overflow. Work
   by Qiuxu Zhuo and Tony Luck

 - Export get_cpu_cacheinfo_id() for use by the new intel-bff driver

 - i10nm: Handle the case where hw disables memory controllers which
   leads to reporting the wrong memory controller when reporting an
   error

 - The now-usual AI-powered fixes and other misc cleanups and updates
   all over the place

* tag 'edac_updates_for_v7.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  MAINTAINERS: Orphan drivers/edac/i3200_edac.c
  EDAC/skx_base: Fix ambiguous bitwise and logical operator style
  EDAC/i10nm: Fix mdev reference leak in i10nm_get_ddr_munits()
  MAINTAINERS: Orphan drivers/edac/xgene_edac.c
  MAINTAINERS: Orphan drivers/edac/x38_edac.c
  MAINTAINERS: Orphan drivers/edac/i82975x_edac.c
  EDAC/dummy: Add a dummy EDAC driver
  EDAC/ie31200: Disable PCI device when probing fails
  EDAC/{bluefield,loongson}: Use named initializers for acpi_device_id
  MAINTAINERS: Update Qiuxu Zhuo's email address
  EDAC/intel-bff: Report frequent filter overflows
  EDAC/intel-bff: Compute unique ID for overflowed filter
  EDAC/intel-bff: Reset bitfix filter when it overflows
  EDAC/intel-bff: Add Diamond Rapids support
  EDAC/intel-bff: Add stub Intel bitfix filter driver
  x86/mce: Add enumeration for Intel bitfix filter reset
  cacheinfo: Export get_cpu_cacheinfo_id() for loadable modules
  EDAC/i10nm: Fix Granite Rapids ADXL MC mapping
2026-10-20 08:14:43 -10:00
Linus Torvalds
7ed37e9d5c vfs-7.4-rc1.misc
Please consider pulling these changes from the signed vfs-7.4-rc1.misc tag.
 
 Thanks!
 Christian
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCatHrlgAKCRCRxhvAZXjc
 oiocAQDQrd6xDocGA55sJ45KSw1tHYQh5CYH8zml+T9D1agMmwEA5oGUQWEJAoN3
 Y2zXG7WoZcdnKQv3FWRYWhjRmXNxUQk=
 =dbn3
 -----END PGP SIGNATURE-----

Merge tag 'vfs-7.4-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull misc vfs updates from Christian Brauner:
 "Fixes:

   - aio: a keyed poll completion on an epoll instance could recurse
     into the same epoll waitqueue lock when the result eventfd is
     watched by that very instance. An unprivileged process could make a
     CPU spin on the recursive lock. eventfd-backed poll completions are
     always deferred now.

   - fsnotify_inoderemove() is only called once the inode is really
     dead, no nlink and no aliases, and open_by_handle_at() can't add an
     alias to a dead inode anymore. The race could crash fsnotify or
     lose inode mark notifications.

   - devtmpfs: the conversion of the public instance to ->get_tree()
     broke reconfiguring the shared superblock's options on later mounts
     which made the boot time defaults permanent. A reconfigure context
     is kept in fc->fs_private so the parse ops can forward options to
     the underlying filesystem.

   - ufs truncated the 64-bit directory size to an unsigned int in
     ufs_last_byte(). A crafted image with a 4 GiB directory produced an
     out-of-folio read in ufs_find_entry() and, with
     CONFIG_UFS_FS_WRITE, a write into an adjacent page.

   - devpts rejects max=0 instead of silently lifting the per-instance
     pty limit. The value wrapped into ida_alloc_max() and became
     unlimited.

   - fs_pin publishes pins with the rcu list helpers so the kill paths
     reading the lists under rcu see the initialization.

   - dentry_kill() reports a Tasks-RCU quiescent state. Its
     cond_resched() is the only reschedule point on the dentry teardown
     path and cond_resched() isn't a quiescent state for Tasks-RCU, so
     Meta kept seeing rcu_tasks stalls in btrfs subvolume deletion.

   - writeback sizes foreign flushes by the target wb's dirty pages
     instead of the memcg-wide count which over or undersized a single
     bdi flush.

   - nfsd READ emitted two fsnotify access events on the iterator path
     since vfs_iocb_iter_read() already sends one. A READ on a krb5i or
     krb5p mount showed up twice in inotify.

   - pipe and splice pass a poll key when waking readers and writers so
     epoll, poll() and select() waiters only wake for the event they
     asked for.

   - the iso8859-14 Unicode to charset tables had page01 duplicated as
     page1e so 29 code points mapped to the wrong bytes and 22 that
     aren't in the charset were accepted.

   - orangefs doesn't wait for an unmount service operation that never
     returns on system shutdown and uses ssize_t for strscpy() errors.

   - __register_chrdev() checks the kobject_set_name() return value.

   - selftest fixes: the openat2 tests hardcoded O_LARGEFILE to 0x8000
     which is O_NOFOLLOW on powerpc, resolve_test makes /tmp a
     mountpoint so RESOLVE_NO_XDEV has a boundary to trip over,
     file_stressor moves into its own directory with a 30 minute
     timeout, the kernfs listxattr test skips when SELinux exposes
     security.selinux, the namespaces active reference tests wait for
     the thread via a PIDFD_THREAD pidfd since pthread_join() returns
     before exit_nsproxy_namespaces(), the idmapped_tmpfile test chowns
     its directory into the mapped range, the clone3 CLONE_CLEAR_SIGHAND
     test adds CLONE_VM so it fails for the intended reason, the pidfd
     PPID error message prints the values it compares and fscontext_ns
     gets a .gitignore.

  Cleanups:

   - vmcore prints the release of the crashed kernel from the VMCOREINFO
     note so a kdump that dies before the dump lands still says which
     kernel it was for.

   - initramfs allocates hardlink hash entries with the validated cpio
     name length instead of PATH_MAX, which put every entry in
     kmalloc-8k.

   - the unused dax_layout_busy_page() is removed,
     dax_layout_busy_page_range() becomes static and dax_folio_init()
     drops a redundant list initialization.

   - vfs_empty_path() is removed, it has had no callers since
     getname_maybe_null().

   - comment and documentation fixes in aio, bpf_fs_kfuncs,
     fs-writeback, inode, read_write, squashfs and the vfs.rst copy of
     struct file_system_type"

* tag 'vfs-7.4-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (38 commits)
  selftests/filesystems: Fix idmapped_tmpfile layer dir ownership
  selftests/namespaces: Wait for thread exit via pidfd in active-ref tests
  writeback: size foreign flushes by target wb dirty pages
  initramfs: Reduce hardlink hash allocation sizes
  fs: remove unused vfs_empty_path()
  dcache: report a Tasks-RCU quiescent state in dentry_kill()
  vmcore: report the release of the crashed kernel
  splice: pass a poll key when waking pipe readers and writers
  pipe: pass a poll key when waking writers after a resize
  orangefs: use ssize_t instead of size_t for error codes...
  orangefs_super: don't wait on service operation on system shutdown.
  docs/vfs: Fix the struct file_system_type copy
  nls: fix the Unicode to charset tables of iso8859-14
  selftests/filesystems/openat2: make /tmp a mountpoint inside private namespace
  selftests/filesystems/openat2: fix O_LARGEFILE definitions for non-arm64 architectures
  fs: fix misleading comments in read_write.c
  squashfs: fix inode number description in documentation
  fs: fix typos in comments
  fs/dax: Make dax_layout_busy_page_range() static
  fs/dax: Remove unused dax_layout_busy_page()
  ...
2026-10-19 19:30:45 -10:00
Mark Brown
2dee91ee94 regmap: Fixes for v7.3
The main thing here is a fix for lockdep warnings with MMIO regmaps that
 use a raw spinlock and a cache, some other lockdep fixes we'd done for
 the benefit of the maple tree on sleeping buses meant that we were doing
 allocations for those MMIO regmaps under a raw spinlock.  While fixing
 that Michael Reeves also noticed that the debugfs files were briefly
 available without the cache structures backing them.
 
 There's also a fix for interrupt freeing on error in regmap-irq which
 had been hanging around because it's not super urgent.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQReagvpf3TrrA7BoYYv73Ows9A4iQUCatS/PwAKCRAv73Ows9A4
 idqeAP4y6bdFUzY0e9Ntiixana3IyzJ2dxzrjHIFHcOZl02UhwD8D2jWwFIw0CIs
 izZUkBabg5UyIeM1NkzZWtmDhkZTaAk=
 =AS9J
 -----END PGP SIGNATURE-----

regmap: Merge up fixes

The main thing here is a fix for lockdep warnings with MMIO regmaps that
use a raw spinlock and a cache, some other lockdep fixes we'd done for
the benefit of the maple tree on sleeping buses meant that we were doing
allocations for those MMIO regmaps under a raw spinlock.  While fixing
that Michael Reeves also noticed that the debugfs files were briefly
available without the cache structures backing them.

There's also a fix for interrupt freeing on error in regmap-irq which
had been hanging around because it's not super urgent.
2026-10-19 19:23:44 +01:00
Rafael J. Wysocki
6c326a54b0 Merge branches 'pm-sleep', 'pm-em', 'pm-cpu', 'pm-misc' and 'pm-tools'
Merge updates related to system sleep, an energy model handling update,
a generic CPU PM driver update, a clock framework PM update, and a
pm-graph utility update for 7.4:

 - Ignore page-zero RAM in E820 checksum during hibernation on x86 to
   avoid rejecting images created after kexec() (Matthias Goergens)

 - Add resume event mapping for PMSG_POWEROFF to the PM core to allow it
   to carry out device shutdown in the future (Mario Limonciello)

 - Add DPM watchdog to prepare/late/early/noirq/complete phases of
   device suspend and resume (Mayank Rungta)

 - Update swsusp.txt references to swsusp.rst in hibernation
   documentation (Li Jun)

 - Fix use-after-free of perf domain in netlink doit handlers for energy
   models (Fan Wu)

 - Add synchronize_rcu() back to cpu_pm_unregister_notifier() after it
   was removed inadvertently in previous development cycles to avoid
   use-after-free (Bradley Morgan)

 - Unregister CPU PM notifier outside the timer lock in the timer-ti-dm
   clocksource driver (Bradley Morgan)

 - Fix typo "sucessfully" in a comment in pm_clk_add_clk() kerneldoc
   comment and typo "hierachy" in a comment in pm-graph (Hemanth Selam)

* pm-sleep:
  x86/hibernate: Ignore page-zero RAM in E820 checksum
  PM: sleep: Add resume event mapping for PMSG_POWEROFF
  PM: sleep: Add DPM watchdog to prepare/late/early/noirq/complete phases
  PM: hibernate: docs: update swsusp.txt references to swsusp.rst

* pm-em:
  PM: EM: Fix use-after-free of perf domain in netlink doit handlers

* pm-cpu:
  PM: CPU: Restore synchronize_rcu() to cpu_pm_unregister_notifier()
  clocksource/drivers/timer-ti-dm: Unregister CPU PM notifier outside of the timer lock

* pm-misc:
  PM: clk: fix typo "sucessfully" in comment

* pm-tools:
  tools: power: pm-graph: fix typo "hierachy" in comment
2026-10-19 14:56:31 +02:00
Rafael J. Wysocki
dc2021eae5 Merge branch 'pm-runtime'
Merge updates related to runtime PM for 7.4:

 - Update and improve runtime PM documentation and add a kunit test for
   supplier idle/suspend (Brian Norris)

 - Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit()
   to ensure autosuspend disabling on driver teardown (Joshua Crofts)

* pm-runtime:
  PM: runtime: Expand introduction with core concepts and structure
  PM: runtime: Clarify driver callback expectations and structure Section 2
  PM: runtime: Clarify ->runtime_idle() callback return value handling
  PM: runtime: Add "Section" hyperlinks
  PM: runtime: Misc improvements to runtime_pm.rst
  PM: runtime: More kerneldoc formatting
  PM: runtime: Correct pm_runtime_autosuspend_expiration() doc
  PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()
  PM: core: Document struct dev_pm_info with kerneldoc
  PM: runtime: Pull API docs from kerneldoc
  PM: runtime: kerneldoc wording improvements
  PM: runtime: Improve set_{status,active,suspended} docs
  PM: runtime: kerneldoc fixes
  PM: runtime: Add kunit test for supplier idle/suspend
  PM: runtime: Only queue an idle check for RPM-linked suppliers
2026-10-19 14:52:22 +02:00
Mario Peter
187a62f99d driver core: take parent lock in async device attach
For device types with need_parent_lock set (only USB interfaces),
probe() must run with the parent device locked. A synchronous attach
after device_add() gets this from the caller, e.g.
usb_set_configuration() holds the udev lock while adding interfaces.
__device_attach_async_helper() runs the probe from an async worker
instead, where that lock isn't held, and only takes device_lock(dev).

With async probing enabled for the hub driver (e.g. driver_async_probe=*
or driver_async_probe=hub), this races when a multi-TT hub is
configured. For multi-TT hubs, hub_probe() calls
usb_set_interface(hdev, 0, 1) to select the TT-per-port altsetting, and
usb_set_interface() creates the endpoint devices of the interface a
second time:

  usb_set_configuration()           async worker
    [udev locked]
    device_add(intf)
      queues the probe  ----------> __device_attach_async_helper()
                                      [intf locked, udev not locked]
                                      hub_probe()
                                        usb_set_interface(hdev, 0, 1)
    create_intf_ep_devs(intf)             create_intf_ep_devs(intf)

create_intf_ep_devs() checks and sets intf->ep_devs_created without a
lock of its own. If usb_set_configuration() has created ep_81 but not
yet set the flag, usb_set_interface() skips removing the endpoint
devices of the old altsetting and creates ep_81 again. With a
synchronous probe, hub_probe() runs inside device_add() with the udev
lock held, and usb_set_configuration() then finds ep_devs_created
already set.

Single-TT hubs don't call usb_set_interface() from hub_probe() and
don't show this warning, but their probe runs without the udev lock as
well.

On an i.MX8MM board with an onboard USB2514 hub this hit 11 of 100
boots:

  sysfs: cannot create duplicate filename '.../1-1/1-1:1.0/ep_81'
  Call trace:
   sysfs_warn_dup
   usb_create_ep_devs
   create_intf_ep_devs
   usb_set_interface
   hub_probe
   usb_probe_interface
   really_probe
   __device_attach_async_helper
   async_run_entry_fn

It also shows on v7.3-rc6 in QEMU, with dummy_hcd and a raw-gadget
program emulating a multi-TT hub: re-authorizing the hub in a loop,
while a SCHED_FIFO task preempts the writing task at random points for
3 ms, hit the warning in 29 of 6000 iterations.

Take the parent lock in __device_attach_async_helper() as well, like
__driver_attach_async_helper() does, and move
__device_driver_lock/unlock() up for that. With this the warning was
gone in 300 boots on the board and in 6000 iterations in QEMU.

Fixes: 765230b5f0 ("driver-core: add asynchronous probing support for drivers")
Signed-off-by: Mario Peter <mario.peter@leica-geosystems.com>
Cc: stable@vger.kernel.org	# 4.2
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ johan: switch to async_schedule_dev_nocall() to avoid deadlock if
         async_schedule_dev() runs synchronously when parent lock is
	 held ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20261014133109.1392265-4-johan@kernel.org
[ Fold the nested conditions into a single if statement; correct commit
  message to mention "device types" rather than "buses" for
  "need_parent_lock". - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-10-16 22:36:09 +02:00
Johan Hovold
4059f8986c driver core: take parent lock on deferred probe
USB interfaces should be probed with the parent USB device lock held,
but this is not honoured when probe is deferred.

Add a new bus_probe_device_deferred() helper to handle deferred probe
where the parent device lock is not held.

Fixes: d1c3414c2a ("drivercore: Add driver probe deferral mechanism")
Reported-by: Mario Peter <mario.peter@leica-geosystems.com>
Link: https://lore.kernel.org/20261007131514.1260696-1-mario.peter@leica-geosystems.com
Cc: stable@vger.kernel.org	# 3.4
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20261014133109.1392265-3-johan@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-10-16 22:35:59 +02:00
Johan Hovold
0f554506a3 driver core: fix parent lock use-after-free on USB disconnect
USB interfaces should be probed with their parent USB device lock held
and the USB bus therefore sets the need_parent_lock bus flag so that
driver core takes the parent lock when needed.

Driver core is only guaranteed to hold a reference to the parent device
during initial probe however and nothing prevents the device and its
parent from being deregistered and the parent potentially freed, for
example, while iterating over devices in driver_attach() or
bus_rescan_devices_helper().

Since commit 524134d422 ("USB: don't cancel queued resets when
unbinding drivers") USB interfaces hold a reference to their parent USB
device, but a parent hub may still go away while probing a USB device
(e.g. via the drivers_probe sysfs interface). This can lead to a
use-after-free when taking the parent device lock before checking the
device->p->dead flag of the device being probed.

As only USB interfaces actually need the parent lock, make the
need_parent_lock feature even more fine grained by making it a device
type rather than bus feature. By requiring that any users also make sure
that their devices hold a reference to their parents (like USB does),
driver core can lock a device and its parent without first checking if
the device has been deregistered.

Note that this will also increase parallelism when using asynchronous
probe as USB devices connected to the same hub can now be probed in
parallel.

Fixes: bf74ad5bc4 ("[PATCH] Hold the device's parent's lock during probe and remove")
Cc: stable@vger.kernel.org	# 2.6.16: 524134d42231: USB: don't cancel queued resets when unbinding drivers
Cc: stable@vger.kernel.org	# 2.6.16
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20261014133109.1392265-2-johan@kernel.org
[ Fix mention of bus vs. device type in __device_driver_{un}lock().
  - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-10-16 22:35:48 +02:00
Rafael J. Wysocki
253b25cbb3 Merge branches 'acpi-scan', 'acpi-glue', 'acpi-bus' and 'acpi-sysfs'
Merge ACPI support infrastructure changes for 7.4:

 - Make the core ACPI device enumeration code stop attempting to
   initialize ACPI power management for devices before they are
   known to be present and functional (Rafael Wysocki)

 - Simplify and clean up the core ACPI device enumeration code on top of
   the previous adjustment and reduce debug noise coming from it (Rafael
   Wysocki)

 - Fix locking in the code binding devices to their ACPI companions,
   prevent it from replacing a valid ACPI companion pointer with NULL
   incidentally, improve its messaging (including debug noise
   reduction), and reduce its overhead by making it skip the cases in
   which no ACPI companion may exist early (Rafael Wysocki)

 - Reduce runtime memory footprint of struct acpi_device by rearranging
   fields in it (Andy Shevchenko)

 - Update the driver core to allow bus types without drivers to be
   registered as "companion bus types" without driver-related sysfs
   attributes and register the ACPI bus type as a companion one (Rafael
   Wysocki)

 - Use strscpy() instead of strcpy() in the ACPI sysfs interface (Ruslan
   Vagner)

* acpi-scan:
  ACPI: scan: Combine two conditionals in acpi_bus_attach()
  ACPI: PM: Move acpi_bus_init_power() declaration to internal header file
  ACPI: scan: Stop calling acpi_bus_init_power() early
  ACPI: PM: Drop parent state update from acpi_device_get_power()
  ACPI: scan: Drop useless and noisy debug statement

* acpi-glue:
  ACPI: glue: Skip devices with no type in acpi_device_notify()
  ACPI: glue: Fix up and adjust acpi_unbind_one()
  ACPI: glue: Rearrange acpi_bind_one() to avoid breakage
  ACPI: glue: Carry out companion lookup under bus_type_sem
  ACPI: glue: Rework the success message in acpi_device_notify()
  ACPI: glue: Reduce debug noise from acpi_device_notify()

* acpi-bus:
  driver core/ACPI: Introduce companion_bus_register()
  ACPI: bus: Reduce runtime memory footprint of struct acpi_device

* acpi-sysfs:
  ACPI: sysfs: use strscpy() instead of strcpy()
2026-10-16 21:17:17 +02:00
Peter Zijlstra
840e23085b Merge branch 'tip/sched/urgent'
Pickup dependencies; notably the RB-tree fix.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
2026-10-13 13:51:24 +02:00
Mark Brown
d5a821f660
regmap: Fix cache lifecycle locking and teardown
Michael Reeves <michael.reeves077@gmail.com> says:

Fix an "Invalid wait context" lockdep warning during Apple GPIO probe and
correct debugfs ordering during cache teardown.

Tested on Apple M3 MacBook Air (T8122):

- All 4 GPIO controllers probe successfully with lockdep enabled.
- The "Invalid wait context" warning no longer occurs.
- The regmap KUnit suite passes and lockdep remains enabled.

Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-0-37bdd82fd47c@gmail.com
2026-10-13 00:11:44 +01:00
Michael Reeves
abff0a48b1
regmap: Drop map lock during cache init and exit
On systems with CONFIG_PROVE_RAW_LOCK_NESTING enabled, Apple GPIO probe
triggers an "Invalid wait context" lockdep warning.

The driver uses a regmap with a raw spinlock and REGCACHE_FLAT. During
regcache_init(), regcache_flat_init() allocates memory while holding the
raw spinlock. The memory allocator can acquire a non-raw spinlock, which
causes an invalid raw-to-non-raw lock nesting error. The abbreviated call
chain is:

  apple_gpio_pinctrl_probe
    regcache_init
      regcache_flat_init
        __kmalloc_noprof
          __pcs_replace_empty_main
            refill_objects
              _raw_spin_lock_irqsave

Cache allocation occurs before the regmap is published, cache destruction
occurs after users have stopped accessing it, and regmap_reinit_cache()
requires callers to prevent concurrent access. Remove the outer map lock
from cache initialization and destruction. Keep it for cache population
and normal register access.

The Maple cache still uses its internal spinlock during teardown. That
lock can also be acquired from hard IRQ context during register access.
Add Maple-state irqsave helpers and use them during teardown to preserve
the lock's IRQ-safe lockdep state.

Fixes: fd4ebc07b4 ("regmap: Hold the regmap lock when allocating and freeing the cache")
Suggested-by: Mark Brown <broonie@kernel.org>
Suggested-by: Liam R. Howlett <liam@infradead.org>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-2-37bdd82fd47c@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-13 00:11:44 +01:00
Michael Reeves
834035934c
regmap: Remove debugfs before cache teardown
regmap_exit() and regmap_reinit_cache() destroy the register cache before
removing debugfs. A concurrent debugfs cache operation can therefore
access cache state after the backend exit callback starts freeing it.

Remove debugfs before cache teardown, and clear the debugfs pointer after
removal. During cache reinitialization, recreate debugfs only after the
new cache initializes successfully.

Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-1-37bdd82fd47c@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-13 00:11:43 +01:00
Peng Fan
f52260f49b regmap: debugfs: Use __free(kfree) for regmap_reg_ranges_read_file
Convert buf and entry in regmap_reg_ranges_read_file() from manual
kfree() to __free(kfree) scope-based cleanup. This eliminates the
goto error path and the manual kfree(buf) on entry allocation failure,
simplifying the function to use straight-line returns.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261008-regmap-debugfs-fix-v1-1-3df2f25c01b6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-08 09:46:00 +02:00
Peng Fan
a93de1d65c regmap: debugfs: Use guard to simplify code
Replace open-coded mutex_lock()/unlock() pairs with guard() and
scoped_guard() across the debugfs code.

 - regmap_debugfs_get_dump_start(): guard(mutex) replaces three
   unlock sites (kzalloc failure, cache hit, end-of-function).

 - regmap_next_readable_reg(): early return for the common case
   and scoped_guard for the cache fallback path.

 - regmap_reg_ranges_read_file(): scoped_guard wraps the cache
   iteration loop.

 - regmap_debugfs_init(): scoped_guard for single list_add.

 - regmap_debugfs_exit(): flatten if/else into early return and
   scoped_guard for the early-list cleanup.

 - regmap_debugfs_initcall(): guard(mutex) held to function end.

No functional change.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-7-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Peng Fan
d64967dee8 regmap: debugfs: Use __free(kfree) in regmap_name_read_file()
Use the __free(kfree) cleanup helper for the temporary buffer allocated
by regmap_name_read_file().

Remove the explicit kfree() calls from the error and success paths.

No functional change.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-6-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Peng Fan
ca685a42b0 regmap: fix potential double-free of map->reg_defaults on cache reinit
regcache_exit() frees map->reg_defaults but does not NULL the pointer.
If regmap_reinit_cache() is later called with a config that has neither
reg_defaults nor num_reg_defaults_raw, regcache_init() skips both
allocation branches and leaves the stale pointer in place.  Should
cache_ops->init then fail, the err_free_reg_defaults error path calls
kfree(map->reg_defaults) a second time.

NULL the pointer after freeing so the error-path kfree() is a harmless
no-op.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-5-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Peng Fan
8a889c83e4 regmap: use krealloc_array() in regmap_register_patch()
Replace krealloc() with krealloc_array() in regmap_register_patch() to
gain the built-in overflow check on the element-count * element-size
multiplication, and switch to the early-return error style to reduce
nesting.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-4-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Peng Fan
4e1b5ccf1e regcache: simplify control flow and reduce nesting
Move the count guard into regcache_hw_init() so callers don't need to
check before calling, and flatten conditional blocks that wrap a single
call by using early returns instead.

Merge the two separate reg_defaults / num_reg_defaults sanity checks
into a single expression, and drop unnecessary else-after-return in
regcache_lookup_reg() and regcache_sync_block().

No functional change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-3-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Peng Fan
7ca8aa98e2 regcache: extract __regcache_sync() to deduplicate sync dispatch
regcache_sync() and regcache_sync_region() both open-code the same
pattern: check cache_dirty, then dispatch to either cache_ops->sync()
or regcache_default_sync().

Extract this into a static __regcache_sync() helper that both callers
share. The helper checks cache_dirty and returns 0 early when the
cache is clean, dispatches to the backend sync callback when present,
and falls back to regcache_default_sync() otherwise.

In regcache_sync_region(), the cache_dirty early-exit previously
skipped setting map->async. With the helper, map->async is set to
true before the call and restored to false unconditionally afterward,
so when cache_dirty is false the flag is toggled and immediately
restored - functionally equivalent.

No functional change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-2-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Peng Fan
81556a7aec regcache: extract locked helpers to replace open-coded lock/unlock pairs
The previous patch ("regcache: use the regmap scoped lock guard")
deliberately left regcache_init() with explicit map->lock()/unlock()
calls because the function has a goto err_* cleanup ladder and mixing
goto with cleanup helpers in the same function is discouraged by
cleanup.h.

Solve this by extracting two static helpers:

  regcache_locked_op()  - acquires the regmap lock via guard(regmap),
                          invokes an int-returning cache_ops callback
                          (init, populate), and returns its result.
                          Returns 0 when the callback is NULL.

  regcache_locked_exit() - acquires the regmap lock via guard(regmap)
                           and invokes the void-returning exit
                           callback.  Returns immediately when the
                           callback is NULL.

Because the lock scope is now entirely inside the helper functions,
it never crosses a goto target in the caller, so the cleanup.h
concern does not apply.

Convert all four remaining open-coded lock/unlock sites in
regcache_init() (init, populate, error-path exit) and the
scoped_guard in regcache_exit() to use these helpers.

No functional change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261002-regmap-lock-2nd-v2-1-e172b0501c52@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-10-06 18:08:00 +02:00
Mario Limonciello (AMD)
9df3e4316c PM: sleep: Add resume event mapping for PMSG_POWEROFF
PM_EVENT_POWEROFF (0x0800) and PMSG_POWEROFF were already defined in
include/linux/pm.h, and pm_op(), pm_late_early_op() and pm_noirq_op()
already dispatch PM_EVENT_POWEROFF to the same ops->poweroff*() callbacks
as PM_EVENT_HIBERNATE.  Add the matching entry to resume_event() so that
when a poweroff suspend sequence is aborted (for example a device's
->poweroff_noirq() callback fails and the PM core rolls the
already-suspended devices back), those devices are resumed with
PMSG_RESTORE and their ->restore*() callbacks run.

Map it to PMSG_RESTORE, mirroring the existing PM_EVENT_HIBERNATE
handling.  This is correct because both events suspend via
ops->poweroff*(), whose counterpart is ops->restore*().  Mapping to
PMSG_ON would be a no-op: it is what the default return already yields,
and pm_op()/pm_late_early_op()/pm_noirq_op() have no PM_EVENT_ON case,
so they would return NULL and silently skip every resume callback on the
abort path.

This completes the PMSG_POWEROFF infrastructure needed to support
differentiating between hibernation and shutdown sequences when
re-using callbacks for common code.

Hibernation is started by writing a hibernation method (such as 'platform'
'shutdown', or 'reboot') to use into /sys/power/disk and writing 'disk' to
/sys/power/state.

Shutdown is initiated with the reboot() syscall with arguments on whether
to halt the system or power it off.

Tested-by: Eric Naim <dnaim@cachyos.org>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
[ rjw: Subject tweak ]
Link: https://patch.msgid.link/20260926225555.2916525-1-mario.limonciello@amd.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-30 21:45:39 +02:00
Brian Norris
f667dd6713 PM: runtime: More kerneldoc formatting
In taking another pass at these docs, I found some more inconsistencies.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260929194956.v3.2.Ia1cae8a40a24662df11553c225f4438eab65b7db@changeid
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-30 14:52:37 +02:00
Brian Norris
4c91a2f480 PM: runtime: Correct pm_runtime_autosuspend_expiration() doc
The "adjusted to be nonzero" comment may be a relic from when this API
previously used jiffies, although I'm not quite sure about that either.
In any case, it doesn't seem correct today.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260929194956.v3.1.Ifc8b2d1742729cc82f46220d85c6382fdee1fc8b@changeid
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-30 14:52:37 +02:00
Mark Brown
012c37f094
regmap: convert map->lock/unlock users to a scoped guard
Peng Fan (OSS) <peng.fan@oss.nxp.com> says:

The regmap lock is taken by calling the lock and unlock callbacks
directly at every call site:

	map->lock(map->lock_arg);
	...
	map->unlock(map->lock_arg);

The open-coded pattern forces every error path to unlock by hand,
which spreads goto out_unlock chains and duplicated unlock statements
throughout regmap.c and regcache.c and makes it easy to leak the lock
on a newly added return path.

Define a scoped guard for the regmap lock (DEFINE_GUARD) in internal.h
and convert the users to it. The lock and unlock callbacks are chosen
at init time (mutex, spinlock, raw spinlock, hwspinlock or none) and
return void, so an unconditional guard is sufficient. Function-scope
critical sections use guard(regmap)(); sites that must run work after
the lock is dropped - for example regmap_register_patch() calling
regmap_async_complete() and the debugfs cache_only handler calling
regcache_sync() (which takes the lock itself) - use
scoped_guard(regmap, ...) so the trailing work stays outside the
guarded region.

regcache_sync() and regcache_sync_region() are deliberately left
unconverted: they already use a single goto out unlock path, so a
guard would save nothing while forcing either a goto inside a
scoped_guard scope or a control-flow rewrite, neither of which is an
improvement.

This patchset removes many manual unlock statements together with the
associated goto out_unlock labels.

The series is split to keep the regcache: and regmap: changes on their
own commits and to preserve independent revertibility:

  1. define the guard and convert regmap.c
  2. convert regcache.c (except the sync helpers, see above)
  3. convert the regcache rbtree debugfs dump
  4. convert the regmap debugfs write handlers

No functional change.

Tested with the regmap KUnit suite (drivers/base/regmap/regmap-kunit.c)
under ARCH=um: 551/551 tests pass, and 551/551 again with lockdep
(PROVE_LOCKING, DEBUG_LOCK_ALLOC, DEBUG_ATOMIC_SLEEP) enabled with no
splats. Built clean with sparse (C=1) showing no lock-context
imbalance warnings.

Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-0-8a6127223c16@nxp.com
2026-09-28 19:49:41 +01:00
Peng Fan
9999d5a07e
regmap: debugfs: use the regmap scoped lock guard
Convert the open-coded map->lock()/map->unlock() users in the debugfs
cache_only and cache_bypass write handlers to the regmap scoped guard.

regmap_cache_bypass_write_file() uses guard(regmap)() since the locked
region runs to the return. regmap_cache_only_write_file() uses
scoped_guard(regmap, ...) because the subsequent regcache_sync() must
run with the lock released - it takes the regmap lock itself - so it
stays outside the guarded scope exactly as before. No functional
change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-4-8a6127223c16@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28 19:49:39 +01:00
Peng Fan
555a1bd78b
regcache: rbtree: use the regmap scoped lock guard
Convert the open-coded map->lock()/map->unlock() pair in rbtree_show()
to guard(regmap)(). The locked region spans the whole function body up
to the single return, so a function-scope guard drops the manual
unlock with no functional change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-3-8a6127223c16@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28 19:49:38 +01:00
Peng Fan
23f1120dcb
regcache: use the regmap scoped lock guard
Convert the open-coded map->lock()/map->unlock() users in regcache.c
to the regmap scoped guard introduced for regmap.c. Use
scoped_guard(regmap, ...) in regcache_exit(), where the locked region
is a subsection of the function, and guard(regmap)() for the
function-scope critical sections.

regcache_init() keeps explicit map->lock()/map->unlock() calls: it
has a goto err_* cleanup ladder and mixing goto with cleanup helpers
in the same function is not allowed by cleanup.h.

regcache_sync() and regcache_sync_region() are left as-is: they
already use a single goto out unlock path, so converting them would
require either mixing a goto with a scoped_guard scope or restructuring
their control flow, neither of which is an improvement.

No functional change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-2-8a6127223c16@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28 19:49:37 +01:00
Peng Fan
80328b41ea
regmap: convert lock/unlock to a scoped guard
The regmap lock and unlock callbacks are invoked directly as
map->lock(map->lock_arg) / map->unlock(map->lock_arg) at every call
site. This open-coded pattern requires manual unlocking on every
return path, which spreads goto out_unlock chains and duplicated
unlock statements throughout the code and is an easy place to leak
the lock on an error path.

Define a scoped guard for the regmap lock in internal.h. The lock and
unlock callbacks are chosen at init time (mutex, spinlock, raw
spinlock, hwspinlock or none) and return void, so an unconditional
DEFINE_GUARD() is sufficient.

Convert all lock/unlock users in regmap.c to guard(regmap)() for
function-scope critical sections and scoped_guard(regmap, ...) where
work must run outside the lock (e.g. regmap_register_patch() calling
regmap_async_complete()). This drops every manual unlock and the
associated goto out_unlock labels with no functional change.

Assisted-by: LLM
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-1-8a6127223c16@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28 19:49:36 +01:00
Shrikanth Hegde
6208245165 sysfs: Add preferred CPU file
Add a "preferred" file in /sys/devices/system/cpu/ when kernel is
built with CONFIG_PREFERRED_CPU=y.

This would help
- Users to quickly check which CPUs are marked as preferred.
- Userspace daemons such as irqbalance to use this mask to
  route irqs into preferred CPUs.

For example:
cat /sys/devices/system/cpu/online
0-719
cat /sys/devices/system/cpu/preferred
0-599        <<< Implies 0-599 are preferred for workloads and 600-719
                 should be avoided at this moment.

cat /sys/devices/system/cpu/preferred
0-719        <<< All CPUs are usable. There is no preference.

Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260928053728.797539-6-sshegde@linux.ibm.com
2026-09-28 08:44:41 +02:00
Danilo Krummrich
a85ce03a58 Linux 7.3-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmq5gqUeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG1m0IAKReEZDW1PRuno8+
 eLDLgJ2pYk8CMAnl7UO6OAG9dQWT5vLIJrRerLeoG2ZDP9kr5cJPGytXryxUtH1D
 8UfuSRZ+/b/JD0yhHlod0MSvZeVWbRtcL7r03kcea0p4ziNeR+V20oUQqM33ZuCL
 7o12W0EYtsQwfSmtMsO+5ayIoOu05FSBb/l2mnWi3TFUUYcLbna4SwBcQuVf/jXQ
 mCeNqTtFMHsdAFp27AFfu4wV87+y158QFyXxpCeoUk8cGcFDY8zu5R8CqijtHSar
 x9hpPGSMDVm+BSxfrIsDXWVU/1WskRAPyNw+l14vFR1NwY6uLUBruajPyLEnh3B4
 SzHSAxg=
 =5Bii
 -----END PGP SIGNATURE-----

Merge tag 'v7.3-rc5' into driver-core-next

We need the driver-core fixes in here as well to build on top of.

Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-09-28 00:53:19 +02:00
Cezary Rojewski
b728c07e30 driver core: platform: Simplify platform_device_alloc()
There is no need to double check the 'pa' object.

Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Vishal Moola (Fractile) <vishal.moola@gmail.com>
Link: https://patch.msgid.link/20260925093928.3765486-1-cezary.rojewski@intel.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-09-26 10:21:01 +02:00
Joshua Crofts
d1706f9da9 PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()
Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit() to
ensure autosuspend is disabled on driver teardown.

Suggested-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Link: https://patch.msgid.link/20260919-move-dont-use-autosuspend-v1-1-f6e2d1315c23@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 21:47:59 +02:00
Hemanth Selam
53d39bfd20 PM: clk: fix typo "sucessfully" in comment
Correct "sucessfully" to "successfully", reported by scripts/checkpatch.pl
using the misspelling list in scripts/spelling.txt.

Only touches comments, no code changes.

Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
[ rjw: Subject adjustment ]
Link: https://patch.msgid.link/20260907064725.10686-2-hemanth.selam@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 19:09:50 +02:00
Mayank Rungta
33392343c7 PM: sleep: Add DPM watchdog to prepare/late/early/noirq/complete phases
Extend the DPM watchdog to wrap device_prepare, device_suspend_late,
device_suspend_noirq, device_resume_noirq, device_resume_early, and
device_complete callbacks. If a driver hangs during these transitions,
the watchdog will fire and dump a stack trace to help identify the
offending driver.

To prevent false-positive timeouts, the watchdog is set only after
waiting for subordinate (during suspend) and superior (during resume)
devices. With this change, DPM watchdog coverage is extended across all
phases of system sleep transitions.

Signed-off-by: Mayank Rungta <mrungta@google.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260909224818.2177311-1-mrungta@google.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 18:56:34 +02:00
Rafael J. Wysocki
57c59c0bda driver core/ACPI: Introduce companion_bus_register()
The ACPI bus type does not allow drivers to be matched to devices, so
the sysfs attributes related to drivers created for it are useless and
their existence is confusing.

Moreover, it is better to prevent drivers from being registered and
looked up for a bus like that.

To allow skipping the creation of those sysfs attributes and preventing
driver registration and lookup for the ACPI bus type, introduce a
"companion" bus type concept and add a special registration function
for registering "companion" bus types, companion_bus_register().

The "drivers" directory under the ACPI bus type is still needed because
there are versions of systemd that depend on it [1].

Link: https://lore.kernel.org/linux-acpi/SN6PR02MB41575266A4580339E186E5D9D4812@SN6PR02MB4157.namprd02.prod.outlook.com/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
[ rjw: Add comment regarding drivers_kset creation in bus_register_internal() ]
Link: https://patch.msgid.link/12985239.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 18:41:48 +02:00