]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
5 weeks agobtrfs: rename err to ret2 in read_block_for_search()
David Sterba [Fri, 30 May 2025 16:17:11 +0000 (18:17 +0200)] 
btrfs: rename err to ret2 in read_block_for_search()

Unify naming of return value to the preferred way.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: rename err to ret2 in resolve_indirect_refs()
David Sterba [Fri, 30 May 2025 16:17:05 +0000 (18:17 +0200)] 
btrfs: rename err to ret2 in resolve_indirect_refs()

Unify naming of return value to the preferred way, move the variable to
the closest scope.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: rename btrfs_subpage structure
Qu Wenruo [Mon, 2 Jun 2025 00:38:53 +0000 (10:08 +0930)] 
btrfs: rename btrfs_subpage structure

With the incoming large data folios support, the structure name
btrfs_subpage is no longer correct, as for we can have multiple blocks
inside a large folio, and the block size is still page size.

So to follow the schema of iomap, rename btrfs_subpage to
btrfs_folio_state, along with involved enums.

There are still exported functions with "btrfs_subpage_" prefix, and I
believe for metadata the name "subpage" will stay forever as we will
never allocate a folio larger than nodesize anyway.

The full cleanup of the word "subpage" will happen in much smaller steps
in the future.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: add comments on the extra btrfs specific subpage bitmaps
Qu Wenruo [Mon, 2 Jun 2025 00:38:52 +0000 (10:08 +0930)] 
btrfs: add comments on the extra btrfs specific subpage bitmaps

Unlike the iomap_folio_state structure, the btrfs_subpage structure has a
lot of extra sub-bitmaps, namely:

- writeback sub-bitmap
- locked sub-bitmap
  iomap_folio_state uses an atomic for writeback tracking, while it has
  no per-block locked tracking.

  This is because iomap always locks a single folio, and submits dirty
  blocks with that folio locked.

  But btrfs has async delalloc ranges (for compression), which are queued
  with their range locked, until the compression is done, then marks the
  involved range writeback and unlocked.

  This means a range can be unlocked and marked writeback at seemingly
  random timing, thus it needs the extra tracking.

  This needs a huge rework on the lifespan of async delalloc range
  before we can remove/simplify these two sub-bitmaps.

- ordered sub-bitmap
- checked sub-bitmap
  These are for COW-fixup, but as I mentioned in the past, the COW-fixup
  is not really needed anymore and these two flags are already marked
  deprecated, and will be removed in the near future after comprehensive
  tests.

Add related comments to indicate we're actively trying to align the
sub-bitmaps to the iomap ones.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: harden parsing of compression mount options
Daniel Vacek [Mon, 2 Jun 2025 15:53:19 +0000 (17:53 +0200)] 
btrfs: harden parsing of compression mount options

Btrfs happily but incorrectly accepts the `-o compress=zlib+foo` and similar
options with any random suffix.

Fix that by explicitly checking the end of the strings.

Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: factor out compression mount options parsing
Daniel Vacek [Mon, 2 Jun 2025 15:53:18 +0000 (17:53 +0200)] 
btrfs: factor out compression mount options parsing

There are many options making the parsing a bit lengthy.  Factor the
compress options out into a helper function.  The next patch is going to
harden this function.

Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: constify more pointer parameters
David Sterba [Thu, 15 May 2025 15:03:24 +0000 (17:03 +0200)] 
btrfs: constify more pointer parameters

Another batch of pointer parameter constifications. This is for clarity
and minor addition to type safety. There are no observable effects in the
assembly code and .ko measured on release config.

Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: sysfs: track current commit duration in commit_stats
Boris Burkov [Fri, 9 May 2025 00:54:41 +0000 (17:54 -0700)] 
btrfs: sysfs: track current commit duration in commit_stats

When debugging/detecting outlier commit stalls, having an indicator that
we are currently in a long commit critical section can be very useful.
Extend the commit_stats sysfs file to also include the current commit
critical section duration.

Since this requires storing the last commit start time, use that rather
than a separate stack variable for storing the finished commit durations
as well.

This also requires slightly moving up the timing of the stats updating
to *inside* the critical section to avoid the transaction T+1 setting
the critical_section_start_time to 0 before transaction T can update its
stats, which would trigger the new ASSERT. This is an improvement in and
of itself, as it makes the stats more accurately represent the true
critical section time. It may be yet better to pull the stats up to where
start_transaction gets unblocked, rather than the next commit, but this
seems like a good enough place as well.

Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in rb_simple_insert()
Pan Chuang [Fri, 16 May 2025 03:03:33 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in rb_simple_insert()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: pass struct rb_simple_node pointer directly in rb_simple_insert()
Pan Chuang [Fri, 16 May 2025 03:03:32 +0000 (11:03 +0800)] 
btrfs: pass struct rb_simple_node pointer directly in rb_simple_insert()

Replace struct embedding with union to enable safe type conversion in
btrfs_backref_node, tree_block and mapping_node.

Adjust function calls to use the new unified API, eliminating redundant
parameters.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in btrfs_qgroup_add_swapped_blocks()
Yangtao Li [Fri, 16 May 2025 03:03:31 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in btrfs_qgroup_add_swapped_blocks()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find() in btrfs_qgroup_trace_subtree_after_cow()
Yangtao Li [Fri, 16 May 2025 03:03:30 +0000 (11:03 +0800)] 
btrfs: use rb_find() in btrfs_qgroup_trace_subtree_after_cow()

Use the rb-tree helper so we don't open code the search code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in add_qgroup_rb()
Yangtao Li [Fri, 16 May 2025 03:03:29 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in add_qgroup_rb()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find() in find_qgroup_rb()
Yangtao Li [Fri, 16 May 2025 03:03:28 +0000 (11:03 +0800)] 
btrfs: use rb_find() in find_qgroup_rb()

Use the rb-tree helper so we don't open code the search code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in insert_ref_entry()
Yangtao Li [Fri, 16 May 2025 03:03:27 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in insert_ref_entry()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in insert_root_entry()
Yangtao Li [Fri, 16 May 2025 03:03:26 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in insert_root_entry()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find() in lookup_root_entry()
Yangtao Li [Fri, 16 May 2025 03:03:25 +0000 (11:03 +0800)] 
btrfs: use rb_find() in lookup_root_entry()

Use the rb-tree helper so we don't open code the search code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in insert_block_entry()
Yangtao Li [Fri, 16 May 2025 03:03:24 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in insert_block_entry()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find() in lookup_block_entry()
Yangtao Li [Fri, 16 May 2025 03:03:23 +0000 (11:03 +0800)] 
btrfs: use rb_find() in lookup_block_entry()

Use the rb-tree helper so we don't open code the search code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in ulist_rbtree_insert()
Yangtao Li [Fri, 16 May 2025 03:03:22 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in ulist_rbtree_insert()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find() in ulist_rbtree_search()
Yangtao Li [Fri, 16 May 2025 03:03:21 +0000 (11:03 +0800)] 
btrfs: use rb_find() in ulist_rbtree_search()

Use the rb-tree helper so we don't open code the search code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find() in __btrfs_lookup_delayed_item()
Yangtao Li [Fri, 16 May 2025 03:03:20 +0000 (11:03 +0800)] 
btrfs: use rb_find() in __btrfs_lookup_delayed_item()

Use the rb-tree helper so we don't open code the search code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: use rb_find_add() in btrfs_insert_inode_defrag()
Yangtao Li [Fri, 16 May 2025 03:03:19 +0000 (11:03 +0800)] 
btrfs: use rb_find_add() in btrfs_insert_inode_defrag()

Use the rb-tree helper so we don't open code the search and insert
code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: fix comment in reserved space warning
Dan Johnson [Tue, 15 Apr 2025 00:25:52 +0000 (17:25 -0700)] 
btrfs: fix comment in reserved space warning

mkfs.btrfs up to v4.14 actually can leave a chunk inside the reserved
space when invoked with `-m single`, fixed by 997f9977c24397eb6980bb9
("mkfs: Prevent temporary system chunk to use space in reserved 1M
range") released with v4.15.

Signed-off-by: Dan Johnson <ComputerDruid@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: relocation: simplify unused logic related to LINK_LOWER
Daniel Vacek [Wed, 14 May 2025 13:12:39 +0000 (15:12 +0200)] 
btrfs: relocation: simplify unused logic related to LINK_LOWER

btrfs_backref_link_edge() is always called with the LINK_LOWER argument.
We can simplify it and remove the LINK_LOWER and LINK_UPPER macros
completely.

The last call with LINK_UPPER was removed with commit 0097422c0dfe0a
("btrfs: remove clone_backref_node() from relocation").

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: unfold transaction abort at btrfs_insert_one_raid_extent()
Filipe Manana [Mon, 19 May 2025 11:16:10 +0000 (12:16 +0100)] 
btrfs: unfold transaction abort at btrfs_insert_one_raid_extent()

We have a common error path where we abort the transaction, but like this
in case we get a transaction abort stack trace we don't know exactly which
previous function call failed. Instead abort the transaction after any
function call that returns an error, so that we can easily identify which
function failed.

Reviewed-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: unfold transaction abort at __btrfs_update_delayed_inode()
Filipe Manana [Mon, 19 May 2025 10:57:13 +0000 (11:57 +0100)] 
btrfs: unfold transaction abort at __btrfs_update_delayed_inode()

We have a common error path where we abort the transaction, but like this
in case we get a transaction abort stack trace we don't know exactly which
previous function call failed. Instead abort the transaction after any
function call that returns an error, so that we can easily identify which
function failed.

Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: abort transaction on unexpected eb generation at btrfs_copy_root()
Filipe Manana [Mon, 19 May 2025 10:07:29 +0000 (11:07 +0100)] 
btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()

If we find an unexpected generation for the extent buffer we are cloning
at btrfs_copy_root(), we just WARN_ON() and don't error out and abort the
transaction, meaning we allow to persist metadata with an unexpected
generation. Instead of warning only, abort the transaction and return
-EUCLEAN.

CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: unfold transaction abort at btrfs_copy_root()
Filipe Manana [Mon, 19 May 2025 09:59:18 +0000 (10:59 +0100)] 
btrfs: unfold transaction abort at btrfs_copy_root()

Instead of having a common btrfs_abort_transaction() call for when any of
the two btrfs_inc_ref() calls fail, move the btrfs_abort_transaction() to
happen immediately after each one of the calls, so that when analyzing a
stack trace with a transaction abort we know which call failed.

Reviewed-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: move transaction aborts to the error site in add_block_group_free_space()
David Sterba [Sat, 17 May 2025 19:03:57 +0000 (21:03 +0200)] 
btrfs: move transaction aborts to the error site in add_block_group_free_space()

Transaction aborts should be done next to the place the error happens,
which was not done in add_block_group_free_space().

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: move transaction aborts to the error site in remove_block_group_free_space()
David Sterba [Sat, 17 May 2025 19:04:10 +0000 (21:04 +0200)] 
btrfs: move transaction aborts to the error site in remove_block_group_free_space()

Transaction aborts should be done next to the place the error happens,
which was not done in remove_block_group_free_space().

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: simplify error detection flow during log replay
Filipe Manana [Wed, 21 May 2025 17:18:09 +0000 (18:18 +0100)] 
btrfs: simplify error detection flow during log replay

We have this fuzzy logic at btrfs_recover_log_trees() where we don't
abort the transaction and exit immediately after each function call that
returned an error, and instead have if-then-else logic or check if the
previous function call returned success before calling the next function.

Make the flow more straightforward by immediately aborting the transaction
and exiting after each function call failure. This also allows to avoid
two consecutive if statements that test the same conditions:

   if (!ret && wc.stage == LOG_WALK_REPLAY_ALL) {
        (...)
   }

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: remove redundant path release when replaying a log tree
Filipe Manana [Wed, 21 May 2025 16:56:25 +0000 (17:56 +0100)] 
btrfs: remove redundant path release when replaying a log tree

There's no need to call btrfs_release_path() before calling
btrfs_init_root_free_objectid() as we have released the path already at
the top of the loop and the previous call to fixup_inode_link_counts()
also releases the path. So remove it to simplify the code.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: abort transaction during log replay if walk_log_tree() failed
Filipe Manana [Wed, 21 May 2025 16:41:18 +0000 (17:41 +0100)] 
btrfs: abort transaction during log replay if walk_log_tree() failed

If we failed walking a log tree during replay, we have a missing
transaction abort to prevent committing a transaction where we didn't
fully replay all the changes from a log tree and therefore can leave the
respective subvolume tree in some inconsistent state. So add the missing
transaction abort.

CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: unfold transaction aborts when replaying log trees
Filipe Manana [Wed, 21 May 2025 16:30:56 +0000 (17:30 +0100)] 
btrfs: unfold transaction aborts when replaying log trees

We have a single line doing a transaction abort in case either we got an
error from btrfs_get_fs_root() different from -ENOENT or we got an error
from btrfs_pin_extent_for_log_replay(), making it hard to figure out which
function call failed when looking at a transaction abort massages and
stack trace in dmesg. Change this to have an explicit transaction abort
for each one of the two cases.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: make btrfs_should_periodic_reclaim() static
Johannes Thumshirn [Wed, 21 May 2025 10:14:05 +0000 (12:14 +0200)] 
btrfs: make btrfs_should_periodic_reclaim() static

btrfs_should_periodic_reclaim() is not used outside of space-info.c so
make it static and remove the prototype from space-info.h.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agobtrfs: zoned: use filesystem size not disk size for reclaim decision
Johannes Thumshirn [Tue, 20 May 2025 07:20:47 +0000 (09:20 +0200)] 
btrfs: zoned: use filesystem size not disk size for reclaim decision

When deciding if a zoned filesystem is reaching the threshold to reclaim
data block groups, look at the size of the filesystem not to potentially
total available size of all drives in the filesystem.

Especially if a filesystem was created with mkfs' -b option, constraining
it to only a portion of the block device, the numbers won't match and
potentially garbage collection is kicking in too late.

Fixes: 3687fcb0752a ("btrfs: zoned: make auto-reclaim less aggressive")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
5 weeks agowifi: ath12k: Correct tid cleanup when tid setup fails
Sarika Sharma [Mon, 21 Jul 2025 06:17:49 +0000 (11:47 +0530)] 
wifi: ath12k: Correct tid cleanup when tid setup fails

Currently, if any error occurs during ath12k_dp_rx_peer_tid_setup(),
the tid value is already incremented, even though the corresponding
TID is not actually allocated. Proceed to
ath12k_dp_rx_peer_tid_delete() starting from unallocated tid,
which might leads to freeing unallocated TID and cause potential
crash or out-of-bounds access.

Hence, fix by correctly decrementing tid before cleanup to match only
the successfully allocated TIDs.

Also, remove tid-- from failure case of ath12k_dp_rx_peer_frag_setup(),
as decrementing the tid before cleanup in loop will take care of this.

Compile tested only.

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250721061749.886732-1-quic_sarishar@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
5 weeks agowifi: ath12k: bring DFS support back for WCN7850
Baochen Qiang [Mon, 21 Jul 2025 02:27:26 +0000 (10:27 +0800)] 
wifi: ath12k: bring DFS support back for WCN7850

Due to the restrict in MAC80211 that DFS (Dynamic Frequency Selection)
can't be enabled on multiple channels, commit 176f3009ae59 ("wifi: ath12k:
support 2 channels for single pdev device") removes DFS support in order
to support 2 channels concurrently, making AP mode not working on DFS
channels [1].

Revert portions of that commit to bring DFS back, and add a new
combination to support 2-channels concurrency. This is valid because the
MAC80211 restrict works on each individual combination, but does not care
about them as a whole, as far as DFS is concerned.

This change applies to WCN7850 only, other chips are not affected.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284.1-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Fixes: 176f3009ae59 ("wifi: ath12k: support 2 channels for single pdev device")
Reported-by: Mihai Moldovan <ionic@ionic.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220346 # 1
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Tested-by: Mihai Moldovan <ionic@ionic.de>
Link: https://patch.msgid.link/20250721-ath12k-dfs-v1-1-065c31454f91@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
5 weeks agowifi: ath12k: Prefer {} to {0} in initializers
Jeff Johnson [Sun, 20 Jul 2025 15:24:14 +0000 (08:24 -0700)] 
wifi: ath12k: Prefer {} to {0} in initializers

Prefer {} to {0} in initializers since {} works even when the first
member is not a scalar.

Generated using:
sed -i 's/{[[:space:]]*0[[:space:]]*}/{}/g' drivers/net/wireless/ath/ath12k/*

Compile tested only.

Link: https://patch.msgid.link/20250720-ath12k-zero-brace-v1-1-d8c8ca9d40a8@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
5 weeks agowifi: ath11k: Prefer {} to {0} in initializers
Jeff Johnson [Sun, 20 Jul 2025 15:13:38 +0000 (08:13 -0700)] 
wifi: ath11k: Prefer {} to {0} in initializers

Prefer {} to {0} in initializers since {} works even when the first
member is not a scalar.

Generated using:
sed -i 's/{[[:space:]]*0[[:space:]]*}/{}/g' drivers/net/wireless/ath/ath11k/*

Compile tested only.

Link: https://patch.msgid.link/20250720-ath11k-zero-brace-v1-1-6132e2ef1748@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
5 weeks agowifi: ath10k: Prefer {} to {0} in initializers
Jeff Johnson [Sun, 20 Jul 2025 14:46:15 +0000 (07:46 -0700)] 
wifi: ath10k: Prefer {} to {0} in initializers

Prefer {} to {0} in initializers since {} works even when the first
member is not a scalar.

Generated using:
sed -i 's/{[[:space:]]*0[[:space:]]*}/{}/g' drivers/net/wireless/ath/ath10k/*

Compile tested only.

Link: https://patch.msgid.link/20250720-ath10k-zero-brace-v1-1-c1ee818d6238@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
5 weeks agoPM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS
Steven Rostedt [Thu, 12 Jun 2025 14:53:14 +0000 (10:53 -0400)] 
PM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS

The power_domain_target event event is only called when CONFIG_OMAP2PLUS
is defined. As each event can take up to 5K regardless if they are used or
not, it's best not to define them when they are not used. Add #ifdef
around these events when they are not used.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/20250612145408.415483176@goodmis.org
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
5 weeks agoPM: tracing: Hide device_pm_callback events under PM_SLEEP
Steven Rostedt [Thu, 12 Jun 2025 14:53:13 +0000 (10:53 -0400)] 
PM: tracing: Hide device_pm_callback events under PM_SLEEP

The events device_pm_callback_start and device_pm_callback_end events are
only called when CONFIG_PM_SLEEP is defined. As each event can take up to
5K regardless if they are used or not, it's best not to define them when
they are not used. Add #ifdef around these events when they are not used.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/20250612145408.246703478@goodmis.org
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
5 weeks agoPM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE
Steven Rostedt [Thu, 12 Jun 2025 14:53:12 +0000 (10:53 -0400)] 
PM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE

The events psci_domain_idle_enter and psci_domain_idle_exit events are
only called when CONFIG_ARM_PSCI_CPUIDLE is defined. As each event can
take up to 5K (less for DEFINE_EVENT()) regardless if they are used or
not, it's best not to define them when they are not used. Add #ifdef
around these events when they are not used.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/20250612145408.074769245@goodmis.org
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
5 weeks agoPM: cpufreq: powernv/tracing: Move powernv_throttle trace event
Steven Rostedt [Thu, 12 Jun 2025 14:53:11 +0000 (10:53 -0400)] 
PM: cpufreq: powernv/tracing: Move powernv_throttle trace event

As the trace event powernv_throttle is only used by the powernv code, move
it to a separate include file and have that code directly enable it.

Trace events can take up around 5K of memory when they are defined
regardless if they are used or not. It wastes memory to have them defined
in configurations where the tracepoint is not used.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/20250612145407.906308844@goodmis.org
Fixes: 0306e481d479a ("cpufreq: powernv/tracing: Add powernv_throttle tracepoint")
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
5 weeks agoalarmtimer: Hide alarmtimer_suspend event when RTC_CLASS is not configured
Steven Rostedt [Thu, 12 Jun 2025 13:58:28 +0000 (09:58 -0400)] 
alarmtimer: Hide alarmtimer_suspend event when RTC_CLASS is not configured

The trace event alarmtimer_suspend is only called when RTC_CLASS is
defined. As every event created can create up to 5K of text and meta data
regardless if it is called or not it should not be created and waste
memory. Hide the event when CONFIG_RTC_CLASS is not defined.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20250612095828.6d75dfa3@batman.local.home
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
5 weeks agotracing, AER: Hide PCIe AER event when PCIEAER is not configured
Steven Rostedt [Thu, 12 Jun 2025 13:49:32 +0000 (09:49 -0400)] 
tracing, AER: Hide PCIe AER event when PCIEAER is not configured

The event aer_event is only used when CONFIG_PCIEAER is configured. It
should not be created when it is not. When an event is created it creates
around 5K of text and meta data regardless if the tracepoint is used or
not. Instead of wasting this memory, put #ifdef around the event to not
create it when it is not used.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/20250612094932.4a08abd6@batman.local.home
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
5 weeks agoktest.pl: Always display BUILD_DIR and OUTPUT_DIR at the start of tests
Steven Rostedt [Fri, 18 Jul 2025 20:18:45 +0000 (16:18 -0400)] 
ktest.pl: Always display BUILD_DIR and OUTPUT_DIR at the start of tests

As ktest.pl can run in various different directories, to make sure the
test is running in the proper directory with the proper source and proper
destination directory, display the content of BUILD_DIR and OUTPUT_DIR at
the start of every test.

This can be helpful for the test runner to stop the test if a test is
running in the wrong location instead of finding out after the test has
completed.

Cc: "John Warthog9 Hawley" <warthog9@kernel.org>
Cc: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/20250718202053.898022631@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
5 weeks agoktest.pl: Prevent recursion of default variable options
Steven Rostedt [Fri, 18 Jul 2025 20:18:44 +0000 (16:18 -0400)] 
ktest.pl: Prevent recursion of default variable options

If a default variable contains itself, do not recurse on it.

For example:

  ADD_CONFIG := ${CONFIG_DIR}/temp_config
  DEFAULTS
  ADD_CONFIG = ${CONFIG_DIR}/default_config ${ADD_CONFIG}

The above works because the temp variable ADD_CONFIG (is a temp because it
is created with ":=") is already defined, it will be substituted in the
variable option. But if it gets commented out:

  # ADD_CONFIG := ${CONFIG_DIR}/temp_config
  DEFAULTS
  ADD_CONFIG = ${CONFIG_DIR}/default_config ${ADD_CONFIG}

Then the above will go into a recursive loop where ${ADD_CONFIG} will
get replaced with the current definition of ADD_CONFIG which contains the
${ADD_CONFIG} and that will also try to get converted. ktest.pl will error
after 100 attempts of recursion and fail.

When replacing a variable with the default variable, if the default
variable contains itself, do not replace it.

Cc: "John Warthog9 Hawley" <warthog9@kernel.org>
Cc: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/20250718202053.732189428@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
5 weeks agoktest.pl: Have -D option work without a space
Steven Rostedt [Fri, 18 Jul 2025 20:18:43 +0000 (16:18 -0400)] 
ktest.pl: Have -D option work without a space

Allow -DBUILD_TYPE=boot work the same as -D BUILD_TYPE=boot just like
normal single character option does in most applications.

Cc: "John Warthog9 Hawley" <warthog9@kernel.org>
Cc: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/20250718202053.567246162@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
5 weeks agoktest.pl: Allow command option -D to override temp variables
Steven Rostedt [Fri, 18 Jul 2025 20:18:42 +0000 (16:18 -0400)] 
ktest.pl: Allow command option -D to override temp variables

Currently -D only updates the persistent options that are defined with
"=". Allow it to also override all temp variables that are defined with
":=".

 ktest.pl -D 'USE_TEMP_DIR:=1' -D 'TEST_TYPE[2]=build' config

Cc: "John Warthog9 Hawley" <warthog9@kernel.org>
Cc: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/20250718202053.399653933@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
5 weeks agoktest.pl: Add -D option to override options
Steven Rostedt [Fri, 18 Jul 2025 20:18:41 +0000 (16:18 -0400)] 
ktest.pl: Add -D option to override options

Add -D option that lets the user override options in the config.

For instance, if the config has: BUILD_NOCLEAN=1 which prevents mrproper
from being called before builds, and the user wants to call it once. The
user can run:

  ktest -D BUILD_NOCLEAN=0 config

And the default "BUILD_NOCLEAN" options will be disabled.

If the user wants to change the second test to do a build and not boot,
the user can run:

  ktest -D 'TEST_TYPE[2]=build' config

Where the '[#]' is for the test to assign the variable for. In the above
example, it will happen on test 2.

Cc: "John Warthog9 Hawley" <warthog9@kernel.org>
Cc: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/20250718202053.231478909@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
5 weeks agodt-bindings: thermal: tegra: Document Tegra210B01
Aaron Kling [Mon, 21 Jul 2025 02:14:59 +0000 (21:14 -0500)] 
dt-bindings: thermal: tegra: Document Tegra210B01

Add the compatible string for Tegra210B01 SOC_THERM

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://lore.kernel.org/r/20250720-t210b01-v2-5-9cb209f1edfc@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
5 weeks agodt-bindings: thermal: mediatek: Add fallback compatible string for MT7981 and MT8516
Aleksander Jan Bajkowski [Sat, 12 Jul 2025 19:59:03 +0000 (21:59 +0200)] 
dt-bindings: thermal: mediatek: Add fallback compatible string for MT7981 and MT8516

The ‘mediatek,mt7981-thermal’ and ‘mediatek,mt8516-thermal’ strings
aren't definied in the driver. Both should have fallback compatible
strings. This commit fixes this issue.

Fixes: 788494ba0999 ("dt-bindings: thermal: convert Mediatek Thermal to the json-schema")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20250712195904.6988-2-olek2@wp.pl
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
5 weeks agowifi: cfg80211/mac80211: report link ID for unexpected frames
Michael-CY Lee [Mon, 21 Jul 2025 06:51:59 +0000 (14:51 +0800)] 
wifi: cfg80211/mac80211: report link ID for unexpected frames

The upper layer may require the link ID to properly handle
unexpected frames. For instance, if hostapd, operating as an
AP MLD, receives a data frame from a non-associated STA,
it must send deauthentication to the link on which the STA is
operating.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Reviewed-by: Money Wang <money.wang@mediatek.com>
Link: https://patch.msgid.link/20250721065159.1740992-1-michael-cy.lee@mediatek.com
[edit commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 weeks agowifi: mac80211: determine missing link_id in ieee80211_rx_for_interface() based on...
Michael-CY Lee [Mon, 21 Jul 2025 06:29:29 +0000 (14:29 +0800)] 
wifi: mac80211: determine missing link_id in ieee80211_rx_for_interface() based on frequency

For broadcast frames, every interface might have to process it and
therefore the link_id cannot be determined in the driver.

In mac80211, when the frame is about to be forwarded to each interface,
we can use the member "freq" in struct ieee80211_rx_status to determine
the "link_id" for each interface.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Reviewed-by: Money Wang <money.wang@mediatek.com>
Link: https://patch.msgid.link/20250721062929.1662700-1-michael-cy.lee@mediatek.com
[simplify, remove unnecessary link->conf check]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 weeks agowifi: brcmfmac: support CYW54591 PCIE device
Double Lo [Tue, 24 Jun 2025 09:34:53 +0000 (04:34 -0500)] 
wifi: brcmfmac: support CYW54591 PCIE device

CYW54591 is a variant of BCM4355 silicon with the same chipid. In the
chipid-fwname mapping table, apply chiprev 13 to identify CYW54591.
Skip reading OTP process for CYW chip since it contains vendor specific
information which is not common for cypress.

Signed-off-by: Double Lo <double.lo@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Ian Lin <ian.lin@infineon.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250624093453.7264-1-ian.lin@infineon.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 weeks agowifi: brcmfmac: fix P2P discovery failure in P2P peer due to missing P2P IE
Gokul Sivakumar [Thu, 26 Jun 2025 05:07:02 +0000 (10:37 +0530)] 
wifi: brcmfmac: fix P2P discovery failure in P2P peer due to missing P2P IE

After commit bd99a3013bdc ("brcmfmac: move configuration of probe request
IEs"), the probe request MGMT IE addition operation brcmf_vif_set_mgmt_ie()
got moved from the brcmf_p2p_scan_prep() to the brcmf_cfg80211_scan().

Because of this, as part of the scan request handler for the P2P Discovery,
vif struct used for adding the Probe Request P2P IE in firmware got changed
from the P2PAPI_BSSCFG_DEVICE vif to P2PAPI_BSSCFG_PRIMARY vif incorrectly.
So the firmware stopped adding P2P IE to the outgoing P2P Discovery probe
requests frames and the other P2P peers were unable to discover this device
causing a regression on the P2P feature.

To fix this, while setting the P2P IE in firmware, properly use the vif of
the P2P discovery wdev on which the driver received the P2P scan request.
This is done by not changing the vif pointer, until brcmf_vif_set_mgmt_ie()
is completed.

Fixes: bd99a3013bdc ("brcmfmac: move configuration of probe request IEs")
Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250626050706.7271-1-gokulkumar.sivakumar@infineon.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 weeks agowifi: cfg80211: reject HTC bit for management frames
Johannes Berg [Fri, 18 Jul 2025 18:23:06 +0000 (20:23 +0200)] 
wifi: cfg80211: reject HTC bit for management frames

Management frames sent by userspace should never have the
order/HTC bit set, reject that. It could also cause some
confusion with the length of the buffer and the header so
the validation might end up wrong.

Link: https://patch.msgid.link/20250718202307.97a0455f0f35.I1805355c7e331352df16611839bc8198c855a33f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 weeks agowifi: mac80211: remove ieee80211_remove_key
Miri Korenblit [Mon, 21 Jul 2025 06:20:03 +0000 (09:20 +0300)] 
wifi: mac80211: remove ieee80211_remove_key

It is no longer used, remove it.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250721091956.e964ceacd85c.Idecab8ef161fa58e000b3969bc936399284b79f0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 weeks agoMerge tag 'clk-meson-v6.17-1' of https://github.com/BayLibre/clk-meson into clk-amlogic
Stephen Boyd [Mon, 21 Jul 2025 17:32:46 +0000 (10:32 -0700)] 
Merge tag 'clk-meson-v6.17-1' of https://github.com/BayLibre/clk-meson into clk-amlogic

Pull Amlogic clk driver updates from Jerome Brunet:

 - Use the auxiliary reset controller implementation in the
   Amlogic axg-audio, instead of implementing the reset
   controller in drivers/clk
 - Drop unnecessary clock controller headers for Amlogic drivers
 - Drop clock controller big regmap tables in the Amlogic drivers

* tag 'clk-meson-v6.17-1' of https://github.com/BayLibre/clk-meson:
  clk: amlogic: s4: remove unused data
  clk: amlogic: drop clk_regmap tables
  clk: amlogic: get regmap with clk_regmap_init
  clk: amlogic: remove unnecessary headers
  clk: amlogic: axg-audio: use the auxiliary reset driver
  clk: tests: add clk_hw_get_dev() and clk_hw_get_of_node() tests
  clk: tests: Make clk_register_clk_parent_data_device_driver() common
  clk: add a clk_hw helpers to get the clock device or device_node

5 weeks agoe1000e: ignore uninitialized checksum word on tgp
Jacek Kowalski [Mon, 30 Jun 2025 08:35:00 +0000 (10:35 +0200)] 
e1000e: ignore uninitialized checksum word on tgp

As described by Vitaly Lifshits:

> Starting from Tiger Lake, LAN NVM is locked for writes by SW, so the
> driver cannot perform checksum validation and correction. This means
> that all NVM images must leave the factory with correct checksum and
> checksum valid bit set.

Unfortunately some systems have left the factory with an uninitialized
value of 0xFFFF at register address 0x3F (checksum word location).
So on Tiger Lake platform we ignore the computed checksum when such
condition is encountered.

Signed-off-by: Jacek Kowalski <jacek@jacekk.info>
Tested-by: Vlad URSU <vlad@ursu.me>
Fixes: 4051f68318ca9 ("e1000e: Do not take care about recovery NVM checksum")
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
5 weeks agoe1000e: disregard NVM checksum on tgp when valid checksum bit is not set
Jacek Kowalski [Mon, 30 Jun 2025 08:33:39 +0000 (10:33 +0200)] 
e1000e: disregard NVM checksum on tgp when valid checksum bit is not set

As described by Vitaly Lifshits:

> Starting from Tiger Lake, LAN NVM is locked for writes by SW, so the
> driver cannot perform checksum validation and correction. This means
> that all NVM images must leave the factory with correct checksum and
> checksum valid bit set. Since Tiger Lake devices were the first to have
> this lock, some systems in the field did not meet this requirement.
> Therefore, for these transitional devices we skip checksum update and
> verification, if the valid bit is not set.

Signed-off-by: Jacek Kowalski <jacek@jacekk.info>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Fixes: 4051f68318ca9 ("e1000e: Do not take care about recovery NVM checksum")
Cc: stable@vger.kernel.org
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
5 weeks agoice: Fix a null pointer dereference in ice_copy_and_init_pkg()
Haoxiang Li [Thu, 3 Jul 2025 09:52:32 +0000 (17:52 +0800)] 
ice: Fix a null pointer dereference in ice_copy_and_init_pkg()

Add check for the return value of devm_kmemdup()
to prevent potential null pointer dereference.

Fixes: c76488109616 ("ice: Implement Dynamic Device Personalization (DDP) download")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
5 weeks agoi40e: When removing VF MAC filters, only check PF-set MAC
Jamie Bainbridge [Tue, 24 Jun 2025 23:29:18 +0000 (09:29 +1000)] 
i40e: When removing VF MAC filters, only check PF-set MAC

When the PF is processing an Admin Queue message to delete a VF's MACs
from the MAC filter, we currently check if the PF set the MAC and if
the VF is trusted.

This results in undesirable behaviour, where if a trusted VF with a
PF-set MAC sets itself down (which sends an AQ message to delete the
VF's MAC filters) then the VF MAC is erased from the interface.

This results in the VF losing its PF-set MAC which should not happen.

There is no need to check for trust at all, because an untrusted VF
cannot change its own MAC. The only check needed is whether the PF set
the MAC. If the PF set the MAC, then don't erase the MAC on link-down.

Resolve this by changing the deletion check only for PF-set MAC.

(the out-of-tree driver has also intentionally removed the check for VF
trust here with OOT driver version 2.26.8, this changes the Linux kernel
driver behaviour and comment to match the OOT driver behaviour)

Fixes: ea2a1cfc3b201 ("i40e: Fix VF MAC filter removal")
Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
5 weeks agoi40e: report VF tx_dropped with tx_errors instead of tx_discards
Dennis Chen [Wed, 18 Jun 2025 19:52:40 +0000 (15:52 -0400)] 
i40e: report VF tx_dropped with tx_errors instead of tx_discards

Currently the tx_dropped field in VF stats is not updated correctly
when reading stats from the PF. This is because it reads from
i40e_eth_stats.tx_discards which seems to be unused for per VSI stats,
as it is not updated by i40e_update_eth_stats() and the corresponding
register, GLV_TDPC, is not implemented[1].

Use i40e_eth_stats.tx_errors instead, which is actually updated by
i40e_update_eth_stats() by reading from GLV_TEPC.

To test, create a VF and try to send bad packets through it:

$ echo 1 > /sys/class/net/enp2s0f0/device/sriov_numvfs
$ cat test.py
from scapy.all import *

vlan_pkt = Ether(dst="ff:ff:ff:ff:ff:ff") / Dot1Q(vlan=999) / IP(dst="192.168.0.1") / ICMP()
ttl_pkt = IP(dst="8.8.8.8", ttl=0) / ICMP()

print("Send packet with bad VLAN tag")
sendp(vlan_pkt, iface="enp2s0f0v0")
print("Send packet with TTL=0")
sendp(ttl_pkt, iface="enp2s0f0v0")
$ ip -s link show dev enp2s0f0
16: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 3c:ec:ef:b7:e0:ac brd ff:ff:ff:ff:ff:ff
    RX:  bytes packets errors dropped  missed   mcast
             0       0      0       0       0       0
    TX:  bytes packets errors dropped carrier collsns
             0       0      0       0       0       0
    vf 0     link/ether e2:c6:fd:c1:1e:92 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
    RX: bytes  packets  mcast   bcast   dropped
             0        0       0       0        0
    TX: bytes  packets   dropped
             0        0        0
$ python test.py
Send packet with bad VLAN tag
.
Sent 1 packets.
Send packet with TTL=0
.
Sent 1 packets.
$ ip -s link show dev enp2s0f0
16: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 3c:ec:ef:b7:e0:ac brd ff:ff:ff:ff:ff:ff
    RX:  bytes packets errors dropped  missed   mcast
             0       0      0       0       0       0
    TX:  bytes packets errors dropped carrier collsns
             0       0      0       0       0       0
    vf 0     link/ether e2:c6:fd:c1:1e:92 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
    RX: bytes  packets  mcast   bcast   dropped
             0        0       0       0        0
    TX: bytes  packets   dropped
             0        0        0

A packet with non-existent VLAN tag and a packet with TTL = 0 are sent,
but tx_dropped is not incremented.

After patch:

$ ip -s link show dev enp2s0f0
19: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 3c:ec:ef:b7:e0:ac brd ff:ff:ff:ff:ff:ff
    RX:  bytes packets errors dropped  missed   mcast
             0       0      0       0       0       0
    TX:  bytes packets errors dropped carrier collsns
             0       0      0       0       0       0
    vf 0     link/ether 4a:b7:3d:37:f7:56 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
    RX: bytes  packets  mcast   bcast   dropped
             0        0       0       0        0
    TX: bytes  packets   dropped
             0        0        2

Fixes: dc645daef9af5bcbd9c ("i40e: implement VF stats NDO")
Signed-off-by: Dennis Chen <dechen@redhat.com>
Link: https://www.intel.com/content/www/us/en/content-details/596333/intel-ethernet-controller-x710-tm4-at2-carlsville-datasheet.html
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
5 weeks agoMerge tag 'sunxi-clk-for-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Mon, 21 Jul 2025 17:26:31 +0000 (10:26 -0700)] 
Merge tag 'sunxi-clk-for-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner

Pull Allwinner clk driver updates from Chen-Yu Tsai:

 - Add Allwinner A523's missing PPU0 reset (both DT binding and
   driver) The binding change is shared with the soc tree.
 - Fix Allwinner V3s DE clock mux field width
 - Stop passing rate change requests to parent for Allwinner V3s
   DE clock
 - Force and lock Allwinner V3s DE and TCON clocks to the same
   parent, the video PLL

* tag 'sunxi-clk-for-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: ccu_nm: convert from round_rate() to determine_rate()
  clk: sunxi-ng: ccu_nkmp: convert from round_rate() to determine_rate()
  clk: sunxi-ng: ccu_nk: convert from round_rate() to determine_rate()
  clk: sunxi-ng: ccu_gate: convert from round_rate() to determine_rate()
  clk: sunxi-ng: v3s: Assign the de and tcon clocks to the video pll
  clk: sunxi-ng: v3s: Fix de clock definition
  clk: sunxi-ng: sun55i-a523-r-ccu: Add missing PPU0 reset
  dt-bindings: reset: sun55i-a523-r-ccu: Add missing PPU0 reset

5 weeks agoarm64: kvm, smccc: Fix vendor uuid
Jack Thomson [Mon, 21 Jul 2025 13:05:58 +0000 (14:05 +0100)] 
arm64: kvm, smccc: Fix vendor uuid

Commit 13423063c7cb ("arm64: kvm, smccc: Introduce and use API for
getting hypervisor UUID") replaced the explicit register constants
with the UUID_INIT macro. However, there is an endian issue, meaning
the UUID generated and used in the handshake didn't match UUID prior to
the commit.

The change in UUID causes the SMCCC vendor handshake to fail with older
guest kernels, meaning devices such as PTP were not available in the
guest.

This patch updates the parameters to the macro to generate a UUID which
matches the previous value, and re-establish backwards compatibility
with older guest kernels.

Fixes: 13423063c7cb ("arm64: kvm, smccc: Introduce and use API for getting hypervisor UUID")
Signed-off-by: Jack Thomson <jackabt@amazon.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20250721130558.50823-1-jackabt.amazon@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
5 weeks agoMerge tag 'sunxi-clk-fixes-for-6.16' of https://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Mon, 21 Jul 2025 17:17:51 +0000 (10:17 -0700)] 
Merge tag 'sunxi-clk-fixes-for-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-fixes

Pull Allwinner clock fixes from Chen-Yu Tsai:

 - Mark A523 MBUS clock as critical
 - Fix names of CSI related clocks on V3s
   This includes changes to the driver, DT bindings and DT files.
 - Fix parents of TCON clock on V3s

* tag 'sunxi-clk-fixes-for-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: v3s: Fix TCON clock parents
  clk: sunxi-ng: v3s: Fix CSI1 MCLK clock name
  clk: sunxi-ng: v3s: Fix CSI SCLK clock name
  clk: sunxi-ng: a523: Mark MBUS clock as critical

5 weeks agodt-bindings: interconnect: document the RPMh Network-On-Chip Interconnect in Qualcomm...
Luca Weiss [Wed, 9 Jul 2025 13:14:49 +0000 (15:14 +0200)] 
dt-bindings: interconnect: document the RPMh Network-On-Chip Interconnect in Qualcomm Milos SoC

Document the RPMh Network-On-Chip Interconnect of the Milos (e.g.
SM7635) SoC.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20250709-sm7635-icc-v3-1-c446203c3b3a@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
5 weeks agoKVM: arm64: Make RAS registers UNDEF when RAS isn't advertised
Marc Zyngier [Mon, 21 Jul 2025 10:19:51 +0000 (11:19 +0100)] 
KVM: arm64: Make RAS registers UNDEF when RAS isn't advertised

We currently always expose FEAT_RAS when available on the host.

As we are about to make this feature selectable from userspace,
check for it being present before emulating register accesses
as RAZ/WI, and inject an UNDEF otherwise.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250721101955.535159-4-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
5 weeks agoKVM: arm64: Filter out HCR_EL2 bits when running in hypervisor context
Marc Zyngier [Mon, 21 Jul 2025 10:19:50 +0000 (11:19 +0100)] 
KVM: arm64: Filter out HCR_EL2 bits when running in hypervisor context

Most HCR_EL2 bits are not supposed to affect EL2 at all, but only
the guest. However, we gladly merge these bits with the host's
HCR_EL2 configuration, irrespective of entering L1 or L2.

This leads to some funky behaviour, such as L1 trying to inject
a virtual SError for L2, and getting a taste of its own medecine.
Not quite what the architecture anticipated.

In the end, the only bits that matter are those we have defined as
invariants, either because we've made them RESx (E2H, HCD...), or
that we actively refuse to merge because the mess with KVM's own
logic.

Use the sanitisation infrastructure to get the RES1 bits, and let
things rip in a safer way.

Fixes: 04ab519bb86df ("KVM: arm64: nv: Configure HCR_EL2 for FEAT_NV2")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250721101955.535159-3-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
5 weeks agoKVM: arm64: Check for SYSREGS_ON_CPU before accessing the CPU state
Marc Zyngier [Sun, 20 Jul 2025 10:22:29 +0000 (11:22 +0100)] 
KVM: arm64: Check for SYSREGS_ON_CPU before accessing the CPU state

Mark Brown reports that since we commit to making exceptions
visible without the vcpu being loaded, the external abort selftest
fails.

Upon investigation, it turns out that the code that makes registers
affected by an exception visible to the guest is completely broken
on VHE, as we don't check whether the system registers are loaded
on the CPU at this point. We managed to get away with this so far,
but that's obviously as bad as it gets,

Add the required checksm and document the absolute need to check
for the SYSREGS_ON_CPU flag before calling into any of the
__vcpu_write_sys_reg_to_cpu()__vcpu_read_sys_reg_from_cpu() helpers.

Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/18535df8-e647-4643-af9a-bb780af03a70@sirena.org.uk
Link: https://lore.kernel.org/r/20250720102229.179114-1-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
5 weeks agoMerge tag 'tegra-for-6.17-soc' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 21 Jul 2025 16:18:07 +0000 (18:18 +0200)] 
Merge tag 'tegra-for-6.17-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

soc/tegra: Updates for v6.17-rc1

The bulk of this is the addition of Tegra264 support for various low-
level components. This also adds fabric descriptors for the new Tegra254
and Tegra264 chips.

* tag 'tegra-for-6.17-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  soc/tegra: cbb: Add support for CBB fabrics in Tegra254
  soc/tegra: cbb: Add support for CBB fabrics in Tegra264
  soc/tegra: cbb: Support HW lookup to get timed out target address
  soc/tegra: cbb: Improve handling for per SoC fabric data
  soc/tegra: cbb: Make error interrupt enable and status per SoC
  soc/tegra: cbb: Change master/slave to initiator/target
  soc/tegra: cbb: Clear ERR_FORCE register with ERR_STATUS
  soc/tegra: Add Tegra264 APBMISC compatible string
  soc/tegra: pmc: Add Tegra264 support
  soc/tegra: Enable support for Tegra264

Link: https://lore.kernel.org/r/20250711220943.2389322-1-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agosoc: fsl: qe: convert set_multiple() to returning an integer
Bartosz Golaszewski [Mon, 21 Jul 2025 13:15:11 +0000 (15:15 +0200)] 
soc: fsl: qe: convert set_multiple() to returning an integer

The conversion to using the new GPIO line setter callbacks missed the
set_multiple() in this file. Convert it to using the new callback.

Fixes: 52ccf19527fd ("soc: fsl: qe: use new GPIO line value setter callbacks")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agopinctrl: rp1: use new GPIO line value setter callbacks
Bartosz Golaszewski [Sat, 19 Jul 2025 15:58:25 +0000 (17:58 +0200)] 
pinctrl: rp1: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrea della Porta <andrea.porta@suse.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agousb: core: add urb->sgt parameter description
Xu Yang [Mon, 21 Jul 2025 10:44:17 +0000 (18:44 +0800)] 
usb: core: add urb->sgt parameter description

The parameter description of urb->sgt is lost, this will add it for
completeness.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20250711182803.1d548467@canb.auug.org.au/
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Fixes: 488e6eaab88c ("usb: core: add dma-noncoherent buffer alloc and free API")
Link: https://lore.kernel.org/r/20250721104417.3442530-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 weeks agodt-bindings: serial: 8250: spacemit: set clocks property as required
Yixun Lan [Fri, 18 Jul 2025 15:04:37 +0000 (23:04 +0800)] 
dt-bindings: serial: 8250: spacemit: set clocks property as required

In SpacemiT's K1 SoC, the clocks for UART are mandatory needed, so
for DT, both clocks and clock-names property should be set as required.

Fixes: 2c0594f9f062 ("dt-bindings: serial: 8250: support an optional second clock")
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
Link: https://lore.kernel.org/r/20250718-01-k1-uart-binding-v1-1-a92e1e14c836@gentoo.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 weeks agodt-bindings: serial: renesas: Document RZ/V2N SCIF
Lad Prabhakar [Wed, 16 Jul 2025 20:29:23 +0000 (21:29 +0100)] 
dt-bindings: serial: renesas: Document RZ/V2N SCIF

Document SCIF bindings for the Renesas RZ/V2N (a.k.a R9A09G056) SoC.
The SCIF interface in Renesas RZ/V2N is identical to the one available
in RZ/V2H(P), so `renesas,scif-r9a09g057` will be used as a fallback,
allowing reuse of the existing driver without modifications.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20250716202923.163950-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 weeks agoserial: 8250_ce4100: Fix CONFIG_SERIAL_8250=n build
Andy Shevchenko [Wed, 16 Jul 2025 14:23:29 +0000 (17:23 +0300)] 
serial: 8250_ce4100: Fix CONFIG_SERIAL_8250=n build

On i386, when

  CONFIG_X86_INTEL_CE=y
  # CONFIG_SERIAL_8250 is not set

it will try to compile the driver and use the stub simultaneously.
This breaks the build. Fix it by making sure that the driver
compiles only when CONFIG_SERIAL_8250 is also enabled.

On top of that ensure that CONFIG_SERIAL_8250 is actually set to 'y'
and not 'm' as the later makes no sense for this platform. The hook
may only be applied during early boot.

Fixes: acc902de05b2 ("serial: 8250: Move CE4100 quirks to a module under 8250 driver")
Fixes: 5ec6960f6f0c ("ce4100: Add errata fixes for UART on CE4100")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/r/cdf4ee46-7bf8-4379-9245-fed9db72e7e8@infradead.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20250716142412.1667927-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 weeks agoMerge tag 'samsung-defconfig-6.17' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 21 Jul 2025 15:36:27 +0000 (17:36 +0200)] 
Merge tag 'samsung-defconfig-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/defconfig

Samsung SoC defconfig changes for v6.17

1. Multiple SoCs (including Samsung, Apple): switch sound to module from
   a built-in, because it is not necessary for booting.  Also drop
   redundant sound codec options.

2. Enable PMIC drivers for Google GS101 Pixel 6 phones: MAX77759 and
   Samsung PMIC over ACPM protocol.

* tag 'samsung-defconfig-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  arm64: defconfig: enable Samsung PMIC over ACPM
  arm64: defconfig: enable Maxim max77759 driver
  arm64: defconfig: Drop unneeded unselectable sound drivers
  arm64: defconfig: Switch SOUND to module

Link: https://lore.kernel.org/r/20250709191523.171359-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agoMerge tag 'platform-drivers-x86-v6.16-4' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 21 Jul 2025 15:32:36 +0000 (08:32 -0700)] 
Merge tag 'platform-drivers-x86-v6.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform drivers fixes from Ilpo Järvinen:

 - power supply code:
    - Add get/set property direct to allow avoiding taking
      psy->extensions_sem twice from power supply extensions

 - alienware-wmi-wmax:
    - Add AWCC support for Alienware Area-51m and m15 R5
    - Fix `dmi_system_id` array termination

 - arm64: huawei-gaokun-ec: fix OF node leak

 - dell-ddv: Fix taking psy->extensions_sem twice

 - dell-lis3lv02d: Add Precision 3551 accelerometer support

 - firmware_attributes_class: Fix initialization order

 - ideapad-laptop: Retain FnLock and kbd backlight across boots

 - lenovo-wmi-hotkey: Avoid triggering error -5 due to missing mute LED

 - mellanox: mlxbf-pmc: Validate event names and bool input

* tag 'platform-drivers-x86-v6.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  MAINTAINERS: Update entries for IFS and SBL drivers
  platform/x86: dell-lis3lv02d: Add Precision 3551
  platform/x86: alieneware-wmi-wmax: Add AWCC support to more laptops
  platform/x86: Fix initialization order for firmware_attributes_class
  platform: arm64: huawei-gaokun-ec: fix OF node leak
  lenovo-wmi-hotkey: Avoid triggering error -5 due to missing mute LED
  platform/x86: ideapad-laptop: Fix kbd backlight not remembered among boots
  platform/x86: ideapad-laptop: Fix FnLock not remembered among boots
  platform/mellanox: mlxbf-pmc: Use kstrtobool() to check 0/1 input
  platform/mellanox: mlxbf-pmc: Validate event/enable input
  platform/mellanox: mlxbf-pmc: Remove newline char from event name input
  platform/x86: dell-ddv: Fix taking the psy->extensions_sem lock twice
  power: supply: test-power: Test access to extended power supply
  power: supply: core: Add power_supply_get/set_property_direct()
  platform/x86: alienware-wmi-wmax: Fix `dmi_system_id` array

5 weeks agoarm64: dts: apple: Add Apple SoC GPU
Sasha Finkelstein [Wed, 9 Jul 2025 22:21:45 +0000 (00:21 +0200)] 
arm64: dts: apple: Add Apple SoC GPU

Add device tree entries for GPUs in M-series SoCs

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Sven Peter <sven@kernel.org>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Link: https://lore.kernel.org/r/20250710-sgx-dt-v3-2-299bb3a65109@gmail.com
Signed-off-by: Sven Peter <sven@kernel.org>
5 weeks agodt-bindings: gpu: Add Apple SoC GPU
Sasha Finkelstein [Wed, 9 Jul 2025 22:21:44 +0000 (00:21 +0200)] 
dt-bindings: gpu: Add Apple SoC GPU

Add bindings for the GPU present in Apple SoCs

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Sven Peter <sven@kernel.org>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Link: https://lore.kernel.org/r/20250710-sgx-dt-v3-1-299bb3a65109@gmail.com
Signed-off-by: Sven Peter <sven@kernel.org>
5 weeks agoarm64: dts: apple: t8012-j132: Include touchbar framebuffer node
Nick Chan [Fri, 20 Jun 2025 10:35:36 +0000 (18:35 +0800)] 
arm64: dts: apple: t8012-j132: Include touchbar framebuffer node

Apple T2 MacBookPro15,2 (j132) has a touchbar so include the framebuffer
node.

Cc: stable@vger.kernel.org
Fixes: 4efbcb623e9bc ("arm64: dts: apple: Add T2 devices")
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
Link: https://lore.kernel.org/stable/20250620-j132-fb-v1-1-bc6937baf0b9%40gmail.com
Link: https://lore.kernel.org/r/20250620-j132-fb-v2-1-65f100182085@gmail.com
Signed-off-by: Sven Peter <sven@kernel.org>
5 weeks agoarm64: dts: apple: Add bit offset to PMIC NVMEM node names
Sven Peter [Tue, 10 Jun 2025 17:17:35 +0000 (17:17 +0000)] 
arm64: dts: apple: Add bit offset to PMIC NVMEM node names

Now that the dt-binding has been extended to allow indicating the bit
position the following warning about a duplicate unit address with W=1
can be fixed:

arch/arm64/boot/dts/apple/t8103.dtsi:764.46-767.8: Warning (unique_unit_address_if_enabled): /soc/spmi@23d0d9300/pmic@f/nvmem-layout/boot-error-count@9f02: duplicate unit-address (also used in node /soc/spmi@23d0d9300/pmic@f/nvmem-layout/panic-count@9f02)

Fixes: d8bf82081c9e ("arm64: dts: apple: Add PMIC NVMEM")
Link: https://lore.kernel.org/r/20250610-nvmem-bit-pattern-v1-2-55ed5c1b369c@kernel.org
Signed-off-by: Sven Peter <sven@kernel.org>
5 weeks agoMerge branch 'newsoc/cix-p1' into soc/newsoc
Arnd Bergmann [Mon, 21 Jul 2025 15:15:45 +0000 (17:15 +0200)] 
Merge branch 'newsoc/cix-p1' into soc/newsoc

Patches from Peter Chen <peter.chen@cixtech.com>:

Cixtech P1 (internal name sky1) is high performance generic Armv9 SoC.
Orion O6 is the Arm V9 Motherboard built by Radxa. You could find brief
introduction for SoC and related boards at:
https://radxa.com/products/orion/o6#overview

Currently, to run upstream kernel at Orion O6 board, you need to
use BIOS released by Radxa, and add "clk_ignore_unused=1" at bootargs.
https://docs.radxa.com/en/orion/o6/bios/install-bios

In this series, we add initial SoC and board support for Kernel building.
Since mailbox is used for SCMI clock communication, mailbox driver is added
in this series for the minimum SoC support.

Patch 1-2: add dt-binding doc for CIX and its sky1 SoC
Patch 3: add Arm64 build support
Patch 4-5: add CIX mailbox driver which needs to support SCMI clock protocol.
Patch 6: add Arm64 defconfig support
Patch 7-8: add initial dts support for SoC and Orion O6 board
Patch 9: add MAINTAINERS entry

* newsoc/cix-p1:
  MAINTAINERS: Add CIX SoC maintainer entry
  arm64: dts: cix: Add sky1 base dts initial support
  dt-bindings: clock: cix: Add CIX sky1 scmi clock id
  arm64: defconfig: Enable CIX SoC
  mailbox: add CIX mailbox driver
  dt-bindings: mailbox: add cix,sky1-mbox
  arm64: Kconfig: add ARCH_CIX for cix silicons
  dt-bindings: arm: add CIX P1 (SKY1) SoC
  dt-bindings: vendor-prefixes: Add CIX Technology Group Co., Ltd.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agoMAINTAINERS: Add CIX SoC maintainer entry
Peter Chen [Mon, 21 Jul 2025 14:45:00 +0000 (22:45 +0800)] 
MAINTAINERS: Add CIX SoC maintainer entry

Using this entry as the maintainers information for CIX SoCs.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Fugang Duan <fugang.duan@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agoarm64: dts: cix: Add sky1 base dts initial support
Peter Chen [Mon, 21 Jul 2025 14:44:59 +0000 (22:44 +0800)] 
arm64: dts: cix: Add sky1 base dts initial support

CIX SKY1 SoC is high performance Armv9 SoC designed by Cixtech,
and Orion O6 is the motherboard launched by Radxa. See below for
detail:
https://docs.radxa.com/en/orion/o6/getting-started/introduction

In this commit, it only adds limited components for running initramfs
at Orion O6.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Enric Balletbo i Serra <eballetb@redhat.com>
Tested-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Guomin Chen <Guomin.Chen@cixtech.com>
Signed-off-by: Gary Yang <gary.yang@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agodt-bindings: clock: cix: Add CIX sky1 scmi clock id
Gary Yang [Mon, 21 Jul 2025 14:44:58 +0000 (22:44 +0800)] 
dt-bindings: clock: cix: Add CIX sky1 scmi clock id

Add device tree bindings for the scmi clock id on
Cix sky1 platform.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Gary Yang <gary.yang@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agoarm64: defconfig: Enable CIX SoC
Peter Chen [Mon, 21 Jul 2025 14:44:57 +0000 (22:44 +0800)] 
arm64: defconfig: Enable CIX SoC

- Enable CIX SoC support at ARM64 defconfig
- Enable CIX mailbox
At CIX SoC platforms, the clock handling uses Arm SCMI protocol,
the physical clock access is at sub processor, so it needs to enable
mailbox by default.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agomailbox: add CIX mailbox driver
Guomin Chen [Mon, 21 Jul 2025 14:44:56 +0000 (22:44 +0800)] 
mailbox: add CIX mailbox driver

The CIX mailbox controller, used in the Cix SoCs, like sky1.
facilitates message transmission between multiple processors
within the SoC, such as the AP, PM, audio DSP, SensorHub MCU,
and others.

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Reviewed-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Guomin Chen <Guomin.Chen@cixtech.com>
Signed-off-by: Gary Yang <gary.yang@cixtech.com>
Signed-off-by: Lihua Liu <Lihua.Liu@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agodt-bindings: mailbox: add cix,sky1-mbox
Guomin Chen [Mon, 21 Jul 2025 14:44:55 +0000 (22:44 +0800)] 
dt-bindings: mailbox: add cix,sky1-mbox

Add a dt-binding for the Cixtech Mailbox Controller.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Guomin Chen <Guomin.Chen@cixtech.com>
Signed-off-by: Lihua Liu <Lihua.Liu@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agoarm64: Kconfig: add ARCH_CIX for cix silicons
Fugang Duan [Mon, 21 Jul 2025 14:44:54 +0000 (22:44 +0800)] 
arm64: Kconfig: add ARCH_CIX for cix silicons

Add ARCH_CIX for CIX SoC series support.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Fugang Duan <fugang.duan@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agodt-bindings: arm: add CIX P1 (SKY1) SoC
Peter Chen [Mon, 21 Jul 2025 14:44:53 +0000 (22:44 +0800)] 
dt-bindings: arm: add CIX P1 (SKY1) SoC

Add device tree bindings for CIX P1 (Internal name sky1) Arm SoC,
it consists several SoC models like CP8180, CD8180, etc.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Fugang Duan <fugang.duan@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agodt-bindings: vendor-prefixes: Add CIX Technology Group Co., Ltd.
Peter Chen [Mon, 21 Jul 2025 14:44:52 +0000 (22:44 +0800)] 
dt-bindings: vendor-prefixes: Add CIX Technology Group Co., Ltd.

CIX Technology Group Co., Ltd. is a high performance Arm SoC design
Link: https://www.cixtech.com/.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Fugang Duan <fugang.duan@cixtech.com>
Signed-off-by: Peter Chen <peter.chen@cixtech.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 weeks agofs: orangefs: replace scnprintf() with sysfs_emit()
Shankari Anand [Tue, 24 Jun 2025 15:25:45 +0000 (20:55 +0530)] 
fs: orangefs: replace scnprintf() with sysfs_emit()

Documentation/filesystems/sysfs.rst mentions that show() should only
use sysfs_emit() or sysfs_emit_at() when formating the value to be
returned to user space. So replace scnprintf() with sysfs_emit().

Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
5 weeks agoMerge branch 'newsoc/andes' into soc/newsoc
Arnd Bergmann [Mon, 21 Jul 2025 15:12:44 +0000 (17:12 +0200)] 
Merge branch 'newsoc/andes' into soc/newsoc

Patches from Ben Zong-You Xie <ben717@andestech.com>:

The Voyager is a 9.6” x 9.6” Micro ATX form factor development board
including Andes QiLai SoC. This patch series adds minimal device tree
files for the QiLai SoC and the Voyager board [1].

Now only support basic uart drivers to boot up into a basic console. Other
features will be added later.

[1] https://www.andestech.com/en/products-solutions/andeshape-platforms/qilai-chip/
[2] https://lore.kernel.org/all/20250602060747.689824-1-ben717@andestech.com/

* newsoc/andes:
  MAINTAINERS: Add entry for Andes SoC
  riscv: defconfig: enable Andes SoC
  riscv: dts: andes: add Voyager board device tree
  riscv: dts: andes: add QiLai SoC device tree
  dt-bindings: timer: add Andes machine timer
  dt-bindings: interrupt-controller: add Andes machine-level software interrupt controller
  dt-bindings: interrupt-controller: add Andes QiLai PLIC
  dt-bindings: riscv: add Andes QiLai SoC and the Voyager board bindings
  riscv: add Andes SoC family Kconfig support

5 weeks agofs/orangefs: use snprintf() instead of sprintf()
Amir Mohammad Jahangirzad [Sun, 8 Jun 2025 16:35:59 +0000 (20:05 +0330)] 
fs/orangefs: use snprintf() instead of sprintf()

sprintf() is discouraged for use with bounded destination buffers
as it does not prevent buffer overflows when the formatted output
exceeds the destination buffer size. snprintf() is a safer
alternative as it limits the number of bytes written and ensures
NUL-termination.

Replace sprintf() with snprintf() for copying the debug string
into a temporary buffer, using ORANGEFS_MAX_DEBUG_STRING_LEN as
the maximum size to ensure safe formatting and prevent memory
corruption in edge cases.

EDIT: After this patch sat on linux-next for a few days, Dan
Carpenter saw it and suggested that I use scnprintf instead of
snprintf. I made the change and retested.

Signed-off-by: Amir Mohammad Jahangirzad <a.jahangirzad@gmail.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>