6.6.15-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 233/331 btrfs: ref-verify: free ref cache before clearing mount opt
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
commit f03e274a8b29d1d1c1bbd7f764766cb5ca537ab7 upstream.
As clearing REF_VERIFY mount option indicates there were some errors in a ref-verify process, a ref cache is not relevant anymore and should be freed.
btrfs_free_ref_cache() requires REF_VERIFY option being set so call it just before clearing the mount option.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- fs/btrfs/ref-verify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/ref-verify.c +4 -2
@@ -886,8 +886,10 @@ int btrfs_ref_tree_mod(struct btrfs_fs_i out_unlock:spin_unlock (&fs_info->ref_verify_lock); out: -if (ret) +if (ret) { +btrfs_free_ref_cache (fs_info);btrfs_clear_opt (fs_info->mount_opt,REF_VERIFY ); + }return ret; }
@@ -1018,8 +1020,8 @@ int btrfs_build_ref_tree(struct btrfs_fs } }if (ret) { -btrfs_clear_opt (fs_info->mount_opt,REF_VERIFY );btrfs_free_ref_cache (fs_info); +btrfs_clear_opt (fs_info->mount_opt,REF_VERIFY ); }btrfs_free_path (path);return ret;
Greg Kroah-Hartman
maintainerPATCH 234/331 btrfs: tree-checker: fix inline ref size in error messages
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chung-Chiang Cheng <[email protected]>
commit f398e70dd69e6ceea71463a5380e6118f219197e upstream.
The error message should accurately reflect the size rather than the type.
--- fs/btrfs/tree-checker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tree-checker.c +1 -1
@@ -1417,7 +1417,7 @@ static int check_extent_item(struct exteif (unlikely (ptr +btrfs_extent_inline_ref_size (inline_type) > end)) {extent_err (leaf, slot,"inline ref item overflows extent item, ptr %lu iref size %u end %lu" , - ptr, inline_type, end); + ptr,btrfs_extent_inline_ref_size (inline_type), end);return -EUCLEAN ; }
Greg Kroah-Hartman
maintainerPATCH 235/331 btrfs: dont warn if discard range is not aligned to sector
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Sterba <[email protected]>
commit a208b3f132b48e1f94f620024e66fea635925877 upstream.
There's a warning in btrfs_issue_discard() when the range is not aligned to 512 bytes, originally added in 4d89d377bbb0 ("btrfs:btrfs_issue_discard ensure offset/length are aligned to sector boundaries"). We can't do sub-sector writes anyway so the adjustment is the only thing that we can do and the warning is unnecessary.
--- fs/btrfs/extent-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/extent-tree.c +2 -1
@@ -1245,7 +1245,8 @@ static int btrfs_issue_discard(struct blu64 bytes_left, end;u64 aligned_start =ALIGN (start,1 <<SECTOR_SHIFT ); -if (WARN_ON (start != aligned_start)) { +/* Adjust the range to be aligned to 512B sectors if necessary. */ +if (start != aligned_start) { len -= aligned_start - start; len =round_down (len,1 <<SECTOR_SHIFT ); start = aligned_start;
Greg Kroah-Hartman
maintainerPATCH 236/331 btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit 173431b274a9a54fc10b273b46e67f46bcf62d2e upstream.
Add extra sanity check for btrfs_ioctl_defrag_range_args::flags.
This is not really to enhance fuzzing tests, but as a preparation for future expansion on btrfs_ioctl_defrag_range_args.
In the future we're going to add new members, allowing more fine tuning for btrfs defrag. Without the -ENONOTSUPP error, there would be no way to detect if the kernel supports those new defrag features.
--- fs/btrfs/ioctl.c | 4 ++++ include/uapi/linux/btrfs.h | 3 +++ 2 files changed, 7 insertions(+)
fs/btrfs/ioctl.c +4 -0
@@ -2608,6 +2608,10 @@ static int btrfs_ioctl_defrag(struct fil ret = -EFAULT ; goto out; } +if (range.flags & ~BTRFS_DEFRAG_RANGE_FLAGS_SUPP ) { + ret = -EOPNOTSUPP ; + goto out; + }/* compression requires us to start the IO */ if ((range.flags &BTRFS_DEFRAG_RANGE_COMPRESS )) { range.flags |=BTRFS_DEFRAG_RANGE_START_IO ;
include/uapi/linux/btrfs.h +3 -0
@@ -612,6 +612,9 @@ struct btrfs_ioctl_clone_range_args {*/ #define BTRFS_DEFRAG_RANGE_COMPRESS 1#define BTRFS_DEFRAG_RANGE_START_IO 2 +#define BTRFS_DEFRAG_RANGE_FLAGS_SUPP (BTRFS_DEFRAG_RANGE_COMPRESS | \ + BTRFS_DEFRAG_RANGE_START_IO) +struct btrfs_ioctl_defrag_range_args {/* start of the defrag operation */ __u64 start;
Greg Kroah-Hartman
maintainerPATCH 237/331 btrfs: dont abort filesystem when attempting to snapshot deleted subvolume
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Sandoval <[email protected]>
commit 7081929ab2572920e94d70be3d332e5c9f97095a upstream.
If the source file descriptor to the snapshot ioctl refers to a deleted subvolume, we get the following abort:
BTRFS: Transaction aborted (error -2)
WARNING: CPU: 0 PID: 833 at fs/btrfs/transaction.c:1875 create_pending_snapshot+0x1040/0x1190 [btrfs] Modules linked in: pata_acpi btrfs ata_piix libata scsi_mod virtio_net blake2b_generic xor net_failover virtio_rng failover scsi_common rng_core raid6_pq libcrc32c CPU: 0 PID: 833 Comm: t_snapshot_dele Not tainted 6.7.0-rc6 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-1.fc39 04/01/2014 RIP: 0010:create_pending_snapshot+0x1040/0x1190 [btrfs] RSP: 0018:ffffa09c01337af8 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff9982053e7c78 RCX: 0000000000000027 RDX: ffff99827dc20848 RSI: 0000000000000001 RDI: ffff99827dc20840 RBP: ffffa09c01337c00 R08: 0000000000000000 R09: ffffa09c01337998 R10: 0000000000000003 R11: ffffffffb96da248 R12: fffffffffffffffe R13: ffff99820535bb28 R14: ffff99820b7bd000 R15: ffff99820381ea80 FS: 00007fe20aadabc0(0000) GS:ffff99827dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000559a120b502f CR3: 00000000055b6000 CR4: 00000000000006f0 Call Trace: <TASK> ? create_pending_snapshot+0x1040/0x1190 [btrfs] ? __warn+0x81/0x130 ? create_pending_snapshot+0x1040/0x1190 [btrfs] ? report_bug+0x171/0x1a0 ? handle_bug+0x3a/0x70 ? exc_invalid_op+0x17/0x70 ? asm_exc_invalid_op+0x1a/0x20 ? create_pending_snapshot+0x1040/0x1190 [btrfs] ? create_pending_snapshot+0x1040/0x1190 [btrfs] create_pending_snapshots+0x92/0xc0 [btrfs] btrfs_commit_transaction+0x66b/0xf40 [btrfs] btrfs_mksubvol+0x301/0x4d0 [btrfs] btrfs_mksnapshot+0x80/0xb0 [btrfs] __btrfs_ioctl_snap_create+0x1c2/0x1d0 [btrfs] btrfs_ioctl_snap_create_v2+0xc4/0x150 [btrfs] btrfs_ioctl+0x8a6/0x2650 [btrfs] ? kmem_cache_free+0x22/0x340 ? do_sys_openat2+0x97/0xe0 __x64_sys_ioctl+0x97/0xd0 do_syscall_64+0x46/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 RIP: 0033:0x7fe20abe83af RSP: 002b:00007ffe6eff1360 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fe20abe83af RDX: 00007ffe6eff23c0 RSI: 0000000050009417 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000000 R09: 00007fe20ad16cd0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe6eff13c0 R14: 00007fe20ad45000 R15: 0000559a120b6d58 </TASK> ---[ end trace 0000000000000000 ]--- BTRFS: error (device vdc: state A) in create_pending_snapshot:1875: errno=-2 No such entry BTRFS info (device vdc: state EA): forced readonly BTRFS warning (device vdc: state EA): Skipping commit of aborted transaction. BTRFS: error (device vdc: state EA) in cleanup_transaction:2055: errno=-2 No such entry
This happens because create_pending_snapshot() initializes the new root item as a copy of the source root item. This includes the refs field, which is 0 for a deleted subvolume. The call to btrfs_insert_root() therefore inserts a root with refs == 0. btrfs_get_new_fs_root() then finds the root and returns -ENOENT if refs == 0, which causes create_pending_snapshot() to abort.
Fix it by checking the source root's refs before attempting the snapshot, but after locking subvol_sem to avoid racing with deletion.
--- fs/btrfs/ioctl.c | 3 +++ 1 file changed, 3 insertions(+)
fs/btrfs/ioctl.c +3 -0
@@ -790,6 +790,9 @@ static int create_snapshot(struct btrfs_return -EOPNOTSUPP ; } +if (btrfs_root_refs (&root->root_item) ==0 ) +return -ENOENT ; +if (!test_bit (BTRFS_ROOT_SHAREABLE , &root->state))return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 238/331 rbd: dont move requests to the running list on errors
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit ded080c86b3f99683774af0441a58fc2e3d60cae upstream.
The running list is supposed to contain requests that are pinning the exclusive lock, i.e. those that must be flushed before exclusive lock is released. When wake_lock_waiters() is called to handle an error, requests on the acquiring list are failed with that error and no flushing takes place. Briefly moving them to the running list is not only pointless but also harmful: if exclusive lock gets acquired before all of their state machines are scheduled and go through rbd_lock_del_request(), we trigger
rbd_assert(list_empty(&rbd_dev->running_list));
in rbd_try_acquire_lock().
--- drivers/block/rbd.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/block/rbd.c +14 -8
@@ -3452,14 +3452,15 @@ static bool rbd_lock_add_request(structstatic void rbd_lock_del_request (struct rbd_img_request *img_req) {struct rbd_device *rbd_dev = img_req->rbd_dev; -bool need_wakeup; +bool need_wakeup = false;lockdep_assert_held (&rbd_dev->lock_rwsem);spin_lock (&rbd_dev->lock_lists_lock); -rbd_assert (!list_empty (&img_req->lock_item)); -list_del_init (&img_req->lock_item); - need_wakeup = (rbd_dev->lock_state ==RBD_LOCK_STATE_RELEASING && -list_empty (&rbd_dev->running_list)); +if (!list_empty (&img_req->lock_item)) { +list_del_init (&img_req->lock_item); + need_wakeup = (rbd_dev->lock_state ==RBD_LOCK_STATE_RELEASING && +list_empty (&rbd_dev->running_list)); + }spin_unlock (&rbd_dev->lock_lists_lock);if (need_wakeup)complete (&rbd_dev->releasing_wait);
@@ -3842,14 +3843,19 @@ static void wake_lock_waiters(struct rbdreturn ; } -list_for_each_entry (img_req, &rbd_dev->acquiring_list, lock_item) { +while (!list_empty (&rbd_dev->acquiring_list)) { + img_req =list_first_entry (&rbd_dev->acquiring_list, + struct rbd_img_request, lock_item);mutex_lock (&img_req->state_mutex);rbd_assert (img_req->state ==RBD_IMG_EXCLUSIVE_LOCK ); +if (!result) +list_move_tail (&img_req->lock_item, + &rbd_dev->running_list); +else +list_del_init (&img_req->lock_item);rbd_img_schedule (img_req, result);mutex_unlock (&img_req->state_mutex); } - -list_splice_tail_init (&rbd_dev->acquiring_list, &rbd_dev->running_list); } static bool locker_equal(const struct ceph_locker *lhs,
Greg Kroah-Hartman
maintainerPATCH 239/331 exec: Fix error handling in begin_new_exec()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernd Edlinger <[email protected]>
commit 84c39ec57d409e803a9bb6e4e85daf1243e0e80b upstream.
If get_unused_fd_flags() fails, the error handling is incomplete because bprm->cred is already set to NULL, and therefore free_bprm will not unlock the cred_guard_mutex. Note there are two error conditions which end up here, one before and one after bprm->cred is cleared.
--- fs/exec.c | 3 +++ 1 file changed, 3 insertions(+)
fs/exec.c +3 -0
@@ -1410,6 +1410,9 @@ int begin_new_exec(struct linux_binprm * out_unlock:up_write (&me->signal->exec_update_lock); +if (!bprm->cred) +mutex_unlock (&me->signal->cred_guard_mutex); + out:return retval; }
Greg Kroah-Hartman
maintainerPATCH 240/331 wifi: iwlwifi: fix a memory corruption
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit cf4a0d840ecc72fcf16198d5e9c505ab7d5a5e4d upstream.
iwl_fw_ini_trigger_tlv::data is a pointer to a __le32, which means that if we copy to iwl_fw_ini_trigger_tlv::data + offset while offset is in bytes, we'll write past the buffer.
--- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +2 -2
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2018-2023 Intel Corporation +* Copyright (C) 2018-2024 Intel Corporation */ #include <linux/firmware.h> #include "iwl-drv.h"
@@ -1094,7 +1094,7 @@ static int iwl_dbg_tlv_override_trig_nod node_trig = (void *)node_tlv->data; } -memcpy (node_trig->data + offset, trig->data, trig_data_len); +memcpy ((u8 *)node_trig->data + offset, trig->data, trig_data_len); node_tlv->length =cpu_to_le32 (size);if (policy &IWL_FW_INI_APPLY_POLICY_OVERRIDE_CFG ) {
Greg Kroah-Hartman
maintainerPATCH 241/331 nfsd: fix RELEASE_LOCKOWNER
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit edcf9725150e42beeca42d085149f4c88fa97afd upstream.
The test on so_count in nfsd4_release_lockowner() is nonsense and harmful. Revert to using check_for_locks(), changing that to not sleep.
First: harmful.
As is documented in the kdoc comment for nfsd4_release_lockowner(), the test on so_count can transiently return a false positive resulting in a return of NFS4ERR_LOCKS_HELD when in fact no locks are held. This is clearly a protocol violation and with the Linux NFS client it can cause incorrect behaviour.
If RELEASE_LOCKOWNER is sent while some other thread is still processing a LOCK request which failed because, at the time that request was received, the given owner held a conflicting lock, then the nfsd thread processing that LOCK request can hold a reference (conflock) to the lock owner that causes nfsd4_release_lockowner() to return an incorrect error.
The Linux NFS client ignores that NFS4ERR_LOCKS_HELD error because it never sends NFS4_RELEASE_LOCKOWNER without first releasing any locks, so it knows that the error is impossible. It assumes the lock owner was in fact released so it feels free to use the same lock owner identifier in some later locking request.
When it does reuse a lock owner identifier for which a previous RELEASE failed, it will naturally use a lock_seqid of zero. However the server, which didn't release the lock owner, will expect a larger lock_seqid and so will respond with NFS4ERR_BAD_SEQID.
So clearly it is harmful to allow a false positive, which testing so_count allows.
The test is nonsense because ... well... it doesn't mean anything.
so_count is the sum of three different counts.
1/ the set of states listed on so_stateids
2/ the set of active vfs locks owned by any of those states 3/ various transient counts such as for conflicting locks.
When it is tested against '2' it is clear that one of these is the transient reference obtained by find_lockowner_str_locked(). It is not clear what the other one is expected to be.
In practice, the count is often 2 because there is precisely one state on so_stateids. If there were more, this would fail.
In my testing I see two circumstances when RELEASE_LOCKOWNER is called. In one case, CLOSE is called before RELEASE_LOCKOWNER. That results in all the lock states being removed, and so the lockowner being discarded (it is removed when there are no more references which usually happens when the lock state is discarded). When nfsd4_release_lockowner() finds that the lock owner doesn't exist, it returns success.
The other case shows an so_count of '2' and precisely one state listed in so_stateid. It appears that the Linux client uses a separate lock owner for each file resulting in one lock state per lock owner, so this test on '2' is safe. For another client it might not be safe.
So this patch changes check_for_locks() to use the (newish) find_any_file_locked() so that it doesn't take a reference on the nfs4_file and so never calls nfsd_file_put(), and so never sleeps. With this check is it safe to restore the use of check_for_locks() rather than testing so_count against the mysterious '2'.
--- fs/nfsd/nfs4state.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
fs/nfsd/nfs4state.c +15 -11
@@ -7890,14 +7890,16 @@ check_for_locks(struct nfs4_file *fp, st {struct file_lock *fl;int status = false; -struct nfsd_file *nf =find_any_file (fp); +struct nfsd_file *nf;struct inode *inode;struct file_lock_context *flctx; +spin_lock (&fp->fi_lock); + nf =find_any_file_locked (fp);if (!nf) {/* Any valid lock stateid should have some sort of access */ WARN_ON_ONCE (1 ); -return status; + goto out; } inode =file_inode (nf->nf_file);
@@ -7913,7 +7915,8 @@ check_for_locks(struct nfs4_file *fp, st }spin_unlock (&flctx->flc_lock); } -nfsd_file_put (nf); +out: +spin_unlock (&fp->fi_lock);return status; }
@@ -7923,10 +7926,8 @@ check_for_locks(struct nfs4_file *fp, st* @cstate: NFSv4 COMPOUND state * @u: RELEASE_LOCKOWNER arguments * -* The lockowner's so_count is bumped when a lock record is added -* or when copying a conflicting lock. The latter case is brief, -* but can lead to fleeting false positives when looking for -* locks-in-use. +* Check if theree are any locks still held and if not - free the lockowner +* and any lock state that is owned. * * Return values: * %nfs_ok: lockowner released or not found
@@ -7962,10 +7963,13 @@ nfsd4_release_lockowner(struct svc_rqstspin_unlock (&clp->cl_lock);return nfs_ok; } -if (atomic_read (&lo->lo_owner.so_count) !=2 ) { -spin_unlock (&clp->cl_lock); -nfs4_put_stateowner (&lo->lo_owner); -return nfserr_locks_held; + +list_for_each_entry (stp, &lo->lo_owner.so_stateids, st_perstateowner) { +if (check_for_locks (stp->st_stid.sc_file, lo)) { +spin_unlock (&clp->cl_lock); +nfs4_put_stateowner (&lo->lo_owner); +return nfserr_locks_held; + } }unhash_lockowner_locked (lo);while (!list_empty (&lo->lo_owner.so_stateids)) {
Greg Kroah-Hartman
maintainerPATCH 242/331 hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <[email protected]>
commit 6941f67ad37d5465b75b9ffc498fcf6897a3c00e upstream.
Current code in netvsc_drv_init() incorrectly assumes that PAGE_SIZE is 4 Kbytes, which is wrong on ARM64 with 16K or 64K page size. As a result, the default VMBus ring buffer size on ARM64 with 64K page size is 8 Mbytes instead of the expected 512 Kbytes. While this doesn't break anything, a typical VM with 8 vCPUs and 8 netvsc channels wastes 120 Mbytes (8 channels * 2 ring buffers/channel * 7.5 Mbytes/ring buffer).
Unfortunately, the module parameter specifying the ring buffer size is in units of 4 Kbyte pages. Ideally, it should be in units that are independent of PAGE_SIZE, but backwards compatibility prevents changing that now.
Fix this by having netvsc_drv_init() hardcode 4096 instead of using PAGE_SIZE when calculating the ring buffer size in bytes. Also use the VMBUS_RING_SIZE macro to ensure proper alignment when running with page size larger than 4K.
--- drivers/net/hyperv/netvsc_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/hyperv/netvsc_drv.c +2 -2
@@ -44,7 +44,7 @@static unsigned int ring_size__ro_after_init =128 ;module_param (ring_size, uint,0444 ); -MODULE_PARM_DESC (ring_size,"Ring buffer size (# of pages)" ); +MODULE_PARM_DESC (ring_size,"Ring buffer size (# of 4K pages)" );unsigned int netvsc_ring_bytes__ro_after_init ; static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
@@ -2805,7 +2805,7 @@ static int __init netvsc_drv_init(void)pr_info ("Increased ring_size to %u (min allowed)\n" , ring_size); } - netvsc_ring_bytes = ring_size *PAGE_SIZE ; + netvsc_ring_bytes =VMBUS_RING_SIZE (ring_size *4096 );register_netdevice_notifier (&netvsc_netdev_notifier);
Greg Kroah-Hartman
maintainerPATCH 243/331 netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit 01acb2e8666a6529697141a6017edbf206921913 upstream.
Remove netdevice from inet/ingress basechain in case NETDEV_UNREGISTER event is reported, otherwise a stale reference to netdevice remains in the hook list.
--- net/netfilter/nft_chain_filter.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
net/netfilter/nft_chain_filter.c +9 -2
@@ -357,9 +357,10 @@ static int nf_tables_netdev_event(struct unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); +struct nft_base_chain *basechain;struct nftables_pernet *nft_net; -struct nft_table *table;struct nft_chain *chain, *nr; +struct nft_table *table;struct nft_ctx ctx = { .net =dev_net (dev), };
@@ -371,7 +372,8 @@ static int nf_tables_netdev_event(struct nft_net =nft_pernet (ctx.net);mutex_lock (&nft_net->commit_mutex);list_for_each_entry (table, &nft_net->tables, list) { -if (table->family !=NFPROTO_NETDEV ) +if (table->family !=NFPROTO_NETDEV && + table->family !=NFPROTO_INET )continue ; ctx.family = table->family;
@@ -380,6 +382,11 @@ static int nf_tables_netdev_event(structif (!nft_is_base_chain (chain))continue ; + basechain =nft_base_chain (chain); +if (table->family ==NFPROTO_INET && + basechain->ops.hooknum !=NF_INET_INGRESS ) +continue ; + ctx.chain = chain;nft_netdev_event (event, dev, &ctx); }
Greg Kroah-Hartman
maintainerPATCH 244/331 netfilter: nf_tables: reject QUEUE/DROP verdict parameters
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit f342de4e2f33e0e39165d8639387aa6c19dff660 upstream.
This reverts commit e0abdadcc6e1.
core.c:nf_hook_slow assumes that the upper 16 bits of NF_DROP verdicts contain a valid errno, i.e. -EPERM, -EHOSTUNREACH or similar, or 0.
Due to the reverted commit, its possible to provide a positive value, e.g. NF_ACCEPT (1), which results in use-after-free.
Its not clear to me why this commit was made.
NF_QUEUE is not used by nftables; "queue" rules in nftables will result in use of "nft_queue" expression.
If we later need to allow specifiying errno values from userspace (do not know why), this has to call NF_DROP_GETERR and check that "err <= 0" holds true.
--- net/netfilter/nf_tables_api.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
net/netfilter/nf_tables_api.c +6 -10
@@ -10871,16 +10871,10 @@ static int nft_verdict_init(const struct data->verdict.code =ntohl (nla_get_be32 (tb[NFTA_VERDICT_CODE ]));switch (data->verdict.code) { -default : -switch (data->verdict.code &NF_VERDICT_MASK ) { -case NF_ACCEPT : -case NF_DROP : -case NF_QUEUE : -break ; -default : -return -EINVAL ; - } - fallthrough; +case NF_ACCEPT : +case NF_DROP : +case NF_QUEUE : +break ;case NFT_CONTINUE :case NFT_BREAK :case NFT_RETURN :
@@ -10915,6 +10909,8 @@ static int nft_verdict_init(const struct data->verdict.chain = chain;break ; +default : +return -EINVAL ; } desc->len =sizeof (data->verdict);
Greg Kroah-Hartman
maintainerPATCH 245/331 platform/x86: intel-uncore-freq: Fix types in sysfs callbacks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 416de0246f35f43d871a57939671fe814f4455ee upstream.
When booting a kernel with CONFIG_CFI_CLANG, there is a CFI failure when accessing any of the values under /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00:
$ cat /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/max_freq_khz fish: Job 1, 'cat /sys/devices/system/cpu/int…' terminated by signal SIGSEGV (Address boundary error)
$ sudo dmesg &| grep 'CFI failure' [ 170.953925] CFI failure at kobj_attr_show+0x19/0x30 (target: show_max_freq_khz+0x0/0xc0 [intel_uncore_frequency_common]; expected type: 0xd34078c5
The sysfs callback functions such as show_domain_id() are written as if they are going to be called by dev_attr_show() but as the above message shows, they are instead called by kobj_attr_show(). kCFI checks that the destination of an indirect jump has the exact same type as the prototype of the function pointer it is called through and fails when they do not.
These callbacks are called through kobj_attr_show() because uncore_root_kobj was initialized with kobject_create_and_add(), which means uncore_root_kobj has a ->sysfs_ops of kobj_sysfs_ops from kobject_create(), which uses kobj_attr_show() as its ->show() value.
The only reason there has not been a more noticeable problem until this point is that 'struct kobj_attribute' and 'struct device_attribute' have the same layout, so getting the callback from container_of() works the same with either value.
Change all the callbacks and their uses to be compatible with kobj_attr_show() and kobj_attr_store(), which resolves the kCFI failure and allows the sysfs files to work properly.
--- drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c | 82 +++++----- drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h | 32 +-- 2 files changed, 57 insertions(+), 57 deletions(-)
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +41 -41
@@ -23,23 +23,23 @@ static int (*uncore_read)(struct uncore_static int (*uncore_write)(struct uncore_data *data,unsigned int input,unsigned int min_max);static int (*uncore_read_freq)(struct uncore_data *data,unsigned int *freq); -static ssize_t show_domain_id (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t show_domain_id (struct kobject *kobj,struct kobj_attribute *attr,char *buf) { - struct uncore_data *data = container_of(attr, struct uncore_data, domain_id_dev_attr); + struct uncore_data *data = container_of(attr, struct uncore_data, domain_id_kobj_attr);return sprintf (buf,"%u\n" , data->domain_id); } -static ssize_t show_fabric_cluster_id (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t show_fabric_cluster_id (struct kobject *kobj,struct kobj_attribute *attr,char *buf) { - struct uncore_data *data = container_of(attr, struct uncore_data, fabric_cluster_id_dev_attr); + struct uncore_data *data = container_of(attr, struct uncore_data, fabric_cluster_id_kobj_attr);return sprintf (buf,"%u\n" , data->cluster_id); } -static ssize_t show_package_id (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t show_package_id (struct kobject *kobj,struct kobj_attribute *attr,char *buf) { - struct uncore_data *data = container_of(attr, struct uncore_data, package_id_dev_attr); + struct uncore_data *data = container_of(attr, struct uncore_data, package_id_kobj_attr);return sprintf (buf,"%u\n" , data->package_id); }
@@ -97,30 +97,30 @@ static ssize_t show_perf_status_freq_khz }#define store_uncore_min_max (name, min_max) \ - static ssize_t store_##name(struct device *dev, \ - struct device_attribute *attr, \ + static ssize_t store_##name(struct kobject *kobj, \ + struct kobj_attribute *attr, \ const char *buf, size_t count) \ { \ - struct uncore_data *data = container_of(attr, struct uncore_data, name##_dev_attr);\ + struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\ \ return store_min_max_freq_khz(data, buf, count, \ min_max); \ }#define show_uncore_min_max (name, min_max) \ - static ssize_t show_##name(struct device *dev, \ - struct device_attribute *attr, char *buf)\ + static ssize_t show_##name(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buf)\ { \ - struct uncore_data *data = container_of(attr, struct uncore_data, name##_dev_attr);\ + struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\ \ return show_min_max_freq_khz(data, buf, min_max); \ }#define show_uncore_perf_status (name) \ - static ssize_t show_##name(struct device *dev, \ - struct device_attribute *attr, char *buf)\ + static ssize_t show_##name(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buf)\ { \ - struct uncore_data *data = container_of(attr, struct uncore_data, name##_dev_attr);\ + struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\ \ return show_perf_status_freq_khz(data, buf); \ }
@@ -134,11 +134,11 @@ show_uncore_min_max(max_freq_khz, 1);show_uncore_perf_status (current_freq_khz);#define show_uncore_data (member_name) \ - static ssize_t show_##member_name(struct device *dev, \ - struct device_attribute *attr, char *buf)\ + static ssize_t show_##member_name(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buf)\ { \ struct uncore_data *data = container_of(attr, struct uncore_data,\ - member_name##_dev_attr);\ + member_name##_kobj_attr);\ \ return sysfs_emit(buf, "%u\n", \ data->member_name); \
@@ -149,29 +149,29 @@ show_uncore_data(initial_max_freq_khz);#define init_attribute_rw (_name) \ do { \ - sysfs_attr_init(&data->_name##_dev_attr.attr); \ - data->_name##_dev_attr.show = show_##_name; \ - data->_name##_dev_attr.store = store_##_name; \ - data->_name##_dev_attr.attr.name = #_name; \ - data->_name##_dev_attr.attr.mode = 0644; \ + sysfs_attr_init(&data->_name##_kobj_attr.attr); \ + data->_name##_kobj_attr.show = show_##_name; \ + data->_name##_kobj_attr.store = store_##_name; \ + data->_name##_kobj_attr.attr.name = #_name; \ + data->_name##_kobj_attr.attr.mode = 0644; \ } while (0)#define init_attribute_ro (_name) \ do { \ - sysfs_attr_init(&data->_name##_dev_attr.attr); \ - data->_name##_dev_attr.show = show_##_name; \ - data->_name##_dev_attr.store = NULL; \ - data->_name##_dev_attr.attr.name = #_name; \ - data->_name##_dev_attr.attr.mode = 0444; \ + sysfs_attr_init(&data->_name##_kobj_attr.attr); \ + data->_name##_kobj_attr.show = show_##_name; \ + data->_name##_kobj_attr.store = NULL; \ + data->_name##_kobj_attr.attr.name = #_name; \ + data->_name##_kobj_attr.attr.mode = 0444; \ } while (0)#define init_attribute_root_ro (_name) \ do { \ - sysfs_attr_init(&data->_name##_dev_attr.attr); \ - data->_name##_dev_attr.show = show_##_name; \ - data->_name##_dev_attr.store = NULL; \ - data->_name##_dev_attr.attr.name = #_name; \ - data->_name##_dev_attr.attr.mode = 0400; \ + sysfs_attr_init(&data->_name##_kobj_attr.attr); \ + data->_name##_kobj_attr.show = show_##_name; \ + data->_name##_kobj_attr.store = NULL; \ + data->_name##_kobj_attr.attr.name = #_name; \ + data->_name##_kobj_attr.attr.mode = 0400; \ } while (0)static int create_attr_group (struct uncore_data *data,char *name)
@@ -186,21 +186,21 @@ static int create_attr_group(struct uncoif (data->domain_id !=UNCORE_DOMAIN_ID_INVALID ) {init_attribute_root_ro (domain_id); - data->uncore_attrs[index++] = &data->domain_id_dev_attr.attr; + data->uncore_attrs[index++] = &data->domain_id_kobj_attr.attr;init_attribute_root_ro (fabric_cluster_id); - data->uncore_attrs[index++] = &data->fabric_cluster_id_dev_attr.attr; + data->uncore_attrs[index++] = &data->fabric_cluster_id_kobj_attr.attr;init_attribute_root_ro (package_id); - data->uncore_attrs[index++] = &data->package_id_dev_attr.attr; + data->uncore_attrs[index++] = &data->package_id_kobj_attr.attr; } - data->uncore_attrs[index++] = &data->max_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->min_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->initial_min_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->initial_max_freq_khz_dev_attr.attr; + data->uncore_attrs[index++] = &data->max_freq_khz_kobj_attr.attr; + data->uncore_attrs[index++] = &data->min_freq_khz_kobj_attr.attr; + data->uncore_attrs[index++] = &data->initial_min_freq_khz_kobj_attr.attr; + data->uncore_attrs[index++] = &data->initial_max_freq_khz_kobj_attr.attr; ret =uncore_read_freq (data, &freq);if (!ret) - data->uncore_attrs[index++] = &data->current_freq_khz_dev_attr.attr; + data->uncore_attrs[index++] = &data->current_freq_khz_kobj_attr.attr; data->uncore_attrs[index] =NULL ;
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h +16 -16
@@ -26,14 +26,14 @@* @instance_id: Unique instance id to append to directory name * @name: Sysfs entry name for this instance * @uncore_attr_group: Attribute group storage -* @max_freq_khz_dev_attr: Storage for device attribute max_freq_khz -* @mix_freq_khz_dev_attr: Storage for device attribute min_freq_khz -* @initial_max_freq_khz_dev_attr: Storage for device attribute initial_max_freq_khz -* @initial_min_freq_khz_dev_attr: Storage for device attribute initial_min_freq_khz -* @current_freq_khz_dev_attr: Storage for device attribute current_freq_khz -* @domain_id_dev_attr: Storage for device attribute domain_id -* @fabric_cluster_id_dev_attr: Storage for device attribute fabric_cluster_id -* @package_id_dev_attr: Storage for device attribute package_id +* @max_freq_khz_kobj_attr: Storage for kobject attribute max_freq_khz +* @mix_freq_khz_kobj_attr: Storage for kobject attribute min_freq_khz +* @initial_max_freq_khz_kobj_attr: Storage for kobject attribute initial_max_freq_khz +* @initial_min_freq_khz_kobj_attr: Storage for kobject attribute initial_min_freq_khz +* @current_freq_khz_kobj_attr: Storage for kobject attribute current_freq_khz +* @domain_id_kobj_attr: Storage for kobject attribute domain_id +* @fabric_cluster_id_kobj_attr: Storage for kobject attribute fabric_cluster_id +* @package_id_kobj_attr: Storage for kobject attribute package_id * @uncore_attrs: Attribute storage for group creation * * This structure is used to encapsulate all data related to uncore sysfs
@@ -53,14 +53,14 @@ struct uncore_data {char name[32 ];struct attribute_group uncore_attr_group; -struct device_attribute max_freq_khz_dev_attr; -struct device_attribute min_freq_khz_dev_attr; -struct device_attribute initial_max_freq_khz_dev_attr; -struct device_attribute initial_min_freq_khz_dev_attr; -struct device_attribute current_freq_khz_dev_attr; -struct device_attribute domain_id_dev_attr; -struct device_attribute fabric_cluster_id_dev_attr; -struct device_attribute package_id_dev_attr; +struct kobj_attribute max_freq_khz_kobj_attr; +struct kobj_attribute min_freq_khz_kobj_attr; +struct kobj_attribute initial_max_freq_khz_kobj_attr; +struct kobj_attribute initial_min_freq_khz_kobj_attr; +struct kobj_attribute current_freq_khz_kobj_attr; +struct kobj_attribute domain_id_kobj_attr; +struct kobj_attribute fabric_cluster_id_kobj_attr; +struct kobj_attribute package_id_kobj_attr;struct attribute *uncore_attrs[9 ]; };
Greg Kroah-Hartman
maintainerPATCH 246/331 platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shin'ichiro Kawasaki <[email protected]>
commit 5913320eb0b3ec88158cfcb0fa5e996bf4ef681b upstream.
p2sb_bar() unhides P2SB device to get resources from the device. It guards the operation by locking pci_rescan_remove_lock so that parallel rescans do not find the P2SB device. However, this lock causes deadlock when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan locks pci_rescan_remove_lock and probes PCI devices. When PCI devices call p2sb_bar() during probe, it locks pci_rescan_remove_lock again. Hence the deadlock.
To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar(). Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources() for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(), refer the cache and return to the caller.
Before operating the device at P2SB DEVFN for resource cache, check that its device class is PCI_CLASS_MEMORY_OTHER 0x0580 that PCH specifications define. This avoids unexpected operation to other devices at the same DEVFN.
Tested-by Klara Modin <[email protected]>
--- drivers/platform/x86/p2sb.c | 180 +++++++++++++++++++++++++++++++++----------- 1 file changed, 139 insertions(+), 41 deletions(-)
drivers/platform/x86/p2sb.c +139 -41
@@ -26,6 +26,21 @@ static const struct x86_cpu_id p2sb_cpu_ {} }; +/* +* Cache BAR0 of P2SB device functions 0 to 7. +* TODO: The constant 8 is the number of functions that PCI specification +* defines. Same definitions exist tree-wide. Unify this definition and +* the other definitions then move to include/uapi/linux/pci.h. +*/ +#define NR_P2SB_RES_CACHE 8 + +struct p2sb_res_cache { +u32 bus_dev_id; +struct resource res; +}; + +static struct p2sb_res_cache p2sb_resources[NR_P2SB_RES_CACHE ]; +static int p2sb_get_devfn (unsigned int *devfn) {unsigned int fn =P2SB_DEVFN_DEFAULT ;
@@ -39,8 +54,16 @@ static int p2sb_get_devfn(unsigned int *return 0 ; } +static bool p2sb_valid_resource (struct resource *res) +{ +if (res->flags) +return true; + +return false; +} +/* Copy resource from the first BAR of the device in question */ -static int p2sb_read_bar0 (struct pci_dev *pdev,struct resource *mem) +static void p2sb_read_bar0 (struct pci_dev *pdev,struct resource *mem) {struct resource *bar0 = &pdev->resource[0 ];
@@ -56,49 +79,66 @@ static int p2sb_read_bar0(struct pci_dev mem->end = bar0->end; mem->flags = bar0->flags; mem->desc = bar0->desc; - -return 0 ; } -static int p2sb_scan_and_read (struct pci_bus *bus,unsigned int devfn,struct resource *mem) +static void p2sb_scan_and_cache_devfn (struct pci_bus *bus,unsigned int devfn) { +struct p2sb_res_cache *cache = &p2sb_resources[PCI_FUNC (devfn)];struct pci_dev *pdev; -int ret; pdev =pci_scan_single_device (bus, devfn);if (!pdev) -return -ENODEV ; +return ; - ret =p2sb_read_bar0 (pdev, mem); +p2sb_read_bar0 (pdev, &cache->res); + cache->bus_dev_id = bus->dev.id;pci_stop_and_remove_bus_device (pdev); -return ret; } -/** -* p2sb_bar - Get Primary to Sideband (P2SB) bridge device BAR -* @bus: PCI bus to communicate with -* @devfn: PCI slot and function to communicate with -* @mem: memory resource to be filled in -* -* The BIOS prevents the P2SB device from being enumerated by the PCI -* subsystem, so we need to unhide and hide it back to lookup the BAR. -* -* if @bus is NULL, the bus 0 in domain 0 will be used. -* If @devfn is 0, it will be replaced by devfn of the P2SB device. -* -* Caller must provide a valid pointer to @mem. -* -* Locking is handled by pci_rescan_remove_lock mutex. -* -* Return: -* 0 on success or appropriate errno value on error. -*/ -int p2sb_bar (struct pci_bus *bus,unsigned int devfn,struct resource *mem) +static int p2sb_scan_and_cache (struct pci_bus *bus,unsigned int devfn) +{ +unsigned int slot, fn; + +if (PCI_FUNC (devfn) ==0 ) { +/* +* When function number of the P2SB device is zero, scan it and +* other function numbers, and if devices are available, cache +* their BAR0s. +*/ + slot =PCI_SLOT (devfn); +for (fn =0 ; fn <NR_P2SB_RES_CACHE ; fn++) +p2sb_scan_and_cache_devfn (bus,PCI_DEVFN (slot, fn)); + }else { +/* Scan the P2SB device and cache its BAR0 */ +p2sb_scan_and_cache_devfn (bus, devfn); + } + +if (!p2sb_valid_resource (&p2sb_resources[PCI_FUNC (devfn)].res)) +return -ENOENT ; + +return 0 ; +} + +static struct pci_bus *p2sb_get_bus (struct pci_bus *bus) +{ +static struct pci_bus *p2sb_bus; + + bus = bus ?: p2sb_bus; +if (bus) +return bus; + +/* Assume P2SB is on the bus 0 in domain 0 */ + p2sb_bus =pci_find_bus (0 ,0 ); +return p2sb_bus; +} + +static int p2sb_cache_resources (void ) { -struct pci_dev *pdev_p2sb;unsigned int devfn_p2sb;u32 value =P2SBC_HIDE ; +struct pci_bus *bus; +u16 class;int ret;/* Get devfn for P2SB device itself */
@@ -106,8 +146,17 @@ int p2sb_bar(struct pci_bus *bus, unsignif (ret)return ret; -/* if @bus is NULL, use bus 0 in domain 0 */ - bus = bus ?:pci_find_bus (0 ,0 ); + bus =p2sb_get_bus (NULL ); +if (!bus) +return -ENODEV ; + +/* +* When a device with same devfn exists and its device class is not +* PCI_CLASS_MEMORY_OTHER for P2SB, do not touch it. +*/ +pci_bus_read_config_word (bus, devfn_p2sb,PCI_CLASS_DEVICE , &class); +if (!PCI_POSSIBLE_ERROR (class) && class !=PCI_CLASS_MEMORY_OTHER ) +return -ENODEV ;/* * Prevent concurrent PCI bus scan from seeing the P2SB device and
@@ -115,17 +164,16 @@ int p2sb_bar(struct pci_bus *bus, unsign*/ pci_lock_rescan_remove (); -/* Unhide the P2SB device, if needed */ +/* +* The BIOS prevents the P2SB device from being enumerated by the PCI +* subsystem, so we need to unhide and hide it back to lookup the BAR. +* Unhide the P2SB device here, if needed. +*/ pci_bus_read_config_dword (bus, devfn_p2sb,P2SBC , &value);if (value &P2SBC_HIDE )pci_bus_write_config_dword (bus, devfn_p2sb,P2SBC ,0 ); - pdev_p2sb =pci_scan_single_device (bus, devfn_p2sb); -if (devfn) - ret =p2sb_scan_and_read (bus, devfn, mem); -else - ret =p2sb_read_bar0 (pdev_p2sb, mem); -pci_stop_and_remove_bus_device (pdev_p2sb); + ret =p2sb_scan_and_cache (bus, devfn_p2sb);/* Hide the P2SB device, if it was hidden */ if (value &P2SBC_HIDE )
@@ -133,12 +181,62 @@ int p2sb_bar(struct pci_bus *bus, unsignpci_unlock_rescan_remove (); -if (ret) -return ret; +return ret; +} -if (mem->flags ==0 ) +/** +* p2sb_bar - Get Primary to Sideband (P2SB) bridge device BAR +* @bus: PCI bus to communicate with +* @devfn: PCI slot and function to communicate with +* @mem: memory resource to be filled in +* +* If @bus is NULL, the bus 0 in domain 0 will be used. +* If @devfn is 0, it will be replaced by devfn of the P2SB device. +* +* Caller must provide a valid pointer to @mem. +* +* Return: +* 0 on success or appropriate errno value on error. +*/ +int p2sb_bar (struct pci_bus *bus,unsigned int devfn,struct resource *mem) +{ +struct p2sb_res_cache *cache; +int ret; + + bus =p2sb_get_bus (bus); +if (!bus)return -ENODEV ; +if (!devfn) { + ret =p2sb_get_devfn (&devfn); +if (ret) +return ret; + } + + cache = &p2sb_resources[PCI_FUNC (devfn)]; +if (cache->bus_dev_id != bus->dev.id) +return -ENODEV ; + +if (!p2sb_valid_resource (&cache->res)) +return -ENOENT ; + +memcpy (mem, &cache->res,sizeof (*mem));return 0 ; }EXPORT_SYMBOL_GPL (p2sb_bar); + +static int __init p2sb_fs_init (void ) +{ +p2sb_cache_resources (); +return 0 ; +} + +/* +* pci_rescan_remove_lock to avoid access to unhidden P2SB devices can +* not be locked in sysfs pci bus rescan path because of deadlock. To +* avoid the deadlock, access to P2SB devices with the lock at an early +* step in kernel initialization and cache required resources. This +* should happen after subsys_initcall which initializes PCI subsystem +* and before device_initcall which requires P2SB resources. +*/ +fs_initcall (p2sb_fs_init);
Greg Kroah-Hartman
maintainerPATCH 247/331 ksmbd: fix global oob in ksmbd_nl_policy
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ma <[email protected]>
commit ebeae8adf89d9a82359f6659b1663d09beec2faa upstream.
Similar to a reported issue (check the commit b33fb5b801c6 ("net:
qualcomm: rmnet: fix global oob in rmnet_policy"), my local fuzzer finds another global out-of-bounds read for policy ksmbd_nl_policy. See bug trace below:
==================================================================
BUG: KASAN: global-out-of-bounds in validate_nla lib/nlattr.c:386 [inline]
BUG: KASAN: global-out-of-bounds in __nla_validate_parse+0x24af/0x2750 lib/nlattr.c:600
Read of size 1 at addr ffffffff8f24b100 by task syz-executor.1/62810
CPU: 0 PID: 62810 Comm: syz-executor.1 Tainted: G N 6.1.0 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x172/0x475 mm/kasan/report.c:395
kasan_report+0xbb/0x1c0 mm/kasan/report.c:495
validate_nla lib/nlattr.c:386 [inline]
__nla_validate_parse+0x24af/0x2750 lib/nlattr.c:600
__nla_parse+0x3e/0x50 lib/nlattr.c:697
__nlmsg_parse include/net/netlink.h:748 [inline]
genl_family_rcv_msg_attrs_parse.constprop.0+0x1b0/0x290 net/netlink/genetlink.c:565
genl_family_rcv_msg_doit+0xda/0x330 net/netlink/genetlink.c:734
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0x441/0x780 net/netlink/genetlink.c:850
netlink_rcv_skb+0x14f/0x410 net/netlink/af_netlink.c:2540
genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x54e/0x800 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x930/0xe50 net/netlink/af_netlink.c:1921
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0x154/0x190 net/socket.c:734
____sys_sendmsg+0x6df/0x840 net/socket.c:2482
___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
__sys_sendmsg+0xf3/0x1c0 net/socket.c:2565
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fdd66a8f359
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fdd65e00168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fdd66bbcf80 RCX: 00007fdd66a8f359
RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000003
RBP: 00007fdd66ada493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc84b81aff R14: 00007fdd65e00300 R15: 0000000000022000
</TASK>
The buggy address belongs to the variable:
ksmbd_nl_policy+0x100/0xa80
The buggy address belongs to the physical page:
page:0000000034f47940 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ccc4b
flags: 0x200000000001000(reserved|node=0|zone=2)
raw: 0200000000001000 ffffea00073312c8 ffffea00073312c8 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffffffff8f24b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffff8f24b080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffff8f24b100: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 07 f9
^
ffffffff8f24b180: f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 00 00 00 05
ffffffff8f24b200: f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9 00 00 04 f9
==================================================================To fix it, add a placeholder named __KSMBD_EVENT_MAX and let KSMBD_EVENT_MAX to be its original value - 1 according to what other netlink families do. Also change two sites that refer the KSMBD_EVENT_MAX to correct value.
--- fs/smb/server/ksmbd_netlink.h | 3 ++- fs/smb/server/transport_ipc.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
fs/smb/server/ksmbd_netlink.h +2 -1
@@ -304,7 +304,8 @@ enum ksmbd_event {KSMBD_EVENT_SPNEGO_AUTHEN_REQUEST ,KSMBD_EVENT_SPNEGO_AUTHEN_RESPONSE =15 , - KSMBD_EVENT_MAX + __KSMBD_EVENT_MAX, + KSMBD_EVENT_MAX = __KSMBD_EVENT_MAX - 1 };/*
fs/smb/server/transport_ipc.c +2 -2
@@ -74,7 +74,7 @@ static int handle_unsupported_event(strustatic int handle_generic_event (struct sk_buff *skb,struct genl_info *info);static int ksmbd_ipc_heartbeat_request (void ); -static const struct nla_policy ksmbd_nl_policy[KSMBD_EVENT_MAX ] = { +static const struct nla_policy ksmbd_nl_policy[KSMBD_EVENT_MAX +1 ] = { [KSMBD_EVENT_UNSPEC ] = { .len =0 , },
@@ -403,7 +403,7 @@ static int handle_generic_event(struct sreturn -EPERM ;#endif -if (type >=KSMBD_EVENT_MAX ) { +if (type >KSMBD_EVENT_MAX ) {WARN_ON (1 );return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 248/331 firmware: arm_scmi: Check mailbox/SMT channel for consistency
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
commit 437a310b22244d4e0b78665c3042e5d1c0f45306 upstream.
On reception of a completion interrupt the shared memory area is accessed to retrieve the message header at first and then, if the message sequence number identifies a transaction which is still pending, the related payload is fetched too.
When an SCMI command times out the channel ownership remains with the platform until eventually a late reply is received and, as a consequence, any further transmission attempt remains pending, waiting for the channel to be relinquished by the platform.
Once that late reply is received the channel ownership is given back to the agent and any pending request is then allowed to proceed and overwrite the SMT area of the just delivered late reply; then the wait for the reply to the new request starts.
It has been observed that the spurious IRQ related to the late reply can be wrongly associated with the freshly enqueued request: when that happens the SCMI stack in-flight lookup procedure is fooled by the fact that the message header now present in the SMT area is related to the new pending transaction, even though the real reply has still to arrive.
This race-condition on the A2P channel can be detected by looking at the channel status bits: a genuine reply from the platform will have set the channel free bit before triggering the completion IRQ.
Add a consistency check to validate such condition in the A2P ISR.
--- drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/mailbox.c | 14 ++++++++++++++ drivers/firmware/arm_scmi/shmem.c | 6 ++++++ 3 files changed, 21 insertions(+)
drivers/firmware/arm_scmi/common.h +1 -0
@@ -314,6 +314,7 @@ void shmem_fetch_notification(struct scmvoid shmem_clear_channel (struct scmi_shared_mem __iomem *shmem);bool shmem_poll_done (struct scmi_shared_mem __iomem *shmem,struct scmi_xfer *xfer); +bool shmem_channel_free (struct scmi_shared_mem __iomem *shmem);/* declarations for message passing transports */ struct scmi_msg_payld ;
drivers/firmware/arm_scmi/mailbox.c +14 -0
@@ -45,6 +45,20 @@ static void rx_callback(struct mbox_clie {struct scmi_mailbox *smbox =client_to_scmi_mailbox (cl); +/* +* An A2P IRQ is NOT valid when received while the platform still has +* the ownership of the channel, because the platform at first releases +* the SMT channel and then sends the completion interrupt. +* +* This addresses a possible race condition in which a spurious IRQ from +* a previous timed-out reply which arrived late could be wrongly +* associated with the next pending transaction. +*/ +if (cl->knows_txdone && !shmem_channel_free (smbox->shmem)) { +dev_warn (smbox->cinfo->dev,"Ignoring spurious A2P IRQ !\n" ); +return ; + } +scmi_rx_callback (smbox->cinfo,shmem_read_header (smbox->shmem),NULL ); }
drivers/firmware/arm_scmi/shmem.c +6 -0
@@ -122,3 +122,9 @@ bool shmem_poll_done(struct scmi_shared_ (SCMI_SHMEM_CHAN_STAT_CHANNEL_ERROR |SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ); } + +bool shmem_channel_free (struct scmi_shared_mem __iomem *shmem) +{ +return (ioread32 (&shmem->channel_status) & +SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ); +}
Greg Kroah-Hartman
maintainerPATCH 249/331 Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit d1b163aa0749706379055e40a52cf7a851abf9dc upstream.
This reverts commit 60aebc9559492cea6a9625f514a8041717e3a2e4.
Commit 60aebc9559492cea ("drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync") messes up initialization order of the graphics drivers and leads to blank displays on some systems. So revert the commit.
To make the display drivers fully independent from initialization order requires to track framebuffer memory by device and independently from the loaded drivers. The kernel currently lacks the infrastructure to do so.
--- drivers/firmware/sysfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/sysfb.c +1 -1
@@ -128,4 +128,4 @@ unlock_mutex: }/* must execute after PCI subsystem for EFI quirks */ -subsys_initcall_sync (sysfb_init); +device_initcall (sysfb_init);
Greg Kroah-Hartman
maintainerPATCH 250/331 drm/amdgpu: Fix the null pointer when load rlc firmware
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Jun <[email protected]>
commit bc03c02cc1991a066b23e69bbcc0f66e8f1f7453 upstream.
If the RLC firmware is invalid because of wrong header size, the pointer to the rlc firmware is released in function amdgpu_ucode_request. There will be a null pointer error in subsequent use. So skip validation to fix it.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +6 -9
@@ -3989,16 +3989,13 @@ static int gfx_v10_0_init_microcode(struif (!amdgpu_sriov_vf (adev)) {snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_rlc.bin" , ucode_prefix); - err =amdgpu_ucode_request (adev, &adev->gfx.rlc_fw, fw_name); -/* don't check this. There are apparently firmwares in the wild with -* incorrect size in the header -*/ -if (err == -ENODEV ) - goto out; + err =request_firmware (&adev->gfx.rlc_fw, fw_name, adev->dev);if (err) -dev_dbg (adev->dev, -"gfx10: amdgpu_ucode_request() failed \"%s\"\n" , - fw_name); + goto out; + +/* don't validate this firmware. There are apparently firmwares +* in the wild with incorrect size in the header +*/ rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data; version_major =le16_to_cpu (rlc_hdr->header.header_version_major); version_minor =le16_to_cpu (rlc_hdr->header.header_version_minor);
Greg Kroah-Hartman
maintainerPATCH 251/331 xfs: read only mounts with fsopen mount API are busted
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
commit d8d222e09dab84a17bb65dda4b94d01c565f5327 upstream.
Recently xfs/513 started failing on my test machines testing "-o ro,norecovery" mount options. This was being emitted in dmesg:
[ 9906.932724] XFS (pmem0): no-recovery mounts must be read-only.
Turns out, readonly mounts with the fsopen()/fsconfig() mount API have been busted since day zero. It's only taken 5 years for debian unstable to start using this "new" mount API, and shortly after this I noticed xfs/513 had started to fail as per above.
The syscall trace is:
fsopen("xfs", FSOPEN_CLOEXEC) = 3mount_setattr(-1, NULL, 0, NULL, 0) = -1 EINVAL (Invalid argument)
.....fsconfig(3, FSCONFIG_SET_STRING, "source", "/dev/pmem0", 0) = 0 fsconfig(3, FSCONFIG_SET_FLAG, "ro", NULL, 0) = 0fsconfig(3, FSCONFIG_SET_FLAG, "norecovery", NULL, 0) = 0 fsconfig(3, FSCONFIG_CMD_CREATE, NULL, NULL, 0) = -1 EINVAL (Invalid argument)
close(3) = 0
Showing that the actual mount instantiation (FSCONFIG_CMD_CREATE) is what threw out the error.
During mount instantiation, we call xfs_fs_validate_params() which does:
/* No recovery flag requires a read-only mount */
if (xfs_has_norecovery(mp) && !xfs_is_readonly(mp)) {
xfs_warn(mp, "no-recovery mounts must be read-only.");
return -EINVAL;
}and xfs_is_readonly() checks internal mount flags for read only state. This state is set in xfs_init_fs_context() from the context superblock flag state:
/*
* Copy binary VFS mount flags we are interested in.
*/
if (fc->sb_flags & SB_RDONLY)
set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate);With the old mount API, all of the VFS specific superblock flags had already been parsed and set before xfs_init_fs_context() is called, so this all works fine.
However, in the brave new fsopen/fsconfig world, xfs_init_fs_context() is called from fsopen() context, before any VFS superblock have been set or parsed. Hence if we use fsopen(), the internal XFS readonly state is *never set*. Hence anything that depends on xfs_is_readonly() actually returning true for read only mounts is broken if fsopen() has been used to mount the filesystem.
Fix this by moving this internal state initialisation to xfs_fs_fill_super() before we attempt to validate the parameters that have been set prior to the FSCONFIG_CMD_CREATE call being made.
--- fs/xfs/xfs_super.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
fs/xfs/xfs_super.c +17 -10
@@ -1503,6 +1503,18 @@ xfs_fs_fill_super( mp->m_super = sb; +/* +* Copy VFS mount flags from the context now that all parameter parsing +* is guaranteed to have been completed by either the old mount API or +* the newer fsopen/fsconfig API. +*/ +if (fc->sb_flags &SB_RDONLY ) +set_bit (XFS_OPSTATE_READONLY , &mp->m_opstate); +if (fc->sb_flags &SB_DIRSYNC ) + mp->m_features |=XFS_FEAT_DIRSYNC ; +if (fc->sb_flags &SB_SYNCHRONOUS ) + mp->m_features |=XFS_FEAT_WSYNC ; + error =xfs_fs_validate_params (mp);if (error)return error;
@@ -1972,6 +1984,11 @@ static const struct fs_context_operation .free = xfs_fs_free, }; +/* +* WARNING: do not initialise any parameters in this function that depend on +* mount option parsing having already been performed as this can be called from +* fsopen() before any parameters have been set. +*/ static int xfs_init_fs_context (struct fs_context *fc) {
@@ -2003,16 +2020,6 @@ static int xfs_init_fs_context( mp->m_logbsize =-1 ; mp->m_allocsize_log =16 ;/* 64k */ -/* -* Copy binary VFS mount flags we are interested in. -*/ -if (fc->sb_flags &SB_RDONLY ) -set_bit (XFS_OPSTATE_READONLY , &mp->m_opstate); -if (fc->sb_flags &SB_DIRSYNC ) - mp->m_features |=XFS_FEAT_DIRSYNC ; -if (fc->sb_flags &SB_SYNCHRONOUS ) - mp->m_features |=XFS_FEAT_WSYNC ; - fc->s_fs_info = mp; fc->ops = &xfs_context_ops;
Greg Kroah-Hartman
maintainerPATCH 252/331 gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 805c74eac8cb306dc69b87b6b066ab4da77ceaf1 upstream.
Spurious wakeups are reported on the GPD G1619-04 which can be absolved by programming the GPIO to ignore wakeups.
--- drivers/gpio/gpiolib-acpi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpio/gpiolib-acpi.c +14 -0
@@ -1675,6 +1675,20 @@ static const struct dmi_system_id gpioli .ignore_interrupt = "INT33FC:00@3", }, }, + { + /* + * Spurious wakeups from TP_ATTN# pin + * Found in BIOS 0.35 + * https://gitlab.freedesktop.org/drm/amd/-/issues/3073 + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "GPD"), + DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"), + }, + .driver_data = &(struct acpi_gpiolib_dmi_quirk) { + .ignore_wake = "PNP0C50:00@8", + }, + }, {} /* Terminating entry */ };
Greg Kroah-Hartman
maintainerPATCH 253/331 cpufreq: intel_pstate: Refine computation of P-state for given frequency
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 192cdb1c907fd8df2d764c5bb17496e415e59391 upstream.
On systems using HWP, if a given frequency is equal to the maximum turbo frequency or the maximum non-turbo frequency, the HWP performance level corresponding to it is already known and can be used directly without any computation.
Accordingly, adjust the code to use the known HWP performance levels in the cases mentioned above.
This also helps to avoid limiting CPU capacity artificially in some cases when the BIOS produces the HWP_CAP numbers using a different E-core-to-P-core performance scaling factor than expected by the kernel.
--- drivers/cpufreq/intel_pstate.c | 55 +++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 21 deletions(-)
drivers/cpufreq/intel_pstate.c +34 -21
@@ -526,6 +526,30 @@ static int intel_pstate_cppc_get_scaling }#endif /* CONFIG_ACPI_CPPC_LIB */ +static int intel_pstate_freq_to_hwp_rel (struct cpudata *cpu,int freq, +unsigned int relation) +{ +if (freq == cpu->pstate.turbo_freq) +return cpu->pstate.turbo_pstate; + +if (freq == cpu->pstate.max_freq) +return cpu->pstate.max_pstate; + +switch (relation) { +case CPUFREQ_RELATION_H : +return freq / cpu->pstate.scaling; +case CPUFREQ_RELATION_C : +return DIV_ROUND_CLOSEST (freq, cpu->pstate.scaling); + } + +return DIV_ROUND_UP (freq, cpu->pstate.scaling); +} + +static int intel_pstate_freq_to_hwp (struct cpudata *cpu,int freq) +{ +return intel_pstate_freq_to_hwp_rel (cpu, freq,CPUFREQ_RELATION_L ); +} +/** * intel_pstate_hybrid_hwp_adjust - Calibrate HWP performance levels. * @cpu: Target CPU.
@@ -543,6 +567,7 @@ static void intel_pstate_hybrid_hwp_adjuint perf_ctl_scaling = cpu->pstate.perf_ctl_scaling;int perf_ctl_turbo = pstate_funcs.get_turbo (cpu->cpu);int scaling = cpu->pstate.scaling; +int freq;pr_debug ("CPU%d: perf_ctl_max_phys = %d\n" , cpu->cpu, perf_ctl_max_phys);pr_debug ("CPU%d: perf_ctl_turbo = %d\n" , cpu->cpu, perf_ctl_turbo);
@@ -556,16 +581,16 @@ static void intel_pstate_hybrid_hwp_adju cpu->pstate.max_freq =rounddown (cpu->pstate.max_pstate * scaling, perf_ctl_scaling); - cpu->pstate.max_pstate_physical = -DIV_ROUND_UP (perf_ctl_max_phys * perf_ctl_scaling, - scaling); + freq = perf_ctl_max_phys * perf_ctl_scaling; + cpu->pstate.max_pstate_physical =intel_pstate_freq_to_hwp (cpu, freq); - cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; + freq = cpu->pstate.min_pstate * perf_ctl_scaling; + cpu->pstate.min_freq = freq;/* * Cast the min P-state value retrieved via pstate_funcs.get_min() to * the effective range of HWP performance levels. */ - cpu->pstate.min_pstate =DIV_ROUND_UP (cpu->pstate.min_freq, scaling); + cpu->pstate.min_pstate =intel_pstate_freq_to_hwp (cpu, freq); }static inline void update_turbo_state (void )
@@ -2528,13 +2553,12 @@ static void intel_pstate_update_perf_lim* abstract values to represent performance rather than pure ratios. */ if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { -int scaling = cpu->pstate.scaling;int freq; freq = max_policy_perf * perf_ctl_scaling; - max_policy_perf =DIV_ROUND_UP (freq, scaling); + max_policy_perf =intel_pstate_freq_to_hwp (cpu, freq); freq = min_policy_perf * perf_ctl_scaling; - min_policy_perf =DIV_ROUND_UP (freq, scaling); + min_policy_perf =intel_pstate_freq_to_hwp (cpu, freq); } pr_debug("cpu:%d min_policy_perf:%d max_policy_perf:%d\n",
@@ -2908,18 +2932,7 @@ static int intel_cpufreq_target(struct ccpufreq_freq_transition_begin (policy, &freqs); -switch (relation) { -case CPUFREQ_RELATION_L : - target_pstate =DIV_ROUND_UP (freqs.new, cpu->pstate.scaling); -break ; -case CPUFREQ_RELATION_H : - target_pstate = freqs.new / cpu->pstate.scaling; -break ; -default : - target_pstate =DIV_ROUND_CLOSEST (freqs.new, cpu->pstate.scaling); -break ; - } - + target_pstate =intel_pstate_freq_to_hwp_rel (cpu, freqs.new, relation); target_pstate =intel_cpufreq_update_pstate (policy, target_pstate, false); freqs.new = target_pstate * cpu->pstate.scaling;
@@ -2937,7 +2950,7 @@ static unsigned int intel_cpufreq_fast_supdate_turbo_state (); - target_pstate =DIV_ROUND_UP (target_freq, cpu->pstate.scaling); + target_pstate =intel_pstate_freq_to_hwp (cpu, target_freq); target_pstate =intel_cpufreq_update_pstate (policy, target_pstate, true);
Greg Kroah-Hartman
maintainerPATCH 254/331 Revert "drm/i915/dsi: Do display on sequence later on icl+"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit 6992eb815d087858f8d7e4020529c2fe800456b3 upstream.
This reverts commit 88b065943cb583e890324d618e8d4b23460d51a3.
Lenovo 82TQ is unhappy if we do the display on sequence this late. The display output shows severe corruption.
It's unclear if this is a failure on our part (perhaps something to do with sending commands in LP mode after HS /video mode transmission has been started? Though the backlight on command at least seems to work) or simply that there are some commands in the sequence that are needed to be done earlier (eg. could be some DSC init stuff?). If the latter then I don't think the current Windows code would work either, but maybe this was originally tested with an older driver, who knows.
Root causing this fully would likely require a lot of experimentation which isn't really feasible without direct access to the machine, so let's just accept failure and go back to the original sequence.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +1 -2
@@ -1155,6 +1155,7 @@ static void gen11_dsi_powerup_panel(stru }intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_INIT_OTP ); +intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_DISPLAY_ON );/* ensure all panel commands dispatched before enabling transcoder */ wait_for_cmds_dispatched_to_panel (encoder);
@@ -1255,8 +1256,6 @@ static void gen11_dsi_enable(struct inte/* step6d: enable dsi transcoder */ gen11_dsi_enable_transcoder (encoder); -intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_DISPLAY_ON ); -/* step7: enable backlight */ intel_backlight_enable (crtc_state, conn_state);intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_BACKLIGHT_ON );
Greg Kroah-Hartman
maintainerPATCH 255/331 drm: Dont unref the same fb many times by mistake due to deadlock handling
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c upstream.
If we get a deadlock after the fb lookup in drm_mode_page_flip_ioctl() we proceed to unref the fb and then retry the whole thing from the top. But we forget to reset the fb pointer back to NULL, and so if we then get another error during the retry, before the fb lookup, we proceed the unref the same fb again without having gotten another reference. The end result is that the fb will (eventually) end up being freed while it's still in use.
Reset fb to NULL once we've unreffed it to avoid doing it again until we've done another fb lookup.
This turned out to be pretty easy to hit on a DG2 when doing async flips (and CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y). The first symptom I saw that drm_closefb() simply got stuck in a busy loop while walking the framebuffer list. Fortunately I was able to convince it to oops instead, and from there it was easier to track down the culprit.
--- drivers/gpu/drm/drm_plane.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_plane.c +1 -0
@@ -1387,6 +1387,7 @@ retry: out:if (fb)drm_framebuffer_put (fb); + fb =NULL ;if (plane->old_fb)drm_framebuffer_put (plane->old_fb); plane->old_fb =NULL ;
Greg Kroah-Hartman
maintainerPATCH 256/331 drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 914437992876838662c968cb416f832110fb1093 upstream.
The i2c_master_send/recv() functions return negative error codes or the number of bytes that were able to be sent/received. This code has two problems. 1) Instead of checking if all the bytes were sent or received, it checks that at least one byte was sent or received.
2) If there was a partial send/receive then we should return a negative error code but this code returns success.
--- drivers/gpu/drm/bridge/nxp-ptn3460.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/bridge/nxp-ptn3460.c +5 -5
@@ -56,13 +56,13 @@ static int ptn3460_read_bytes(struct ptn ret =i2c_master_send (ptn_bridge->client, &addr,1 );if (ret <=0 ) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret; +return ret ?: -EIO ; } ret =i2c_master_recv (ptn_bridge->client, buf, len); -if (ret <=0 ) { +if (ret != len) {DRM_ERROR ("Failed to recv i2c data, ret=%d\n" , ret); -return ret; +return ret <0 ? ret : -EIO ; }return 0 ;
@@ -78,9 +78,9 @@ static int ptn3460_write_byte(struct ptn buf[1 ] = val; ret =i2c_master_send (ptn_bridge->client, buf,ARRAY_SIZE (buf)); -if (ret <=0 ) { +if (ret !=ARRAY_SIZE (buf)) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret; +return ret <0 ? ret : -EIO ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 257/331 drm: Fix TODO list mentioning non-KMS drivers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit 9cf5ca1f485cae406968947a92bf304603999fa1 upstream.
Non-KMS drivers have been removed from DRM. Update the TODO list accordingly.
--- Documentation/gpu/todo.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/gpu/todo.rst +3 -4
@@ -337,8 +337,8 @@ connector register/unregister fixes Level: Intermediate -Remove load/unload callbacks from all non-DRIVER_LEGACY drivers ---------------------------------------------------------------- +Remove load/unload callbacks +---------------------------- The load/unload callbacks in struct &drm_driver are very much midlayers, plus for historical reasons they get the ordering wrong (and we can't fix that)
@@ -347,8 +347,7 @@ between setting up the &drm_driver structure and calling drm_dev_register(). - Rework drivers to no longer use the load/unload callbacks, directly coding the load/unload sequence into the driver's probe function. -- Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload - callbacks for all modern drivers. +- Once all drivers are converted, remove the load/unload callbacks. Contact: Daniel Vetter
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 258/331 drm/tidss: Fix atomic_flush check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
commit 95d4b471953411854f9c80b568da7fcf753f3801 upstream.
tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not, returns immediately as there's no reason to do any register changes.
However, the code checks for 'crtc->state->enable', which does not reflect the actual HW state. We should instead look at the 'crtc->state->active' flag.
This causes the tidss_crtc_atomic_flush() to proceed with the flush even if the active state is false, which then causes us to hit the WARN_ON(!crtc->state->event) check.
Fix this by checking the active flag, and while at it, fix the related debug print which had "active" and "needs modeset" wrong way.
--- drivers/gpu/drm/tidss/tidss_crtc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/tidss/tidss_crtc.c +5 -5
@@ -169,13 +169,13 @@ static void tidss_crtc_atomic_flush(strustruct tidss_device *tidss =to_tidss (ddev);unsigned long flags; -dev_dbg (ddev->dev, -"%s: %s enabled %d, needs modeset %d, event %p\n" , __func__, - crtc->name,drm_atomic_crtc_needs_modeset (crtc->state), - crtc->state->enable, crtc->state->event); +dev_dbg (ddev->dev,"%s: %s is %sactive, %s modeset, event %p\n" , + __func__, crtc->name, crtc->state->active ?"" :"not " , +drm_atomic_crtc_needs_modeset (crtc->state) ?"needs" :"doesn't need" , + crtc->state->event);/* There is nothing to do if CRTC is not going to be enabled. */ -if (!crtc->state->enable) +if (!crtc->state->active)return ;/*
Greg Kroah-Hartman
maintainerPATCH 259/331 drm: Disable the cursor plane on atomic contexts with virtualized drivers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
commit 4e3b70da64a53784683cfcbac2deda5d6e540407 upstream.
Cursor planes on virtualized drivers have special meaning and require that the clients handle them in specific ways, e.g. the cursor plane should react to the mouse movement the way a mouse cursor would be expected to and the client is required to set hotspot properties on it in order for the mouse events to be routed correctly.
This breaks the contract as specified by the "universal planes". Fix it by disabling the cursor planes on virtualized drivers while adding a foundation on top of which it's possible to special case mouse cursor planes for clients that want it.
Disabling the cursor planes makes some kms compositors which were broken, e.g. Weston, fallback to software cursor which works fine or at least better than currently while having no effect on others, e.g. gnome-shell or kwin, which put virtualized drivers on a deny-list when running in atomic context to make them fallback to legacy kms and avoid this issue.
--- drivers/gpu/drm/drm_plane.c | 13 +++++++++++++ drivers/gpu/drm/qxl/qxl_drv.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- include/drm/drm_drv.h | 9 +++++++++ include/drm/drm_file.h | 12 ++++++++++++ 7 files changed, 38 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_plane.c +13 -0
@@ -678,6 +678,19 @@ int drm_mode_getplane_res(struct drm_dev !file_priv->universal_planes)continue ; +/* +* If we're running on a virtualized driver then, +* unless userspace advertizes support for the +* virtualized cursor plane, disable cursor planes +* because they'll be broken due to missing cursor +* hotspot info. +*/ +if (plane->type ==DRM_PLANE_TYPE_CURSOR && +drm_core_check_feature (dev,DRIVER_CURSOR_HOTSPOT ) && + file_priv->atomic && + !file_priv->supports_virtualized_cursor_plane) +continue ; +if (drm_lease_held (file_priv, plane->base.id)) {if (count < plane_resp->count_planes &&put_user (plane->base.id, plane_ptr + count))
drivers/gpu/drm/qxl/qxl_drv.c +1 -1
@@ -283,7 +283,7 @@ static const struct drm_ioctl_desc qxl_i };static struct drm_driver qxl_driver = { - .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , + .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC |DRIVER_CURSOR_HOTSPOT , .dumb_create = qxl_mode_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset,
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
@@ -182,7 +182,7 @@ DEFINE_DRM_GEM_FOPS(vbox_fops);static const struct drm_driver driver = { .driver_features = -DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC , +DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC |DRIVER_CURSOR_HOTSPOT , .fops = &vbox_fops, .name =DRIVER_NAME ,
drivers/gpu/drm/virtio/virtgpu_drv.c +1 -1
@@ -177,7 +177,7 @@ static const struct drm_driver driver =* out via drm_device::driver_features: */ .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC | - DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE, + DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE | DRIVER_CURSOR_HOTSPOT, .open = virtio_gpu_driver_open, .postclose = virtio_gpu_driver_postclose,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
@@ -1611,7 +1611,7 @@ static const struct file_operations vmwgstatic const struct drm_driver driver = { .driver_features = -DRIVER_MODESET |DRIVER_RENDER |DRIVER_ATOMIC |DRIVER_GEM , +DRIVER_MODESET |DRIVER_RENDER |DRIVER_ATOMIC |DRIVER_GEM |DRIVER_CURSOR_HOTSPOT , .ioctls = vmw_ioctls, .num_ioctls =ARRAY_SIZE (vmw_ioctls), .master_set = vmw_master_set,
include/drm/drm_drv.h +9 -0
@@ -110,6 +110,15 @@ enum drm_driver_feature {* Driver supports user defined GPU VA bindings for GEM objects. */ DRIVER_GEM_GPUVA =BIT (8 ), +/** +* @DRIVER_CURSOR_HOTSPOT: +* +* Driver supports and requires cursor hotspot information in the +* cursor plane (e.g. cursor plane has to actually track the mouse +* cursor and the clients are required to set hotspot in order for +* the cursor planes to work correctly). +*/ + DRIVER_CURSOR_HOTSPOT = BIT(9),/* IMPORTANT: Below are all the legacy flags, add new ones above. */
include/drm/drm_file.h +12 -0
@@ -229,6 +229,18 @@ struct drm_file {bool is_master;/** +* @supports_virtualized_cursor_plane: +* +* This client is capable of handling the cursor plane with the +* restrictions imposed on it by the virtualized drivers. +* +* This implies that the cursor plane has to behave like a cursor +* i.e. track cursor movement. It also requires setting of the +* hotspot properties by the client on the cursor plane. +*/ +bool supports_virtualized_cursor_plane; + +/** * @master: * * Master this node is currently associated with. Protected by struct
Greg Kroah-Hartman
maintainerPATCH 260/331 drm/virtio: Disable damage clipping if FB changed since last page-flip
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Martinez Canillas <[email protected]>
commit 0240db231dfe5ee5b7a3a03cba96f0844b7a673d upstream.
The driver does per-buffer uploads and needs to force a full plane update if the plane's attached framebuffer has change since the last page-flip.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/virtio/virtgpu_plane.c +10 -0
@@ -79,6 +79,8 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, {struct drm_plane_state *new_plane_state =drm_atomic_get_new_plane_state (state, plane); +struct drm_plane_state *old_plane_state =drm_atomic_get_old_plane_state (state, + plane);bool is_cursor = plane->type ==DRM_PLANE_TYPE_CURSOR ;struct drm_crtc_state *crtc_state;int ret;
@@ -86,6 +88,14 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,if (!new_plane_state->fb ||WARN_ON (!new_plane_state->crtc))return 0 ; +/* +* Ignore damage clips if the framebuffer attached to the plane's state +* has changed since the last plane update (page-flip). In this case, a +* full plane update should happen because uploads are done per-buffer. +*/ +if (old_plane_state->fb != new_plane_state->fb) + new_plane_state->ignore_damage_clips = true; + crtc_state =drm_atomic_get_crtc_state (state, new_plane_state->crtc);if (IS_ERR (crtc_state))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 261/331 drm: Allow drivers to indicate the damage helpers to ignore damage clips
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Martinez Canillas <[email protected]>
commit 35ed38d58257336c1df26b14fd5110b026e2adde upstream.
It allows drivers to set a struct drm_plane_state .ignore_damage_clips in their plane's .atomic_check callback, as an indication to damage helpers such as drm_atomic_helper_damage_iter_init() that the damage clips should be ignored.
To be used by drivers that do per-buffer (e.g: virtio-gpu) uploads (rather than per-plane uploads), since these type of drivers need to handle buffer damages instead of frame damages.
That way, these drivers could force a full plane update if the framebuffer attached to a plane's state has changed since the last update (page-flip).
--- Documentation/gpu/drm-kms.rst | 2 ++ drivers/gpu/drm/drm_damage_helper.c | 3 ++- include/drm/drm_plane.h | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
Documentation/gpu/drm-kms.rst +2 -0
@@ -546,6 +546,8 @@ Plane Composition Properties .. kernel-doc:: drivers/gpu/drm/drm_blend.c :doc: overview +.. _damage_tracking_properties: + Damage Tracking Properties --------------------------
drivers/gpu/drm/drm_damage_helper.c +2 -1
@@ -241,7 +241,8 @@ drm_atomic_helper_damage_iter_init(struc iter->plane_src.x2 = (src.x2 >>16 ) + !!(src.x2 &0xFFFF ); iter->plane_src.y2 = (src.y2 >>16 ) + !!(src.y2 &0xFFFF ); -if (!iter->clips || !drm_rect_equals (&state->src, &old_state->src)) { +if (!iter->clips || state->ignore_damage_clips || + !drm_rect_equals (&state->src, &old_state->src)) { iter->clips =NULL ; iter->num_clips =0 ; iter->full_update = true;
include/drm/drm_plane.h +10 -0
@@ -191,6 +191,16 @@ struct drm_plane_state {struct drm_property_blob *fb_damage_clips;/** +* @ignore_damage_clips: +* +* Set by drivers to indicate the drm_atomic_helper_damage_iter_init() +* helper that the @fb_damage_clips blob property should be ignored. +* +* See :ref:`damage_tracking_properties` for more information. +*/ +bool ignore_damage_clips; + +/** * @src: * * source coordinates of the plane (in 16.16).
Greg Kroah-Hartman
maintainerPATCH 262/331 drm/amd/display: fix bandwidth validation failure on DCN 2.1
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <[email protected]>
commit 3a0fa3bc245ef92838a8296e0055569b8dff94c4 upstream.
IGT amdgpu/amd_color/crtc-lut-accuracy fails right at the beginning of the test execution, during atomic check, because DC rejects the bandwidth state for a fb sizing 64x64. The test was previously working with the deprecated dc_commit_state(). Now using dc_validate_with_context() approach, the atomic check needs to perform a full state validation. Therefore, set fast_validation to false in the dc_validate_global_state call for atomic check.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10400,7 +10400,7 @@ static int amdgpu_dm_atomic_check(structDRM_DEBUG_DRIVER ("drm_dp_mst_atomic_check() failed\n" ); goto fail; } - status =dc_validate_global_state (dc, dm_state->context, true); + status =dc_validate_global_state (dc, dm_state->context, false);if (status !=DC_OK ) {DRM_DEBUG_DRIVER ("DC global validation failure: %s (%d)" ,dc_status_to_str (status), status);
Greg Kroah-Hartman
maintainerPATCH 263/331 drm/amd/display: Disable PSR-SU on Parade 0803 TCON again
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 571c2fa26aa654946447c282a09d40a56c7ff128 upstream.
When screen brightness is rapidly changed and PSR-SU is enabled the display hangs on panels with this TCON even on the latest DCN 3.1.4 microcode (0x8002a81 at this time).
This was disabled previously as commit 072030b17830 ("drm/amd: Disable PSR-SU on Parade 0803 TCON") but reverted as commit 1e66a17ce546 ("Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON"") in favor of testing for a new enough microcode (commit cd2e31a9ab93 ("drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix")).
As hangs are still happening specifically with this TCON, disable PSR-SU again for it until it can be root caused.
--- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +2 -0
@@ -841,6 +841,8 @@ bool is_psr_su_specific_panel(struct dc_ isPSRSUSupported = false; else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03) isPSRSUSupported = false; + else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03) + isPSRSUSupported = false; else if (dpcd_caps->psr_info.force_psrsu_cap == 0x1) isPSRSUSupported = true; }
Greg Kroah-Hartman
maintainerPATCH 264/331 Revert "drm/amd/display: fix bandwidth validation failure on DCN 2.1"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Lipski <[email protected]>
commit c2ab9ce0ee7225fc05f58a6671c43b8a3684f530 upstream.
This commit causes dmesg-warn on several IGT tests on DCN 3.1.6: *ERROR*link_enc_cfg_validate: Invalid link encoder assignments - 0x1c
Affected IGT tests include:
- amdgpu/[amd_assr|amd_plane|amd_hotplug]
- kms_atomic
- kms_color
- kms_flip
- kms_properties
- kms_universal_plane
and some other tests
This reverts commit 3a0fa3bc245ef92838a8296e0055569b8dff94c4.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10400,7 +10400,7 @@ static int amdgpu_dm_atomic_check(structDRM_DEBUG_DRIVER ("drm_dp_mst_atomic_check() failed\n" ); goto fail; } - status =dc_validate_global_state (dc, dm_state->context, false); + status =dc_validate_global_state (dc, dm_state->context, true);if (status !=DC_OK ) {DRM_DEBUG_DRIVER ("DC global validation failure: %s (%d)" ,dc_status_to_str (status), status);
Greg Kroah-Hartman
maintainerPATCH 265/331 drm/bridge: nxp-ptn3460: simplify some error checking
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 28d3d0696688154cc04983f343011d07bf0508e4 upstream.
The i2c_master_send/recv() functions return negative error codes or they return "len" on success. So the error handling here can be written as just normal checks for "if (ret < 0) return ret;". No need to complicate things.
Btw, in this code the "len" parameter can never be zero, but even if it were, then I feel like this would still be the best way to write it.
--- drivers/gpu/drm/bridge/nxp-ptn3460.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/nxp-ptn3460.c +6 -6
@@ -54,15 +54,15 @@ static int ptn3460_read_bytes(struct ptnint ret; ret =i2c_master_send (ptn_bridge->client, &addr,1 ); -if (ret <=0 ) { +if (ret <0 ) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret ?: -EIO ; +return ret; } ret =i2c_master_recv (ptn_bridge->client, buf, len); -if (ret != len) { +if (ret <0 ) {DRM_ERROR ("Failed to recv i2c data, ret=%d\n" , ret); -return ret <0 ? ret : -EIO ; +return ret; }return 0 ;
@@ -78,9 +78,9 @@ static int ptn3460_write_byte(struct ptn buf[1 ] = val; ret =i2c_master_send (ptn_bridge->client, buf,ARRAY_SIZE (buf)); -if (ret !=ARRAY_SIZE (buf)) { +if (ret <0 ) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret <0 ? ret : -EIO ; +return ret; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 266/331 drm/amdgpu: correct the cu count for gfx v11
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Likun Gao <[email protected]>
commit f4a94dbb6dc0bed10a5fc63718d00f1de45b12c0 upstream.
Correct the algorithm of active CU to skip disabled sa for gfx v11.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
@@ -6353,6 +6353,9 @@ static int gfx_v11_0_get_cu_info(structmutex_lock (&adev->grbm_idx_mutex);for (i =0 ; i < adev->gfx.config.max_shader_engines; i++) {for (j =0 ; j < adev->gfx.config.max_sh_per_se; j++) { + bitmap = i * adev->gfx.config.max_sh_per_se + j; +if (!((gfx_v11_0_get_sa_active_bitmap (adev) >> bitmap) &1 )) +continue ; mask =1 ; counter =0 ;gfx_v11_0_select_se_sh (adev, i, j,0xffffffff ,0 );
Greg Kroah-Hartman
maintainerPATCH 267/331 drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
commit 7073934f5d73f8b53308963cee36f0d389ea857c upstream.
In edp_setup_replay(), 'struct dc *dc' & 'struct dmub_replay *replay' was dereferenced before the pointer 'link' & 'replay' NULL check.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c:947 edp_setup_replay() warn: variable dereferenced before check 'link' (see line 933)
--- drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c | 11 ++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +7 -4
@@ -920,8 +920,8 @@ bool edp_get_replay_state(const struct dbool edp_setup_replay (struct dc_link *link,const struct dc_stream_state *stream) {/* To-do: Setup Replay */ -struct dc *dc = link->ctx->dc; -struct dmub_replay *replay = dc->res_pool->replay; +struct dc *dc; +struct dmub_replay *replay;int i;unsigned int panel_inst;struct replay_context replay_context = {0 };
@@ -937,6 +937,10 @@ bool edp_setup_replay(struct dc_link *liif (!link)return false; + dc = link->ctx->dc; + + replay = dc->res_pool->replay; +if (!replay)return false;
@@ -965,8 +969,7 @@ bool edp_setup_replay(struct dc_link *li replay_context.line_time_in_ns = lineTimeInNs; -if (replay) - link->replay_settings.replay_feature_enabled = + link->replay_settings.replay_feature_enabled = replay->funcs->replay_copy_settings (replay, link, &replay_context, panel_inst);if (link->replay_settings.replay_feature_enabled) {
Greg Kroah-Hartman
maintainerPATCH 268/331 drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Kazlauskas <[email protected]>
commit 4b56f7d47be87cde5f368b67bc7fac53a2c3e8d2 upstream.
[Why]
We can experience DENTIST hangs during optimize_bandwidth or TDRs if FIFO is toggled and hangs.
[How]
Port the DCN35 fixes to DCN314.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 21 ++++------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +9 -12
@@ -131,30 +131,27 @@ static int dcn314_get_active_display_cntreturn display_count; } -static void dcn314_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) +static void dcn314_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context, +bool safe_to_lower,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;for (i =0 ; i < dc->res_pool->pipe_count; ++i) { -struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i]; +struct pipe_ctx *pipe = safe_to_lower + ? &context->res_ctx.pipe_ctx[i] + : &dc->current_state->res_ctx.pipe_ctx[i];if (pipe->top_pipe || pipe->prev_odm_pipe)continue ;if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal))) { -struct stream_encoder *stream_enc = pipe->stream_res.stream_enc; -if (disable) { -if (stream_enc && stream_enc->funcs->disable_fifo) - pipe->stream_res.stream_enc->funcs->disable_fifo (stream_enc); +if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc) + pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); - pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg);reset_sync_context_for_pipe (dc, context, i); }else { pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); - -if (stream_enc && stream_enc->funcs->enable_fifo) - pipe->stream_res.stream_enc->funcs->enable_fifo (stream_enc); } } }
@@ -252,11 +249,11 @@ void dcn314_update_clocks(struct clk_mgr }if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { -dcn314_disable_otg_wa (clk_mgr_base, context, true); +dcn314_disable_otg_wa (clk_mgr_base, context, safe_to_lower, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn314_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn314_disable_otg_wa (clk_mgr_base, context, false); +dcn314_disable_otg_wa (clk_mgr_base, context, safe_to_lower, false); update_dispclk = true; }
Greg Kroah-Hartman
maintainerPATCH 269/331 drm/amd/display: Align the returned error code with legacy DP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Lin <[email protected]>
commit bfe79f5fff1300d96203383582b078c7b0aec80a upstream.
[Why]
For usb4 connector, AUX transaction is handled by dmub utilizing a differnt code path comparing to legacy DP connector. If the usb4 DP connector is disconnected, AUX access will report EBUSY and cause igt@kms_dp_aux_dev fail.
[How]
Align the error code with the one reported by legacy DP as EIO.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +5 -0
@@ -956,6 +956,11 @@ int dm_helper_dmub_aux_transfer_sync( struct aux_payload *payload, enum aux_return_code_type *operation_result) { +if (!link->hpd_status) { + *operation_result =AUX_RET_ERROR_HPD_DISCON ; +return -1 ; + } +return amdgpu_dm_process_dmub_aux_transfer_sync (ctx, link->link_index, payload, operation_result); }
Greg Kroah-Hartman
maintainerPATCH 270/331 drm/amd/display: Fix late derefrence dsc check in link_set_dsc_pps_packet()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
commit 3bb9b1f958c3d986ed90a3ff009f1e77e9553207 upstream.
In link_set_dsc_pps_packet(), 'struct display_stream_compressor *dsc' was dereferenced in a DC_LOGGER_INIT(dsc->ctx->logger); before the 'dsc' NULL pointer check.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:905 link_set_dsc_pps_packet() warn: variable dereferenced before check 'dsc' (see line 903)
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +6 -2
@@ -873,11 +873,15 @@ bool link_set_dsc_pps_packet(struct pipe {struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;struct dc_stream_state *stream = pipe_ctx->stream; -DC_LOGGER_INIT (dsc->ctx->logger); -if (!pipe_ctx->stream->timing.flags.DSC || !dsc) +if (!pipe_ctx->stream->timing.flags.DSC) +return false; + +if (!dsc)return false; +DC_LOGGER_INIT (dsc->ctx->logger); +if (enable) {struct dsc_config dsc_cfg;uint8_t dsc_packed_pps[128 ];
Greg Kroah-Hartman
maintainerPATCH 271/331 drm/amdgpu/pm: Fix the power source flag error
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Jun <[email protected]>
commit ca1ffb174f16b699c536734fc12a4162097c49f4 upstream.
The power source flag should be updated when
[1] System receives an interrupt indicating that the power source has changed.
[2] System resumes from suspend or runtime suspend
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 +++---------- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 ++ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 2 ++ 3 files changed, 7 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -10
@@ -24,6 +24,7 @@#include <linux/firmware.h> #include <linux/pci.h> +#include <linux/power_supply.h> #include <linux/reboot.h> #include "amdgpu.h"
@@ -741,16 +742,8 @@ static int smu_late_init(void *handle)* handle the switch automatically. Driver involvement * is unnecessary. */ -if (!smu->dc_controlled_by_gpio) { - ret =smu_set_power_source (smu, - adev->pm.ac_power ?SMU_POWER_SOURCE_AC : -SMU_POWER_SOURCE_DC ); -if (ret) { -dev_err (adev->dev,"Failed to switch to %s mode!\n" , - adev->pm.ac_power ?"AC" :"DC" ); -return ret; - } - } + adev->pm.ac_power =power_supply_is_system_supplied () >0 ; +smu_set_ac_dc (smu);if ((adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (13 ,0 ,1 )) || (adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (13 ,0 ,3 )))
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +2 -0
@@ -1441,10 +1441,12 @@ static int smu_v11_0_irq_process(structcase 0x3 :dev_dbg (adev->dev,"Switched to AC mode!\n" );schedule_work (&smu->interrupt_work); + adev->pm.ac_power = true;break ;case 0x4 :dev_dbg (adev->dev,"Switched to DC mode!\n" );schedule_work (&smu->interrupt_work); + adev->pm.ac_power = false;break ;case 0x7 :/*
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -0
@@ -1377,10 +1377,12 @@ static int smu_v13_0_irq_process(structcase 0x3 :dev_dbg (adev->dev,"Switched to AC mode!\n" );smu_v13_0_ack_ac_dc_interrupt (smu); + adev->pm.ac_power = true;break ;case 0x4 :dev_dbg (adev->dev,"Switched to DC mode!\n" );smu_v13_0_ack_ac_dc_interrupt (smu); + adev->pm.ac_power = false;break ;case 0x7 :/*
Greg Kroah-Hartman
maintainerPATCH 272/331 drm/amd/display: Fix uninitialized variable usage in core_link_ read_dpcd() & write_dpcd() functions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
commit a58371d632ebab9ea63f10893a6b6731196b6f8d upstream.
The 'status' variable in 'core_link_read_dpcd()' & 'core_link_write_dpcd()' was uninitialized.
Thus, initializing 'status' variable to 'DC_ERROR_UNEXPECTED' by default.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:226 core_link_read_dpcd() error: uninitialized symbol 'status'. drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:248 core_link_write_dpcd() error: uninitialized symbol 'status'.
--- drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c +2 -2
@@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd(uint32_t extended_size;/* size of the remaining partitioned address space */ uint32_t size_left_to_read; -enum dc_status status; +enum dc_status status =DC_ERROR_UNEXPECTED ;/* size of the next partition to be read from */ uint32_t partition_size;uint32_t data_index =0 ;
@@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd( {uint32_t partition_size;uint32_t data_index =0 ; -enum dc_status status; +enum dc_status status =DC_ERROR_UNEXPECTED ;while (size) { partition_size =dpcd_get_next_partition_size (address, size);
Greg Kroah-Hartman
maintainerPATCH 273/331 net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin KaFai Lau <[email protected]>
commit 9c1292eca243821249fa99f40175b0660d9329e3 upstream.
It was reported that there is a compiler warning on the unused variable "sin_addr_len" in af_inet.c when CONFIG_CGROUP_BPF is not set. This patch is to address it similar to the ipv6 counterpart in inet6_getname(). It is to "return sin_addr_len;"
instead of "return sizeof(*sin);".
--- net/ipv4/af_inet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/af_inet.c +1 -1
@@ -823,7 +823,7 @@ int inet_getname(struct socket *sock, st }release_sock (sk);memset (sin->sin_zero,0 ,sizeof (sin->sin_zero)); -return sizeof (*sin); +return sin_addr_len; }EXPORT_SYMBOL (inet_getname);
Greg Kroah-Hartman
maintainerPATCH 274/331 thermal: intel: hfi: Refactor enabling code into helper functions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <[email protected]>
[ Upstream commit 8a8b6bb93c704776c4b05cb517c3fa8baffb72f5 ]
In preparation for the addition of a suspend notifier, wrap the logic to enable HFI and program its memory buffer into helper functions. Both the CPU hotplug callback and the suspend notifier will use them.
This refactoring does not introduce functional changes.
Stable-dep-of: 97566d09fd02 ("thermal: intel: hfi: Add syscore callbacks for system-wide PM")
--- drivers/thermal/intel/intel_hfi.c | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-)
drivers/thermal/intel/intel_hfi.c +22 -21
@@ -347,6 +347,26 @@ static void init_hfi_instance(struct hfi_instance *hfi_instance) hfi_instance->data = hfi_instance->hdr + hfi_features.hdr_size; } +/* Caller must hold hfi_instance_lock. */ +static void hfi_enable (void ) +{ +u64 msr_val; + +rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); + msr_val |=HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; +wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +} + +static void hfi_set_hw_table (struct hfi_instance *hfi_instance) +{ +phys_addr_t hw_table_pa; +u64 msr_val; + + hw_table_pa =virt_to_phys (hfi_instance->hw_table); + msr_val = hw_table_pa |HW_FEEDBACK_PTR_VALID_BIT ; +wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); +} +/** * intel_hfi_online() - Enable HFI on @cpu * @cpu: CPU in which the HFI will be enabled
@@ -364,8 +384,6 @@ void intel_hfi_online(unsigned int cpu) {struct hfi_instance *hfi_instance;struct hfi_cpu_info *info; -phys_addr_t hw_table_pa; -u64 msr_val;u16 die_id;/* Nothing to do if hfi_instances are missing. */
@@ -409,8 +427,6 @@ void intel_hfi_online(unsigned int cpu)if (!hfi_instance->hw_table) goto unlock; - hw_table_pa =virt_to_phys (hfi_instance->hw_table); -/* * Allocate memory to keep a local copy of the table that * hardware generates.
@@ -420,16 +436,6 @@ void intel_hfi_online(unsigned int cpu)if (!hfi_instance->local_table) goto free_hw_table; -/* -* Program the address of the feedback table of this die/package. On -* some processors, hardware remembers the old address of the HFI table -* even after having been reprogrammed and re-enabled. Thus, do not free -* the pages allocated for the table or reprogram the hardware with a -* new base address. Namely, program the hardware only once. -*/ - msr_val = hw_table_pa |HW_FEEDBACK_PTR_VALID_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); -init_hfi_instance (hfi_instance);INIT_DELAYED_WORK (&hfi_instance->update_work, hfi_update_work_fn);
@@ -438,13 +444,8 @@ void intel_hfi_online(unsigned int cpu)cpumask_set_cpu (cpu, hfi_instance->cpus); -/* -* Enable the hardware feedback interface and never disable it. See -* comment on programming the address of the table. -*/ -rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); - msr_val |=HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +hfi_set_hw_table (hfi_instance); +hfi_enable (); unlock:mutex_unlock (&hfi_instance_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 275/331 thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <[email protected]>
[ Upstream commit 1c53081d773c2cb4461636559b0d55b46559ceec ]
In preparation to support hibernation, add functionality to disable an HFI instance during CPU offline. The last CPU of an instance that goes offline will disable such instance.
The Intel Software Development Manual states that the operating system must wait for the hardware to set MSR_IA32_PACKAGE_THERM_STATUS[26] after disabling an HFI instance to ensure that it will no longer write on the HFI memory. Some processors, however, do not ever set such bit. Wait a minimum of 2ms to give time hardware to complete any pending memory writes.
Stable-dep-of: 97566d09fd02 ("thermal: intel: hfi: Add syscore callbacks for system-wide PM")
--- drivers/thermal/intel/intel_hfi.c | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/thermal/intel/intel_hfi.c +35 -0
@@ -24,6 +24,7 @@#include <linux/bitops.h> #include <linux/cpufeature.h> #include <linux/cpumask.h> +#include <linux/delay.h> #include <linux/gfp.h> #include <linux/io.h> #include <linux/kernel.h>
@@ -367,6 +368,32 @@ static void hfi_set_hw_table(struct hfi_instance *hfi_instance)wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); } +/* Caller must hold hfi_instance_lock. */ +static void hfi_disable (void ) +{ +u64 msr_val; +int i; + +rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); + msr_val &= ~HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; +wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); + +/* +* Wait for hardware to acknowledge the disabling of HFI. Some +* processors may not do it. Wait for ~2ms. This is a reasonable +* time for hardware to complete any pending actions on the HFI +* memory. +*/ +for (i =0 ; i <2000 ; i++) { +rdmsrl (MSR_IA32_PACKAGE_THERM_STATUS , msr_val); +if (msr_val &PACKAGE_THERM_STATUS_HFI_UPDATED ) +break ; + +udelay (1 ); +cpu_relax (); + } +} +/** * intel_hfi_online() - Enable HFI on @cpu * @cpu: CPU in which the HFI will be enabled
@@ -421,6 +448,10 @@ void intel_hfi_online(unsigned int cpu)/* * Hardware is programmed with the physical address of the first page * frame of the table. Hence, the allocated memory must be page-aligned. +* +* Some processors do not forget the initial address of the HFI table +* even after having been reprogrammed. Keep using the same pages. Do +* not free them. */ hfi_instance->hw_table =alloc_pages_exact (hfi_features.nr_table_pages,GFP_KERNEL | __GFP_ZERO);
@@ -485,6 +516,10 @@ void intel_hfi_offline(unsigned int cpu)mutex_lock (&hfi_instance_lock);cpumask_clear_cpu (cpu, hfi_instance->cpus); + +if (!cpumask_weight (hfi_instance->cpus)) +hfi_disable (); +mutex_unlock (&hfi_instance_lock); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 276/331 thermal: intel: hfi: Add syscore callbacks for system-wide PM
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <[email protected]>
[ Upstream commit 97566d09fd02d2ab329774bb89a2cdf2267e86d9 ]
The kernel allocates a memory buffer and provides its location to the hardware, which uses it to update the HFI table. This allocation occurs during boot and remains constant throughout runtime.
When resuming from hibernation, the restore kernel allocates a second memory buffer and reprograms the HFI hardware with the new location as part of a normal boot. The location of the second memory buffer may differ from the one allocated by the image kernel.
When the restore kernel transfers control to the image kernel, its HFI buffer becomes invalid, potentially leading to memory corruption if the hardware writes to it (the hardware continues to use the buffer from the restore kernel).
It is also possible that the hardware "forgets" the address of the memory buffer when resuming from "deep" suspend. Memory corruption may also occur in such a scenario.
To prevent the described memory corruption, disable HFI when preparing to suspend or hibernate. Enable it when resuming.
Add syscore callbacks to handle the package of the boot CPU (packages of non-boot CPUs are handled via CPU offline). Syscore ops always run on the boot CPU. Additionally, HFI only needs to be disabled during "deep" suspend and hibernation. Syscore ops only run in these cases.
--- drivers/thermal/intel/intel_hfi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/thermal/intel/intel_hfi.c +28 -0
@@ -35,7 +35,9 @@#include <linux/processor.h> #include <linux/slab.h> #include <linux/spinlock.h> +#include <linux/suspend.h> #include <linux/string.h> +#include <linux/syscore_ops.h> #include <linux/topology.h> #include <linux/workqueue.h>
@@ -568,6 +570,30 @@ static __init int hfi_parse_features(void)return 0 ; } +static void hfi_do_enable (void ) +{ +/* This code runs only on the boot CPU. */ +struct hfi_cpu_info *info = &per_cpu (hfi_cpu_info,0 ); +struct hfi_instance *hfi_instance = info->hfi_instance; + +/* No locking needed. There is no concurrency with CPU online. */ +hfi_set_hw_table (hfi_instance); +hfi_enable (); +} + +static int hfi_do_disable (void ) +{ +/* No locking needed. There is no concurrency with CPU offline. */ +hfi_disable (); + +return 0 ; +} + +static struct syscore_ops hfi_pm_ops = { + .resume = hfi_do_enable, + .suspend = hfi_do_disable, +}; +void __init intel_hfi_init (void ) {struct hfi_instance *hfi_instance;
@@ -599,6 +625,8 @@ void __init intel_hfi_init(void)if (!hfi_updates_wq) goto err_nomem; +register_syscore_ops (&hfi_pm_ops); +return ; err_nomem:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 277/331 fs/pipe: move check to pipe_has_watch_queue()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Kellermann <[email protected]>
[ Upstream commit b4bd6b4bac8edd61eb8f7b836969d12c0c6af165 ]
This declutters the code by reducing the number of #ifdefs and makes the watch_queue checks simpler. This has no runtime effect; the machine code is identical.
Message-Id: <[email protected]>
Stable-dep-of: e95aada4cb93 ("pipe: wakeup wr_wait after setting max_usage")
--- fs/pipe.c | 12 +++--------- include/linux/pipe_fs_i.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-)
fs/pipe.c +3 -9
@@ -437,12 +437,10 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from) goto out; } -#ifdef CONFIG_WATCH_QUEUE -if (pipe->watch_queue) { +if (pipe_has_watch_queue (pipe)) { ret = -EXDEV ; goto out; } -#endif /* * If it wasn't empty we try to merge new data into
@@ -1324,10 +1322,8 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned int arg)unsigned int nr_slots, size;long ret =0 ; -#ifdef CONFIG_WATCH_QUEUE -if (pipe->watch_queue) +if (pipe_has_watch_queue (pipe))return -EBUSY ; -#endif size =round_pipe_size (arg); nr_slots = size >>PAGE_SHIFT ;
@@ -1379,10 +1375,8 @@ struct pipe_inode_info *get_pipe_info(struct file *file, bool for_splice)if (file->f_op != &pipefifo_fops || !pipe)return NULL ; -#ifdef CONFIG_WATCH_QUEUE -if (for_splice && pipe->watch_queue) +if (for_splice &&pipe_has_watch_queue (pipe))return NULL ; -#endif return pipe; }
include/linux/pipe_fs_i.h +16 -0
@@ -124,6 +124,22 @@ struct pipe_buf_operations {bool (*get)(struct pipe_inode_info *,struct pipe_buffer *); }; +/** +* pipe_has_watch_queue - Check whether the pipe is a watch_queue, +* i.e. it was created with O_NOTIFICATION_PIPE +* @pipe: The pipe to check +* +* Return: true if pipe is a watch queue, false otherwise. +*/ +static inline bool pipe_has_watch_queue (const struct pipe_inode_info *pipe) +{ +#ifdef CONFIG_WATCH_QUEUE +return pipe->watch_queue !=NULL ; +#else +return false; +#endif +} +/** * pipe_empty - Return true if the pipe is empty * @head: The pipe ring head pointer
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 278/331 pipe: wakeup wr_wait after setting max_usage
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Schauer <[email protected]>
[ Upstream commit e95aada4cb93d42e25c30a0ef9eb2923d9711d4a ]
Commit c73be61cede5 ("pipe: Add general notification queue support") a regression was introduced that would lock up resized pipes under certain conditions. See the reproducer in [1].
The commit resizing the pipe ring size was moved to a different function, doing that moved the wakeup for pipe->wr_wait before actually raising pipe->max_usage. If a pipe was full before the resize occured it would result in the wakeup never actually triggering pipe_write.
Set @max_usage and @nr_accounted before waking writers if this isn't a watch queue.
--- fs/pipe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/pipe.c +5 -2
@@ -1305,6 +1305,11 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) pipe->tail = tail; pipe->head = head; +if (!pipe_has_watch_queue (pipe)) { + pipe->max_usage = nr_slots; + pipe->nr_accounted = nr_slots; + } +spin_unlock_irq (&pipe->rd_wait.lock);/* This might have made more room for writers */
@@ -1356,8 +1361,6 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned int arg)if (ret <0 ) goto out_revert_acct; - pipe->max_usage = nr_slots; - pipe->nr_accounted = nr_slots;return pipe->max_usage *PAGE_SIZE ; out_revert_acct:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 279/331 media: v4l: cci: Include linux/bits.h
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <[email protected]>
[ Upstream commit eba5058633b4d11e2a4d65eae9f1fce0b96365d9 ]
linux/bits.h is needed for GENMASK(). Include it.
Stable-dep-of: d92e7a013ff3 ("media: v4l2-cci: Add support for little-endian encoded registers")
--- include/media/v4l2-cci.h | 1 + 1 file changed, 1 insertion(+)
include/media/v4l2-cci.h +1 -0
@@ -7,6 +7,7 @@#ifndef _V4L2_CCI_H#define _V4L2_CCI_H +#include <linux/bits.h> #include <linux/types.h> struct i2c_client ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 280/331 media: v4l: cci: Add macros to obtain register width and address
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <[email protected]>
[ Upstream commit cd93cc245dfe334c38da98c14b34f9597e1b4ea6 ]
Add CCI_REG_WIDTH() macro to obtain register width in bits and similarly, CCI_REG_WIDTH_BYTES() to obtain it in bytes.
Also add CCI_REG_ADDR() macro to obtain the address of a register.
Use both macros in v4l2-cci.c, too.
Stable-dep-of: d92e7a013ff3 ("media: v4l2-cci: Add support for little-endian encoded registers")
--- drivers/media/v4l2-core/v4l2-cci.c | 8 ++++---- include/media/v4l2-cci.h | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/media/v4l2-core/v4l2-cci.c +4 -4
@@ -25,8 +25,8 @@ int cci_read(struct regmap *map, u32 reg, u64 *val, int *err)if (err && *err)return *err; - len =FIELD_GET (CCI_REG_WIDTH_MASK , reg); - reg =FIELD_GET (CCI_REG_ADDR_MASK , reg); + len =CCI_REG_WIDTH_BYTES (reg); + reg =CCI_REG_ADDR (reg); ret =regmap_bulk_read (map, reg, buf, len);if (ret) {
@@ -75,8 +75,8 @@ int cci_write(struct regmap *map, u32 reg, u64 val, int *err)if (err && *err)return *err; - len =FIELD_GET (CCI_REG_WIDTH_MASK , reg); - reg =FIELD_GET (CCI_REG_ADDR_MASK , reg); + len =CCI_REG_WIDTH_BYTES (reg); + reg =CCI_REG_ADDR (reg);switch (len) {case 1 :
include/media/v4l2-cci.h +5 -0
@@ -7,6 +7,7 @@#ifndef _V4L2_CCI_H#define _V4L2_CCI_H +#include <linux/bitfield.h> #include <linux/bits.h> #include <linux/types.h>
@@ -34,6 +35,10 @@ struct cci_reg_sequence {#define CCI_REG_WIDTH_SHIFT 16#define CCI_REG_WIDTH_MASK GENMASK(19, 16) +#define CCI_REG_WIDTH_BYTES (x) FIELD_GET(CCI_REG_WIDTH_MASK, x) +#define CCI_REG_WIDTH (x) (CCI_REG_WIDTH_BYTES(x) << 3) +#define CCI_REG_ADDR (x) FIELD_GET(CCI_REG_ADDR_MASK, x) +#define CCI_REG8 (x) ((1 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG16 (x) ((2 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG24 (x) ((3 << CCI_REG_WIDTH_SHIFT) | (x))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 281/331 media: v4l2-cci: Add support for little-endian encoded registers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit d92e7a013ff33f4e0b31bbf768d0c85a8acefebf ]
Some sensors, e.g. Sony IMX290, are using little-endian registers. Add support for those by encoding the endianness into Bit 20 of the register address.
--- drivers/media/v4l2-core/v4l2-cci.c | 44 ++++++++++++++++++++++++------ include/media/v4l2-cci.h | 5 ++++ 2 files changed, 41 insertions(+), 8 deletions(-)
drivers/media/v4l2-core/v4l2-cci.c +36 -8
@@ -18,6 +18,7 @@int cci_read (struct regmap *map,u32 reg,u64 *val,int *err) { +bool little_endian;unsigned int len;u8 buf[8 ];int ret;
@@ -25,6 +26,7 @@ int cci_read(struct regmap *map, u32 reg, u64 *val, int *err)if (err && *err)return *err; + little_endian = reg &CCI_REG_LE ; len =CCI_REG_WIDTH_BYTES (reg); reg =CCI_REG_ADDR (reg);
@@ -40,16 +42,28 @@ int cci_read(struct regmap *map, u32 reg, u64 *val, int *err) *val = buf[0 ];break ;case 2 : - *val =get_unaligned_be16 (buf); +if (little_endian) + *val =get_unaligned_le16 (buf); +else + *val =get_unaligned_be16 (buf);break ;case 3 : - *val =get_unaligned_be24 (buf); +if (little_endian) + *val =get_unaligned_le24 (buf); +else + *val =get_unaligned_be24 (buf);break ;case 4 : - *val =get_unaligned_be32 (buf); +if (little_endian) + *val =get_unaligned_le32 (buf); +else + *val =get_unaligned_be32 (buf);break ;case 8 : - *val =get_unaligned_be64 (buf); +if (little_endian) + *val =get_unaligned_le64 (buf); +else + *val =get_unaligned_be64 (buf);break ;default : dev_err(regmap_get_device(map), "Error invalid reg-width %u for reg 0x%04x\n",
@@ -68,6 +82,7 @@ EXPORT_SYMBOL_GPL(cci_read);int cci_write (struct regmap *map,u32 reg,u64 val,int *err) { +bool little_endian;unsigned int len;u8 buf[8 ];int ret;
@@ -75,6 +90,7 @@ int cci_write(struct regmap *map, u32 reg, u64 val, int *err)if (err && *err)return *err; + little_endian = reg &CCI_REG_LE ; len =CCI_REG_WIDTH_BYTES (reg); reg =CCI_REG_ADDR (reg);
@@ -83,16 +99,28 @@ int cci_write(struct regmap *map, u32 reg, u64 val, int *err) buf[0 ] = val;break ;case 2 : -put_unaligned_be16 (val, buf); +if (little_endian) +put_unaligned_le16 (val, buf); +else +put_unaligned_be16 (val, buf);break ;case 3 : -put_unaligned_be24 (val, buf); +if (little_endian) +put_unaligned_le24 (val, buf); +else +put_unaligned_be24 (val, buf);break ;case 4 : -put_unaligned_be32 (val, buf); +if (little_endian) +put_unaligned_le32 (val, buf); +else +put_unaligned_be32 (val, buf);break ;case 8 : -put_unaligned_be64 (val, buf); +if (little_endian) +put_unaligned_le64 (val, buf); +else +put_unaligned_be64 (val, buf);break ;default : dev_err(regmap_get_device(map), "Error invalid reg-width %u for reg 0x%04x\n",
include/media/v4l2-cci.h +5 -0
@@ -38,12 +38,17 @@ struct cci_reg_sequence {#define CCI_REG_WIDTH_BYTES (x) FIELD_GET(CCI_REG_WIDTH_MASK, x)#define CCI_REG_WIDTH (x) (CCI_REG_WIDTH_BYTES(x) << 3)#define CCI_REG_ADDR (x) FIELD_GET(CCI_REG_ADDR_MASK, x) +#define CCI_REG_LE BIT(20)#define CCI_REG8 (x) ((1 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG16 (x) ((2 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG24 (x) ((3 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG32 (x) ((4 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG64 (x) ((8 << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG16_LE (x) (CCI_REG_LE | (2U << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG24_LE (x) (CCI_REG_LE | (3U << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG32_LE (x) (CCI_REG_LE | (4U << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG64_LE (x) (CCI_REG_LE | (8U << CCI_REG_WIDTH_SHIFT) | (x))/** * cci_read() - Read a value from a single CCI register
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 282/331 media: i2c: imx290: Properly encode registers as little-endian
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit 60fc87a69523c294eb23a1316af922f6665a6f8c ]
The conversion to CCI also converted the multi-byte register access to big-endian. Correct the register definition by using the correct little-endian ones.
--- drivers/media/i2c/imx290.c | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
drivers/media/i2c/imx290.c +21 -21
@@ -41,18 +41,18 @@#define IMX290_WINMODE_720P (1 << 4)#define IMX290_WINMODE_CROP (4 << 4)#define IMX290_FR_FDG_SEL CCI_REG8(0x3009) -#define IMX290_BLKLEVEL CCI_REG16(0x300a) +#define IMX290_BLKLEVEL CCI_REG16_LE(0x300a)#define IMX290_GAIN CCI_REG8(0x3014) -#define IMX290_VMAX CCI_REG24(0x3018) +#define IMX290_VMAX CCI_REG24_LE(0x3018)#define IMX290_VMAX_MAX 0x3ffff -#define IMX290_HMAX CCI_REG16(0x301c) +#define IMX290_HMAX CCI_REG16_LE(0x301c)#define IMX290_HMAX_MAX 0xffff -#define IMX290_SHS1 CCI_REG24(0x3020) +#define IMX290_SHS1 CCI_REG24_LE(0x3020)#define IMX290_WINWV_OB CCI_REG8(0x303a) -#define IMX290_WINPV CCI_REG16(0x303c) -#define IMX290_WINWV CCI_REG16(0x303e) -#define IMX290_WINPH CCI_REG16(0x3040) -#define IMX290_WINWH CCI_REG16(0x3042) +#define IMX290_WINPV CCI_REG16_LE(0x303c) +#define IMX290_WINWV CCI_REG16_LE(0x303e) +#define IMX290_WINPH CCI_REG16_LE(0x3040) +#define IMX290_WINWH CCI_REG16_LE(0x3042)#define IMX290_OUT_CTRL CCI_REG8(0x3046)#define IMX290_ODBIT_10BIT (0 << 0)#define IMX290_ODBIT_12BIT (1 << 0)
@@ -78,28 +78,28 @@#define IMX290_ADBIT2 CCI_REG8(0x317c)#define IMX290_ADBIT2_10BIT 0x12#define IMX290_ADBIT2_12BIT 0x00 -#define IMX290_CHIP_ID CCI_REG16(0x319a) +#define IMX290_CHIP_ID CCI_REG16_LE(0x319a)#define IMX290_ADBIT3 CCI_REG8(0x31ec)#define IMX290_ADBIT3_10BIT 0x37#define IMX290_ADBIT3_12BIT 0x0e#define IMX290_REPETITION CCI_REG8(0x3405)#define IMX290_PHY_LANE_NUM CCI_REG8(0x3407)#define IMX290_OPB_SIZE_V CCI_REG8(0x3414) -#define IMX290_Y_OUT_SIZE CCI_REG16(0x3418) -#define IMX290_CSI_DT_FMT CCI_REG16(0x3441) +#define IMX290_Y_OUT_SIZE CCI_REG16_LE(0x3418) +#define IMX290_CSI_DT_FMT CCI_REG16_LE(0x3441)#define IMX290_CSI_DT_FMT_RAW10 0x0a0a#define IMX290_CSI_DT_FMT_RAW12 0x0c0c#define IMX290_CSI_LANE_MODE CCI_REG8(0x3443) -#define IMX290_EXTCK_FREQ CCI_REG16(0x3444) -#define IMX290_TCLKPOST CCI_REG16(0x3446) -#define IMX290_THSZERO CCI_REG16(0x3448) -#define IMX290_THSPREPARE CCI_REG16(0x344a) -#define IMX290_TCLKTRAIL CCI_REG16(0x344c) -#define IMX290_THSTRAIL CCI_REG16(0x344e) -#define IMX290_TCLKZERO CCI_REG16(0x3450) -#define IMX290_TCLKPREPARE CCI_REG16(0x3452) -#define IMX290_TLPX CCI_REG16(0x3454) -#define IMX290_X_OUT_SIZE CCI_REG16(0x3472) +#define IMX290_EXTCK_FREQ CCI_REG16_LE(0x3444) +#define IMX290_TCLKPOST CCI_REG16_LE(0x3446) +#define IMX290_THSZERO CCI_REG16_LE(0x3448) +#define IMX290_THSPREPARE CCI_REG16_LE(0x344a) +#define IMX290_TCLKTRAIL CCI_REG16_LE(0x344c) +#define IMX290_THSTRAIL CCI_REG16_LE(0x344e) +#define IMX290_TCLKZERO CCI_REG16_LE(0x3450) +#define IMX290_TCLKPREPARE CCI_REG16_LE(0x3452) +#define IMX290_TLPX CCI_REG16_LE(0x3454) +#define IMX290_X_OUT_SIZE CCI_REG16_LE(0x3472)#define IMX290_INCKSEL7 CCI_REG8(0x3480)#define IMX290_PGCTRL_REGEN BIT(0)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 283/331 thermal: trip: Drop redundant trips check from for_each_thermal_trip()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit a15ffa783ea4210877886c59566a0d20f6b2bc09 ]
It is invalid to call for_each_thermal_trip() on an unregistered thermal zone anyway, and as per thermal_zone_device_register_with_trips(), the trips[] table must be present if num_trips is greater than zero for the given thermal zone.
Hence, the trips check in for_each_thermal_trip() is redundant and so it can be dropped.
Stable-dep-of: e95fa7404716 ("thermal: gov_power_allocator: avoid inability to reset a cdev")
--- drivers/thermal/thermal_trip.c | 3 --- 1 file changed, 3 deletions(-)
drivers/thermal/thermal_trip.c +0 -3
@@ -17,9 +17,6 @@ int for_each_thermal_trip(struct thermal_zone_device *tz,lockdep_assert_held (&tz->lock); -if (!tz->trips) -return -ENODATA ; -for (i =0 ; i < tz->num_trips; i++) { ret =cb (&tz->trips[i], data);if (ret)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 284/331 thermal: core: Store trip pointer in struct thermal_instance
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 2c7b4bfadef08cc0995c24a7b9eb120fe897165f ]
Replace the integer trip number stored in struct thermal_instance with a pointer to the relevant trip and adjust the code using the structure in question accordingly.
The main reason for making this change is to allow the trip point to cooling device binding code more straightforward, as illustrated by subsequent modifications of the ACPI thermal driver, but it also helps to clarify the overall design and allows the governor code overhead to be reduced (through subsequent modifications).
The only case in which it adds complexity is trip_point_show() that needs to walk the trips[] table to find the index of the given trip point, but this is not a critical path and the interface that trip_point_show() belongs to is problematic anyway (for instance, it doesn't cover the case when the same cooling devices is associated with multiple trip points).
This is a preliminary change and the affected code will be refined by a series of subsequent modifications of thermal governors, the core and the ACPI thermal driver.
The general functionality is not expected to be affected by this change.
Stable-dep-of: e95fa7404716 ("thermal: gov_power_allocator: avoid inability to reset a cdev")
--- drivers/thermal/gov_bang_bang.c | 23 ++++++++--------------- drivers/thermal/gov_fair_share.c | 5 +++-- drivers/thermal/gov_power_allocator.c | 11 ++++++++--- drivers/thermal/gov_step_wise.c | 16 +++++++--------- drivers/thermal/thermal_core.c | 15 ++++++++++----- drivers/thermal/thermal_core.h | 4 +++- drivers/thermal/thermal_helpers.c | 5 ++++- drivers/thermal/thermal_sysfs.c | 3 ++- drivers/thermal/thermal_trip.c | 15 +++++++++++++++ 9 files changed, 60 insertions(+), 37 deletions(-)
drivers/thermal/gov_bang_bang.c +8 -15
@@ -13,28 +13,21 @@#include "thermal_core.h" -static int thermal_zone_trip_update (struct thermal_zone_device *tz,int trip_id) +static int thermal_zone_trip_update (struct thermal_zone_device *tz,int trip_index) { -struct thermal_trip trip; +const struct thermal_trip *trip = &tz->trips[trip_index];struct thermal_instance *instance; -int ret; - - ret =__thermal_zone_get_trip (tz, trip_id, &trip); -if (ret) { -pr_warn_once ("Failed to retrieve trip point %d\n" , trip_id); -return ret; - } -if (!trip.hysteresis) +if (!trip->hysteresis)dev_info_once (&tz->device,"Zero hysteresis value for thermal zone %s\n" , tz->type);dev_dbg (&tz->device,"Trip%d[temp=%d]:temp=%d:hyst=%d\n" , - trip_id, trip.temperature, tz->temperature, - trip.hysteresis); + trip_index, trip->temperature, tz->temperature, + trip->hysteresis);list_for_each_entry (instance, &tz->thermal_instances, tz_node) { -if (instance->trip != trip_id) +if (instance->trip != trip)continue ;/* in case fan is in initial state, switch the fan off */
@@ -52,10 +45,10 @@ static int thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id)* enable fan when temperature exceeds trip_temp and disable * the fan in case it falls below trip_temp minus hysteresis */ -if (instance->target ==0 && tz->temperature >= trip.temperature) +if (instance->target ==0 && tz->temperature >= trip->temperature) instance->target =1 ;else if (instance->target ==1 && - tz->temperature <= trip.temperature - trip.hysteresis) + tz->temperature <= trip->temperature - trip->hysteresis) instance->target =0 ; dev_dbg(&instance->cdev->device, "target=%d\n",
drivers/thermal/gov_fair_share.c +3 -2
@@ -49,7 +49,7 @@ static long get_target_state(struct thermal_zone_device *tz,/** * fair_share_throttle - throttles devices associated with the given zone * @tz: thermal_zone_device -* @trip: trip point index +* @trip_index: trip point index * * Throttling Logic: This uses three parameters to calculate the new * throttle state of the cooling devices associated with the given zone.
@@ -65,8 +65,9 @@ static long get_target_state(struct thermal_zone_device *tz,* (Heavily assumes the trip points are in ascending order) * new_state of cooling device = P3 * P2 * P1 */ -static int fair_share_throttle (struct thermal_zone_device *tz,int trip) +static int fair_share_throttle (struct thermal_zone_device *tz,int trip_index) { +const struct thermal_trip *trip = &tz->trips[trip_index];struct thermal_instance *instance;int total_weight =0 ;int total_instance =0 ;
drivers/thermal/gov_power_allocator.c +8 -3
@@ -90,12 +90,14 @@ static u32 estimate_sustainable_power(struct thermal_zone_device *tz)u32 sustainable_power =0 ;struct thermal_instance *instance;struct power_allocator_params *params = tz->governor_data; +const struct thermal_trip *trip_max_desired_temperature = + &tz->trips[params->trip_max_desired_temperature];list_for_each_entry (instance, &tz->thermal_instances, tz_node) {struct thermal_cooling_device *cdev = instance->cdev;u32 min_power; -if (instance->trip != params->trip_max_desired_temperature) +if (instance->trip != trip_max_desired_temperature)continue ;if (!cdev_is_power_actor (cdev))
@@ -383,12 +385,13 @@ static int allocate_power(struct thermal_zone_device *tz, {struct thermal_instance *instance;struct power_allocator_params *params = tz->governor_data; +const struct thermal_trip *trip_max_desired_temperature = + &tz->trips[params->trip_max_desired_temperature];u32 *req_power, *max_power, *granted_power, *extra_actor_power;u32 *weighted_req_power;u32 total_req_power, max_allocatable_power, total_weighted_req_power;u32 total_granted_power, power_range;int i, num_actors, total_weight, ret =0 ; -int trip_max_desired_temperature = params->trip_max_desired_temperature; num_actors =0 ; total_weight =0 ;
@@ -564,12 +567,14 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update) {struct thermal_instance *instance;struct power_allocator_params *params = tz->governor_data; +const struct thermal_trip *trip_max_desired_temperature = + &tz->trips[params->trip_max_desired_temperature];u32 req_power;list_for_each_entry (instance, &tz->thermal_instances, tz_node) {struct thermal_cooling_device *cdev = instance->cdev; -if ((instance->trip != params->trip_max_desired_temperature) || +if ((instance->trip != trip_max_desired_temperature) || (!cdev_is_power_actor (instance->cdev)))continue ;
drivers/thermal/gov_step_wise.c +7 -9
@@ -81,26 +81,24 @@ static void update_passive_instance(struct thermal_zone_device *tz,static void thermal_zone_trip_update (struct thermal_zone_device *tz,int trip_id) { +const struct thermal_trip *trip = &tz->trips[trip_id];enum thermal_trend trend;struct thermal_instance *instance; -struct thermal_trip trip;bool throttle = false;int old_target; -__thermal_zone_get_trip (tz, trip_id, &trip); - trend =get_tz_trend (tz, trip_id); -if (tz->temperature >= trip.temperature) { +if (tz->temperature >= trip->temperature) { throttle = true; -trace_thermal_zone_trip (tz, trip_id, trip.type); +trace_thermal_zone_trip (tz, trip_id, trip->type); }dev_dbg (&tz->device,"Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n" , - trip_id, trip.type, trip.temperature, trend, throttle); + trip_id, trip->type, trip->temperature, trend, throttle);list_for_each_entry (instance, &tz->thermal_instances, tz_node) { -if (instance->trip != trip_id) +if (instance->trip != trip)continue ; old_target = instance->target;
@@ -114,11 +112,11 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id/* Activate a passive thermal instance */ if (old_target ==THERMAL_NO_TARGET && instance->target !=THERMAL_NO_TARGET ) -update_passive_instance (tz, trip.type,1 ); +update_passive_instance (tz, trip->type,1 );/* Deactivate a passive thermal instance */ else if (old_target !=THERMAL_NO_TARGET && instance->target ==THERMAL_NO_TARGET ) -update_passive_instance (tz, trip.type,-1 ); +update_passive_instance (tz, trip->type,-1 ); instance->initialized = true;mutex_lock (&instance->cdev->lock);
drivers/thermal/thermal_core.c +10 -5
@@ -606,7 +606,7 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)/** * thermal_zone_bind_cooling_device() - bind a cooling device to a thermal zone * @tz: pointer to struct thermal_zone_device -* @trip: indicates which trip point the cooling devices is +* @trip_index: indicates which trip point the cooling devices is * associated with in this thermal zone. * @cdev: pointer to struct thermal_cooling_device * @upper: the Maximum cooling state for this trip point.
@@ -626,7 +626,7 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)* Return: 0 on success, the proper error value otherwise. */ int thermal_zone_bind_cooling_device (struct thermal_zone_device *tz, -int trip, +int trip_index,struct thermal_cooling_device *cdev,unsigned long upper,unsigned long lower,unsigned int weight)
@@ -635,12 +635,15 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,struct thermal_instance *pos;struct thermal_zone_device *pos1;struct thermal_cooling_device *pos2; +const struct thermal_trip *trip;bool upper_no_limit;int result; -if (trip >= tz->num_trips || trip <0 ) +if (trip_index >= tz->num_trips || trip_index <0 )return -EINVAL ; + trip = &tz->trips[trip_index]; +list_for_each_entry (pos1, &thermal_tz_list, node) {if (pos1 == tz)break ;
@@ -745,7 +748,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);* thermal_zone_unbind_cooling_device() - unbind a cooling device from a * thermal zone. * @tz: pointer to a struct thermal_zone_device. -* @trip: indicates which trip point the cooling devices is +* @trip_index: indicates which trip point the cooling devices is * associated with in this thermal zone. * @cdev: pointer to a struct thermal_cooling_device. *
@@ -756,13 +759,15 @@ EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);* Return: 0 on success, the proper error value otherwise. */ int thermal_zone_unbind_cooling_device (struct thermal_zone_device *tz, -int trip, +int trip_index,struct thermal_cooling_device *cdev) {struct thermal_instance *pos, *next; +const struct thermal_trip *trip;mutex_lock (&tz->lock);mutex_lock (&cdev->lock); + trip = &tz->trips[trip_index];list_for_each_entry_safe (pos, next, &tz->thermal_instances, tz_node) {if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {list_del (&pos->tz_node);
drivers/thermal/thermal_core.h +3 -1
@@ -87,7 +87,7 @@ struct thermal_instance {char name[THERMAL_NAME_LENGTH ];struct thermal_zone_device *tz;struct thermal_cooling_device *cdev; -int trip; +const struct thermal_trip *trip;bool initialized;unsigned long upper;/* Highest cooling state for this trip point */ unsigned long lower;/* Lowest cooling state for this trip point */
@@ -119,6 +119,8 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,void __thermal_zone_set_trips (struct thermal_zone_device *tz);int __thermal_zone_get_trip (struct thermal_zone_device *tz,int trip_id,struct thermal_trip *trip); +int thermal_zone_trip_id (struct thermal_zone_device *tz, +const struct thermal_trip *trip);int __thermal_zone_get_temp (struct thermal_zone_device *tz,int *temp);/* sysfs I/F */
drivers/thermal/thermal_helpers.c +4 -1
@@ -42,14 +42,17 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip_index)struct thermal_instance *get_thermal_instance (struct thermal_zone_device *tz, -struct thermal_cooling_device *cdev,int trip) +struct thermal_cooling_device *cdev,int trip_index) {struct thermal_instance *pos =NULL ;struct thermal_instance *target_instance =NULL ; +const struct thermal_trip *trip;mutex_lock (&tz->lock);mutex_lock (&cdev->lock); + trip = &tz->trips[trip_index]; +list_for_each_entry (pos, &tz->thermal_instances, tz_node) {if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { target_instance = pos;
drivers/thermal/thermal_sysfs.c +2 -1
@@ -943,7 +943,8 @@ trip_point_show(struct device *dev, struct device_attribute *attr, char *buf) instance = container_of(attr, struct thermal_instance, attr); -return sprintf (buf,"%d\n" , instance->trip); +return sprintf (buf,"%d\n" , +thermal_zone_trip_id (instance->tz, instance->trip)); }ssize_t
drivers/thermal/thermal_trip.c +15 -0
@@ -172,3 +172,18 @@ int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id,return 0 ; } + +int thermal_zone_trip_id (struct thermal_zone_device *tz, +const struct thermal_trip *trip) +{ +int i; + +lockdep_assert_held (&tz->lock); + +for (i =0 ; i < tz->num_trips; i++) { +if (&tz->trips[i] == trip) +return i; + } + +return -ENODATA ; +}
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 285/331 thermal: gov_power_allocator: avoid inability to reset a cdev
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Di Shen <[email protected]>
[ Upstream commit e95fa7404716f6e25021e66067271a4ad8eb1486 ]
Commit 0952177f2a1f ("thermal/core/power_allocator: Update once cooling devices when temp is low") adds an update flag to avoid triggering a thermal event when there is no need, and the thermal cdev is updated once when the temperature is low.
But when the trips are writable, and switch_on_temp is set to be a higher value, the cooling device state may not be reset to 0, because last_temperature is smaller than switch_on_temp.
For example:
First:
switch_on_temp=70 control_temp=85;
Then userspace change the trip_temp:
switch_on_temp=45 control_temp=55 cur_temp=54
Then userspace reset the trip_temp:
switch_on_temp=70 control_temp=85 cur_temp=57 last_temp=54
At this time, the cooling device state should be reset to 0. However, because cur_temp(57) < switch_on_temp(70) last_temp(54) < switch_on_temp(70) ----> update = false, update is false, the cooling device state can not be reset.
Using the observation that tz->passive can also be regarded as the temperature status, set the update flag to the tz->passive value.
When the temperature drops below switch_on for the first time, the states of cooling devices can be reset once, and tz->passive is updated to 0. In the next round, because tz->passive is 0, cdev->state will not be updated.
By using the tz->passive value as the "update" flag, the issue above can be solved, and the cooling devices can be updated only once when the temperature is low.
--- drivers/thermal/gov_power_allocator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/gov_power_allocator.c +1 -1
@@ -715,7 +715,7 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip_id) ret =__thermal_zone_get_trip (tz, params->trip_switch_on, &trip);if (!ret && (tz->temperature < trip.temperature)) { - update = (tz->last_temperature >= trip.temperature); + update = tz->passive; tz->passive =0 ;reset_pid_controller (params);allow_maximum_power (tz, update);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 286/331 mm: migrate: record the mlocked page status to remove unnecessary lru drain
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baolin Wang <[email protected]>
[ Upstream commit eebb3dabbb5cc590afe32880b5d3726d0fbf88db ]
When doing compaction, I found the lru_add_drain() is an obvious hotspot when migrating pages. The distribution of this hotspot is as follows:
- 18.75% compact_zone
- 17.39% migrate_pages
- 13.79% migrate_pages_batch
- 11.66% migrate_folio_move
- 7.02% lru_add_drain
+ 7.02% lru_add_drain_cpu
+ 3.00% move_to_new_folio
1.23% rmap_walk
+ 1.92% migrate_folio_unmap
+ 3.20% migrate_pages_sync
+ 0.90% isolate_migratepages
The lru_add_drain() was added by commit c3096e6782b7 ("mm/migrate:__unmap_and_move() push good newpage to LRU") to drain the newpage to LRU immediately, to help to build up the correct newpage->mlock_count in remove_migration_ptes() for mlocked pages. However, if there are no mlocked pages are migrating, then we can avoid this lru drain operation, especailly for the heavy concurrent scenarios.
So we can record the source pages' mlocked status in migrate_folio_unmap(), and only drain the lru list when the mlocked status is set in migrate_folio_move().
In addition, the page was already isolated from lru when migrating, so checking the mlocked status is stable by folio_test_mlocked() in migrate_folio_unmap().
After this patch, I can see the hotpot of the lru_add_drain() is gone:
- 9.41% migrate_pages_batch
- 6.15% migrate_folio_move
- 3.64% move_to_new_folio
+ 1.80% migrate_folio_extra
+ 1.70% buffer_migrate_folio
+ 1.41% rmap_walk
+ 0.62% folio_add_lru
+ 3.07% migrate_folio_unmap
Meanwhile, the compaction latency shows some improvements when running thpscale:
base patched Amean fault-both-1 1131.22 ( 0.00%) 1112.55 * 1.65%* Amean fault-both-3 2489.75 ( 0.00%) 2324.15 * 6.65%* Amean fault-both-5 3257.37 ( 0.00%) 3183.18 * 2.28%* Amean fault-both-7 4257.99 ( 0.00%) 4079.04 * 4.20%* Amean fault-both-12 6614.02 ( 0.00%) 6075.60 * 8.14%* Amean fault-both-18 10607.78 ( 0.00%) 8978.86 * 15.36%* Amean fault-both-24 14911.65 ( 0.00%) 11619.55 * 22.08%* Amean fault-both-30 14954.67 ( 0.00%) 14925.66 * 0.19%* Amean fault-both-32 16654.87 ( 0.00%) 15580.31 * 6.45%*
Stable-dep-of: d1adb25df711 ("mm: migrate: fix getting incorrect page mapping during page migration")
--- mm/migrate.c | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-)
mm/migrate.c +29 -19
@@ -1035,22 +1035,28 @@ union migration_ptr {struct anon_vma *anon_vma;struct address_space *mapping; }; + +enum { +PAGE_WAS_MAPPED =BIT (0 ), +PAGE_WAS_MLOCKED =BIT (1 ), +}; +static void __migrate_folio_record (struct folio *dst, -unsigned long page_was_mapped, +unsigned long old_page_state,struct anon_vma *anon_vma) {union migration_ptr ptr = { .anon_vma = anon_vma }; dst->mapping = ptr.mapping; - dst->private = (void *)page_was_mapped; + dst->private = (void *)old_page_state; }static void __migrate_folio_extract (struct folio *dst, -int *page_was_mappedp, +int *old_page_state,struct anon_vma **anon_vmap) {union migration_ptr ptr = { .mapping = dst->mapping }; *anon_vmap = ptr.anon_vma; - *page_was_mappedp = (unsigned long )dst->private; + *old_page_state = (unsigned long )dst->private; dst->mapping =NULL ; dst->private =NULL ; }
@@ -1111,7 +1117,7 @@ static int migrate_folio_unmap(new_folio_t get_new_folio, {struct folio *dst;int rc = -EAGAIN ; -int page_was_mapped =0 ; +int old_page_state =0 ;struct anon_vma *anon_vma =NULL ;bool is_lru = !__PageMovable (&src->page);bool locked = false;
@@ -1165,6 +1171,8 @@ static int migrate_folio_unmap(new_folio_t get_new_folio,folio_lock (src); } locked = true; +if (folio_test_mlocked (src)) + old_page_state |=PAGE_WAS_MLOCKED ;if (folio_test_writeback (src)) {/*
@@ -1214,7 +1222,7 @@ static int migrate_folio_unmap(new_folio_t get_new_folio, dst_locked = true;if (unlikely (!is_lru)) { -__migrate_folio_record (dst, page_was_mapped, anon_vma); +__migrate_folio_record (dst, old_page_state, anon_vma);return MIGRATEPAGE_UNMAP ; }
@@ -1240,11 +1248,11 @@ static int migrate_folio_unmap(new_folio_t get_new_folio,VM_BUG_ON_FOLIO (folio_test_anon (src) && !folio_test_ksm (src) && !anon_vma, src);try_to_migrate (src, mode ==MIGRATE_ASYNC ?TTU_BATCH_FLUSH :0 ); - page_was_mapped =1 ; + old_page_state |=PAGE_WAS_MAPPED ; }if (!folio_mapped (src)) { -__migrate_folio_record (dst, page_was_mapped, anon_vma); +__migrate_folio_record (dst, old_page_state, anon_vma);return MIGRATEPAGE_UNMAP ; }
@@ -1256,7 +1264,8 @@ static int migrate_folio_unmap(new_folio_t get_new_folio,if (rc == -EAGAIN ) ret =NULL ; -migrate_folio_undo_src (src, page_was_mapped, anon_vma, locked, ret); +migrate_folio_undo_src (src, old_page_state &PAGE_WAS_MAPPED , + anon_vma, locked, ret);migrate_folio_undo_dst (dst, dst_locked, put_new_folio, private);return rc;
@@ -1269,12 +1278,12 @@ static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private, struct list_head *ret) {int rc; -int page_was_mapped =0 ; +int old_page_state =0 ;struct anon_vma *anon_vma =NULL ;bool is_lru = !__PageMovable (&src->page);struct list_head *prev; -__migrate_folio_extract (dst, &page_was_mapped, &anon_vma); +__migrate_folio_extract (dst, &old_page_state, &anon_vma); prev = dst->lru.prev;list_del (&dst->lru);
@@ -1295,10 +1304,10 @@ static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,* isolated from the unevictable LRU: but this case is the easiest. */ folio_add_lru (dst); -if (page_was_mapped) +if (old_page_state &PAGE_WAS_MLOCKED )lru_add_drain (); -if (page_was_mapped) +if (old_page_state &PAGE_WAS_MAPPED )remove_migration_ptes (src, dst, false); out_unlock_both:
@@ -1330,11 +1339,12 @@ static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,*/ if (rc == -EAGAIN ) {list_add (&dst->lru, prev); -__migrate_folio_record (dst, page_was_mapped, anon_vma); +__migrate_folio_record (dst, old_page_state, anon_vma);return rc; } -migrate_folio_undo_src (src, page_was_mapped, anon_vma, true, ret); +migrate_folio_undo_src (src, old_page_state &PAGE_WAS_MAPPED , + anon_vma, true, ret);migrate_folio_undo_dst (dst, true, put_new_folio, private);return rc;
@@ -1802,12 +1812,12 @@ static int migrate_pages_batch(struct list_head *from, dst = list_first_entry(&dst_folios, struct folio, lru); dst2 =list_next_entry (dst, lru);list_for_each_entry_safe (folio, folio2, &unmap_folios, lru) { -int page_was_mapped =0 ; +int old_page_state =0 ;struct anon_vma *anon_vma =NULL ; -__migrate_folio_extract (dst, &page_was_mapped, &anon_vma); -migrate_folio_undo_src (folio, page_was_mapped, anon_vma, - true, ret_folios); +__migrate_folio_extract (dst, &old_page_state, &anon_vma); +migrate_folio_undo_src (folio, old_page_state &PAGE_WAS_MAPPED , + anon_vma, true, ret_folios);list_del (&dst->lru);migrate_folio_undo_dst (dst, true, put_new_folio, private); dst = dst2;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 287/331 mm: migrate: fix getting incorrect page mapping during page migration
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baolin Wang <[email protected]>
[ Upstream commit d1adb25df7111de83b64655a80b5a135adbded61 ]
When running stress-ng testing, we found below kernel crash after a few hours:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : dentry_name+0xd8/0x224 lr : pointer+0x22c/0x370 sp : ffff800025f134c0 ...... Call trace: dentry_name+0xd8/0x224 pointer+0x22c/0x370 vsnprintf+0x1ec/0x730 vscnprintf+0x2c/0x60 vprintk_store+0x70/0x234 vprintk_emit+0xe0/0x24c vprintk_default+0x3c/0x44 vprintk_func+0x84/0x2d0 printk+0x64/0x88 __dump_page+0x52c/0x530 dump_page+0x14/0x20 set_migratetype_isolate+0x110/0x224 start_isolate_page_range+0xc4/0x20c offline_pages+0x124/0x474 memory_block_offline+0x44/0xf4 memory_subsys_offline+0x3c/0x70 device_offline+0xf0/0x120 ......
After analyzing the vmcore, I found this issue is caused by page migration. The scenario is that, one thread is doing page migration, and we will use the target page's ->mapping field to save 'anon_vma' pointer between page unmap and page move, and now the target page is locked and refcount is 1.
Currently, there is another stress-ng thread performing memory hotplug, attempting to offline the target page that is being migrated. It discovers that the refcount of this target page is 1, preventing the offline operation, thus proceeding to dump the page. However, page_mapping() of the target page may return an incorrect file mapping to crash the system in dump_mapping(), since the target page->mapping only saves 'anon_vma' pointer without setting PAGE_MAPPING_ANON flag.
There are seveval ways to fix this issue:
(1) Setting the PAGE_MAPPING_ANON flag for target page's ->mapping when saving 'anon_vma', but this can confuse PageAnon() for PFN walkers, since the target page has not built mappings yet.
(2) Getting the page lock to call page_mapping() in __dump_page() to avoid crashing the system, however, there are still some PFN walkers that call page_mapping() without holding the page lock, such as compaction.
(3) Using target page->private field to save the 'anon_vma' pointer and 2 bits page state, just as page->mapping records an anonymous page, which can remove the page_mapping() impact for PFN walkers and also seems a simple way.
So I choose option 3 to fix this issue, and this can also fix other potential issues for PFN walkers, such as compaction.
--- mm/migrate.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-)
mm/migrate.c +10 -17
@@ -1026,38 +1026,31 @@ static int move_to_new_folio(struct folio *dst, struct folio *src, }/* -* To record some information during migration, we use some unused -* fields (mapping and private) of struct folio of the newly allocated -* destination folio. This is safe because nobody is using them -* except us. +* To record some information during migration, we use unused private +* field of struct folio of the newly allocated destination folio. +* This is safe because nobody is using it except us. */ -union migration_ptr { -struct anon_vma *anon_vma; -struct address_space *mapping; -}; -enum {PAGE_WAS_MAPPED =BIT (0 ),PAGE_WAS_MLOCKED =BIT (1 ), +PAGE_OLD_STATES =PAGE_WAS_MAPPED |PAGE_WAS_MLOCKED , };static void __migrate_folio_record (struct folio *dst, -unsigned long old_page_state, +int old_page_state,struct anon_vma *anon_vma) { -union migration_ptr ptr = { .anon_vma = anon_vma }; - dst->mapping = ptr.mapping; - dst->private = (void *)old_page_state; + dst->private = (void *)anon_vma + old_page_state; }static void __migrate_folio_extract (struct folio *dst,int *old_page_state,struct anon_vma **anon_vmap) { -union migration_ptr ptr = { .mapping = dst->mapping }; - *anon_vmap = ptr.anon_vma; - *old_page_state = (unsigned long )dst->private; - dst->mapping =NULL ; +unsigned long private = (unsigned long )dst->private; + + *anon_vmap = (struct anon_vma *)(private & ~PAGE_OLD_STATES ); + *old_page_state = private &PAGE_OLD_STATES ; dst->private =NULL ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 288/331 serial: core: Provide port lock wrappers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit b0af4bcb49464c221ad5f95d40f2b1b252ceedcc ]
When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console.
So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress.
All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure.
Provide wrapper functions for spin_[un]lock*(port->lock) invocations so that the console mechanics can be applied later on at a single place and does not require to copy the same logic all over the drivers.
Stable-dep-of: 9915753037eb ("serial: sc16is7xx: fix unconditional activation of THRI interrupt")
--- include/linux/serial_core.h | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+)
include/linux/serial_core.h +79 -0
@@ -588,6 +588,85 @@ struct uart_port {void *private_data;/* generic platform data pointer */ }; +/** +* uart_port_lock - Lock the UART port +* @up: Pointer to UART port structure +*/ +static inline void uart_port_lock (struct uart_port *up) +{ +spin_lock (&up->lock); +} + +/** +* uart_port_lock_irq - Lock the UART port and disable interrupts +* @up: Pointer to UART port structure +*/ +static inline void uart_port_lock_irq (struct uart_port *up) +{ +spin_lock_irq (&up->lock); +} + +/** +* uart_port_lock_irqsave - Lock the UART port, save and disable interrupts +* @up: Pointer to UART port structure +* @flags: Pointer to interrupt flags storage +*/ +static inline void uart_port_lock_irqsave (struct uart_port *up,unsigned long *flags) +{ +spin_lock_irqsave (&up->lock, *flags); +} + +/** +* uart_port_trylock - Try to lock the UART port +* @up: Pointer to UART port structure +* +* Returns: True if lock was acquired, false otherwise +*/ +static inline bool uart_port_trylock (struct uart_port *up) +{ +return spin_trylock (&up->lock); +} + +/** +* uart_port_trylock_irqsave - Try to lock the UART port, save and disable interrupts +* @up: Pointer to UART port structure +* @flags: Pointer to interrupt flags storage +* +* Returns: True if lock was acquired, false otherwise +*/ +static inline bool uart_port_trylock_irqsave (struct uart_port *up,unsigned long *flags) +{ +return spin_trylock_irqsave (&up->lock, *flags); +} + +/** +* uart_port_unlock - Unlock the UART port +* @up: Pointer to UART port structure +*/ +static inline void uart_port_unlock (struct uart_port *up) +{ +spin_unlock (&up->lock); +} + +/** +* uart_port_unlock_irq - Unlock the UART port and re-enable interrupts +* @up: Pointer to UART port structure +*/ +static inline void uart_port_unlock_irq (struct uart_port *up) +{ +spin_unlock_irq (&up->lock); +} + +/** +* uart_port_lock_irqrestore - Unlock the UART port, restore interrupts +* @up: Pointer to UART port structure +* @flags: The saved interrupt flags for restore +*/ +static inline void uart_port_unlock_irqrestore (struct uart_port *up,unsigned long flags) +{ +spin_unlock_irqrestore (&up->lock, flags); +} +static inline int serial_port_in (struct uart_port *up,int offset) {return up->serial_in (up, offset);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 289/331 serial: sc16is7xx: Use port lock wrappers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit b465848be8a652e2c5fefe102661fb660cff8497 ]
When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console.
So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress.
All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure.
To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms.
Converted with coccinelle. No functional change.
Stable-dep-of: 9915753037eb ("serial: sc16is7xx: fix unconditional activation of THRI interrupt")
--- drivers/tty/serial/sc16is7xx.c | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/tty/serial/sc16is7xx.c +20 -20
@@ -642,9 +642,9 @@ static void sc16is7xx_handle_tx(struct uart_port *port) }if (uart_circ_empty (xmit) ||uart_tx_stopped (port)) { -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_stop_tx (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags);return ; }
@@ -670,13 +670,13 @@ static void sc16is7xx_handle_tx(struct uart_port *port)sc16is7xx_fifo_write (port, to_send); } -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);if (uart_circ_empty (xmit))sc16is7xx_stop_tx (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static unsigned int sc16is7xx_get_hwmctrl (struct uart_port *port)
@@ -707,7 +707,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one) one->old_mctrl = status; -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);if ((changed &TIOCM_RNG ) && (status &TIOCM_RNG )) port->icount.rng++;if (changed &TIOCM_DSR )
@@ -718,7 +718,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one)uart_handle_cts_change (port, status &TIOCM_CTS );wake_up_interruptible (&port->state->port.delta_msr_wait); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static bool sc16is7xx_port_irq (struct sc16is7xx_port *s,int portno)
@@ -812,9 +812,9 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)sc16is7xx_handle_tx (port);mutex_unlock (&one->efr_lock); -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_ier_set (port,SC16IS7XX_IER_THRI_BIT ); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static void sc16is7xx_reconf_rs485 (struct uart_port *port)
@@ -825,14 +825,14 @@ static void sc16is7xx_reconf_rs485(struct uart_port *port)struct serial_rs485 *rs485 = &port->rs485;unsigned long irqflags; -spin_lock_irqsave (&port->lock, irqflags); +uart_port_lock_irqsave (port, &irqflags);if (rs485->flags &SER_RS485_ENABLED ) { efcr |=SC16IS7XX_EFCR_AUTO_RS485_BIT ;if (rs485->flags &SER_RS485_RTS_AFTER_SEND ) efcr |=SC16IS7XX_EFCR_RTS_INVERT_BIT ; } -spin_unlock_irqrestore (&port->lock, irqflags); +uart_port_unlock_irqrestore (port, irqflags);sc16is7xx_port_update (port,SC16IS7XX_EFCR_REG , mask, efcr); }
@@ -843,10 +843,10 @@ static void sc16is7xx_reg_proc(struct kthread_work *ws)struct sc16is7xx_one_config config;unsigned long irqflags; -spin_lock_irqsave (&one->port.lock, irqflags); +uart_port_lock_irqsave (&one->port, &irqflags); config = one->config;memset (&one->config,0 ,sizeof (one->config)); -spin_unlock_irqrestore (&one->port.lock, irqflags); +uart_port_unlock_irqrestore (&one->port, irqflags);if (config.flags &SC16IS7XX_RECONF_MD ) {u8 mcr =0 ;
@@ -952,18 +952,18 @@ static void sc16is7xx_throttle(struct uart_port *port)* value set in MCR register. Stop reading data from RX FIFO so the * AutoRTS feature will de-activate RTS output. */ -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_ier_clear (port,SC16IS7XX_IER_RDI_BIT ); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static void sc16is7xx_unthrottle (struct uart_port *port) {unsigned long flags; -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_ier_set (port,SC16IS7XX_IER_RDI_BIT ); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static unsigned int sc16is7xx_tx_empty (struct uart_port *port)
@@ -1101,7 +1101,7 @@ static void sc16is7xx_set_termios(struct uart_port *port,/* Setup baudrate generator */ baud =sc16is7xx_set_baud (port, baud); -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);/* Update timeout according to new baud rate */ uart_update_timeout (port, termios->c_cflag, baud);
@@ -1109,7 +1109,7 @@ static void sc16is7xx_set_termios(struct uart_port *port,if (UART_ENABLE_MS (port, termios->c_cflag))sc16is7xx_enable_ms (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); } static int sc16is7xx_config_rs485(struct uart_port *port, struct ktermios *termios,
@@ -1195,9 +1195,9 @@ static int sc16is7xx_startup(struct uart_port *port)sc16is7xx_port_write (port,SC16IS7XX_IER_REG , val);/* Enable modem status polling */ -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_enable_ms (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags);return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 290/331 serial: sc16is7xx: fix unconditional activation of THRI interrupt
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 9915753037eba7135b209fef4f2afeca841af816 ]
Commit cc4c1d05eb10 ("sc16is7xx: Properly resume TX after stop") changed behavior to unconditionnaly set the THRI interrupt in sc16is7xx_tx_proc().
For example when sending a 65 bytes message, and assuming the Tx FIFO is initially empty, sc16is7xx_handle_tx() will write the first 64 bytes of the message to the FIFO and sc16is7xx_tx_proc() will then activate THRI. When the THRI IRQ is fired, the driver will write the remaining byte of the message to the FIFO, and disable THRI by calling sc16is7xx_stop_tx().
When sending a 2 bytes message, sc16is7xx_handle_tx() will write the 2 bytes of the message to the FIFO and call sc16is7xx_stop_tx(), disabling THRI. After sc16is7xx_handle_tx() exits, control returns to sc16is7xx_tx_proc() which will unconditionally set THRI. When the THRI IRQ is fired, the driver simply acknowledges the interrupt and does nothing more, since all the data has already been written to the FIFO. This results in 2 register writes and 4 register reads all for nothing and taking precious cycles from the I2C/SPI bus.
Fix this by enabling the THRI interrupt only when we fill the Tx FIFO to its maximum capacity and there are remaining bytes to send in the message.
--- drivers/tty/serial/sc16is7xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/tty/serial/sc16is7xx.c +2 -5
@@ -676,6 +676,8 @@ static void sc16is7xx_handle_tx(struct uart_port *port)if (uart_circ_empty (xmit))sc16is7xx_stop_tx (port); +else +sc16is7xx_ier_set (port,SC16IS7XX_IER_THRI_BIT );uart_port_unlock_irqrestore (port, flags); }
@@ -802,7 +804,6 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws) {struct uart_port *port = &(to_sc16is7xx_one (ws, tx_work)->port);struct sc16is7xx_one *one =to_sc16is7xx_one (port, port); -unsigned long flags;if ((port->rs485.flags &SER_RS485_ENABLED ) && (port->rs485.delay_rts_before_send >0 ))
@@ -811,10 +812,6 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)mutex_lock (&one->efr_lock);sc16is7xx_handle_tx (port);mutex_unlock (&one->efr_lock); - -uart_port_lock_irqsave (port, &flags); -sc16is7xx_ier_set (port,SC16IS7XX_IER_THRI_BIT ); -uart_port_unlock_irqrestore (port, flags); }static void sc16is7xx_reconf_rs485 (struct uart_port *port)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 291/331 btrfs: zoned: factor out prepare_allocation_zoned()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naohiro Aota <[email protected]>
[ Upstream commit b271fee9a41ca1474d30639fd6cc912c9901d0f8 ]
Factor out prepare_allocation_zoned() for further extension. While at it, optimize the if-branch a bit.
Stable-dep-of: 02444f2ac26e ("btrfs: zoned: optimize hint byte for zoned allocator")
--- fs/btrfs/extent-tree.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-)
fs/btrfs/extent-tree.c +19 -13
@@ -4139,6 +4139,24 @@ static int prepare_allocation_clustered(struct btrfs_fs_info *fs_info,return 0 ; } +static int prepare_allocation_zoned (struct btrfs_fs_info *fs_info, +struct find_free_extent_ctl *ffe_ctl) +{ +if (ffe_ctl->for_treelog) { +spin_lock (&fs_info->treelog_bg_lock); +if (fs_info->treelog_bg) + ffe_ctl->hint_byte = fs_info->treelog_bg; +spin_unlock (&fs_info->treelog_bg_lock); + }else if (ffe_ctl->for_data_reloc) { +spin_lock (&fs_info->relocation_bg_lock); +if (fs_info->data_reloc_bg) + ffe_ctl->hint_byte = fs_info->data_reloc_bg; +spin_unlock (&fs_info->relocation_bg_lock); + } + +return 0 ; +} + static int prepare_allocation(struct btrfs_fs_info *fs_info, struct find_free_extent_ctl *ffe_ctl, struct btrfs_space_info *space_info,
@@ -4149,19 +4167,7 @@ static int prepare_allocation(struct btrfs_fs_info *fs_info,return prepare_allocation_clustered (fs_info, ffe_ctl, space_info, ins);case BTRFS_EXTENT_ALLOC_ZONED : -if (ffe_ctl->for_treelog) { -spin_lock (&fs_info->treelog_bg_lock); -if (fs_info->treelog_bg) - ffe_ctl->hint_byte = fs_info->treelog_bg; -spin_unlock (&fs_info->treelog_bg_lock); - } -if (ffe_ctl->for_data_reloc) { -spin_lock (&fs_info->relocation_bg_lock); -if (fs_info->data_reloc_bg) - ffe_ctl->hint_byte = fs_info->data_reloc_bg; -spin_unlock (&fs_info->relocation_bg_lock); - } -return 0 ; +return prepare_allocation_zoned (fs_info, ffe_ctl);default :BUG (); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 292/331 btrfs: zoned: optimize hint byte for zoned allocator
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naohiro Aota <[email protected]>
[ Upstream commit 02444f2ac26eae6385a65fcd66915084d15dffba ]
Writing sequentially to a huge file on btrfs on a SMR HDD revealed a decline of the performance (220 MiB/s to 30 MiB/s after 500 minutes).
The performance goes down because of increased latency of the extent allocation, which is induced by a traversing of a lot of full block groups.
So, this patch optimizes the ffe_ctl->hint_byte by choosing a block group with sufficient size from the active block group list, which does not contain full block groups.
After applying the patch, the performance is maintained well.
--- fs/btrfs/extent-tree.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
fs/btrfs/extent-tree.c +18 -0
@@ -4152,6 +4152,24 @@ static int prepare_allocation_zoned(struct btrfs_fs_info *fs_info,if (fs_info->data_reloc_bg) ffe_ctl->hint_byte = fs_info->data_reloc_bg;spin_unlock (&fs_info->relocation_bg_lock); + }else if (ffe_ctl->flags &BTRFS_BLOCK_GROUP_DATA ) { +struct btrfs_block_group *block_group; + +spin_lock (&fs_info->zone_active_bgs_lock); +list_for_each_entry (block_group, &fs_info->zone_active_bgs, active_bg_list) { +/* +* No lock is OK here because avail is monotinically +* decreasing, and this is just a hint. +*/ +u64 avail = block_group->zone_capacity - block_group->alloc_offset; + +if (block_group_bits (block_group, ffe_ctl->flags) && + avail >= ffe_ctl->num_bytes) { + ffe_ctl->hint_byte = block_group->start; +break ; + } + } +spin_unlock (&fs_info->zone_active_bgs_lock); }return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 293/331 drm/i915/lnl: Remove watchdog timers for PSR
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Kahola <[email protected]>
[ Upstream commit a2cd15c2411624a7a97bad60d98d7e0a1e5002a6 ]
Watchdog timers for Lunarlake HW were removed for PSR/PSR2 The patch removes the use of these timers from the driver code.
BSpec: 69895
v2: Reword commit message (Ville)
Drop HPD mask from LNL (Ville)
Revise masking logic (Jouni)
v3: Revise commit message (Ville)
Revert HPD mask removal as irrelevant for this patch (Ville)
Stable-dep-of: f9f031dd21a7 ("drm/i915/psr: Only allow PSR in LPSP mode on HSW non-ULT")
--- drivers/gpu/drm/i915/display/intel_psr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_psr.c +7 -3
@@ -674,7 +674,9 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp) val |=EDP_PSR_IDLE_FRAMES (psr_compute_idle_frames (intel_dp)); - val |=EDP_PSR_MAX_SLEEP_TIME (max_sleep_time); +if (DISPLAY_VER (dev_priv) <20 ) + val |=EDP_PSR_MAX_SLEEP_TIME (max_sleep_time); +if (IS_HASWELL (dev_priv)) val |=EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES ;
@@ -1399,8 +1401,10 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,*/ mask =EDP_PSR_DEBUG_MASK_MEMUP |EDP_PSR_DEBUG_MASK_HPD | -EDP_PSR_DEBUG_MASK_LPSP | -EDP_PSR_DEBUG_MASK_MAX_SLEEP ; +EDP_PSR_DEBUG_MASK_LPSP ; + +if (DISPLAY_VER (dev_priv) <20 ) + mask |=EDP_PSR_DEBUG_MASK_MAX_SLEEP ;/* * No separate pipe reg write mask on hsw/bdw, so have to unmask all
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 294/331 drm/i915/psr: Only allow PSR in LPSP mode on HSW non-ULT
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
[ Upstream commit f9f031dd21a7ce13a13862fa5281d32e1029c70f ]
On HSW non-ULT (or at least on Dell Latitude E6540) external displays start to flicker when we enable PSR on the eDP. We observe a much higher SR and PC6 residency than should be possible with an external display, and indeen much higher than what we observe with eDP disabled and only the external display enabled. Looks like the hardware is somehow ignoring the fact that the external display is active during PSR.
I wasn't able to redproduce this on my HSW ULT machine, or BDW. So either there's something specific about this particular laptop (eg. some unknown firmware thing) or the issue is limited to just non-ULT HSW systems. All known registers that could affect this look perfectly reasonable on the affected machine.
As a workaround let's unmask the LPSP event to prevent PSR entry except while in LPSP mode (only pipe A + eDP active). This will prevent PSR entry entirely when multiple pipes are active. The one slight downside is that we now also prevent PSR entry when driving eDP with pipe B or C, but I think that's a reasonable tradeoff to avoid having to implement a more complex workaround.
--- drivers/gpu/drm/i915/display/intel_psr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_psr.c +12 -2
@@ -1400,8 +1400,18 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,* can rely on frontbuffer tracking. */ mask =EDP_PSR_DEBUG_MASK_MEMUP | -EDP_PSR_DEBUG_MASK_HPD | -EDP_PSR_DEBUG_MASK_LPSP ; +EDP_PSR_DEBUG_MASK_HPD ; + +/* +* For some unknown reason on HSW non-ULT (or at least on +* Dell Latitude E6540) external displays start to flicker +* when PSR is enabled on the eDP. SR/PC6 residency is much +* higher than should be possible with an external display. +* As a workaround leave LPSP unmasked to prevent PSR entry +* when external displays are active. +*/ +if (DISPLAY_VER (dev_priv) >=8 ||IS_HASWELL_ULT (dev_priv)) + mask |=EDP_PSR_DEBUG_MASK_LPSP ;if (DISPLAY_VER (dev_priv) <20 ) mask |=EDP_PSR_DEBUG_MASK_MAX_SLEEP ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 295/331 drm/panel-edp: Add AUO B116XTN02, BOE NT116WHM-N21,836X2, NV116WHM-N49 V8.0
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sheng-Liang Pan <[email protected]>
[ Upstream commit 3db2420422a5912d97966e0176050bb0fc9aa63e ]
Add panel identification entry for
- AUO B116XTN02 family (product ID:0x235c)
- BOE NT116WHM-N21,836X2 (product ID:0x09c3)
- BOE NV116WHM-N49 V8.0 (product ID:0x0979)
Stable-dep-of: fc6e76792965 ("drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing")
--- drivers/gpu/drm/panel/panel-edp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/panel/panel-edp.c +3 -0
@@ -1840,6 +1840,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x145c , &delay_200_500_e50,"B116XAB01.4" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1e9b , &delay_200_500_e50,"B133UAN02.1" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1ea5 , &delay_200_500_e50,"B116XAK01.6" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"),
@@ -1848,8 +1849,10 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0786 , &delay_200_500_p2e80,"NV116WHM-T01" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x07d1 , &boe_nv133fhm_n61.delay,"NV133FHM-N61" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x082d , &boe_nv133fhm_n61.delay,"NV133FHM-N62" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09c3 , &delay_200_500_e50,"NT116WHM-N21,836X2" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x094b , &delay_200_500_e50,"NT116WHM-N21" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x095f , &delay_200_500_e50,"NE135FBM-N41 v8.1" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0979 , &delay_200_500_e50,"NV116WHM-N49 V8.0" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x098d , &boe_nv110wtm_n61.delay,"NV110WTM-N61" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09dd , &delay_200_500_e50,"NT116WHM-N21" ), EDP_PANEL_ENTRY('B', 'O', 'E', 0x0a5d, &delay_200_500_e50, "NV116WHM-N45"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 296/331 drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Yi Wang <[email protected]>
[ Upstream commit fc6e7679296530106ee0954e8ddef1aa58b2e0b5 ]
Rename AUO 0x405c B116XAK01 to B116XAK01.0 and adjust the timing ofauo_b116xak01: T3=200, T12=500, T7_max = 50 according to decoding edid and datasheet.
--- drivers/gpu/drm/panel/panel-edp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-edp.c +3 -1
@@ -973,6 +973,8 @@ static const struct panel_desc auo_b116xak01 = { }, .delay = { .hpd_absent = 200, + .unprepare = 500, + .enable = 50, }, };
@@ -1841,7 +1843,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1e9b , &delay_200_500_e50,"B133UAN02.1" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1ea5 , &delay_200_500_e50,"B116XAK01.6" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x615c , &delay_200_500_e50,"B116XAN06.1" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x8594, &delay_200_500_e50, "B133UAN01.0"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 297/331 drm/panel-edp: drm/panel-edp: Fix AUO B116XTN02 name
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Yi Wang <[email protected]>
[ Upstream commit 962845c090c4f85fa4f6872a5b6c89ee61f53cc0 ]
Rename AUO 0x235c B116XTN02 to B116XTN02.3 according to decoding edid.
--- drivers/gpu/drm/panel/panel-edp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-edp.c +1 -1
@@ -1842,7 +1842,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x145c , &delay_200_500_e50,"B116XAB01.4" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1e9b , &delay_200_500_e50,"B133UAN02.1" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1ea5 , &delay_200_500_e50,"B116XAK01.6" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02.3" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 298/331 drm/amdgpu/gfx10: set UNORD_DISPATCH in compute MQDs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 03ff6d7238b77e5fb2b85dc5fe01d2db9eb893bd ]
This needs to be set to 1 to avoid a potential deadlock in the GC 10.x and newer. On GC 9.x and older, this needs to be set to 0. This can lead to hangs in some mixed graphics and compute workloads. Updated firmware is also required for AQL.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
@@ -6572,7 +6572,7 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m,#ifdef __BIG_ENDIAN tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,ENDIAN_SWAP ,1 );#endif - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,0 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH ,0 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 );
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 -0
@@ -170,6 +170,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd, m->cp_hqd_pq_control =5 <<CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT ; m->cp_hqd_pq_control |=ffs (q->queue_size /sizeof (unsigned int )) -1 -1 ; + m->cp_hqd_pq_control |=CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK ;pr_debug ("cp_hqd_pq_control 0x%x\n" , m->cp_hqd_pq_control); m->cp_hqd_pq_base_lo =lower_32_bits ((uint64_t )q->queue_address >>8 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 299/331 drm/amdgpu/gfx11: set UNORD_DISPATCH in compute MQDs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 3380fcad2c906872110d31ddf7aa1fdea57f9df6 ]
This needs to be set to 1 to avoid a potential deadlock in the GC 10.x and newer. On GC 9.x and older, this needs to be set to 0. This can lead to hangs in some mixed graphics and compute workloads. Updated firmware is also required for AQL.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
@@ -3807,7 +3807,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m, (order_base_2(prop->queue_size / 4) - 1)); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,RPTR_BLOCK_SIZE , (order_base_2 (AMDGPU_GPU_PAGE_SIZE /4 ) -1 )); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,0 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH ,0 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 );
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 -0
@@ -224,6 +224,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd, m->cp_hqd_pq_control =5 <<CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT ; m->cp_hqd_pq_control |=ffs (q->queue_size /sizeof (unsigned int )) -1 -1 ; + m->cp_hqd_pq_control |=CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK ;pr_debug ("cp_hqd_pq_control 0x%x\n" , m->cp_hqd_pq_control); m->cp_hqd_pq_base_lo =lower_32_bits ((uint64_t )q->queue_address >>8 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 300/331 drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 024b32db43a359e0ded3fcc6cd86247cbbed4224 ]
Unlike what is claimed in commit f5aa7d46b0ee ("drm/bridge:
parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux"), if someone manually tries to do an AUX transfer (like via i2cdump ${bus} 0x50 i) while the panel is off we don't just get a simple transfer error. Instead, the whole ps8640 gets thrown for a loop and goes into a bad state.
Let's put the function to wait for the HPD (and the magical 50 ms after first reset) back in when we're doing an AUX transfer. This shouldn't actually make things much slower (assuming the panel is on) because we should immediately poll and see the HPD high. Mostly this is just an extra i2c transfer to the bridge.
--- drivers/gpu/drm/bridge/parade-ps8640.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/bridge/parade-ps8640.c +5 -0
@@ -346,6 +346,11 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux,int ret;pm_runtime_get_sync (dev); + ret =_ps8640_wait_hpd_asserted (ps_bridge,200 *1000 ); +if (ret) { +pm_runtime_put_sync_suspend (dev); +return ret; + } ret =ps8640_aux_transfer_msg (aux, msg);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 301/331 drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33]
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Niebel <[email protected]>
[ Upstream commit 45dd7df26cee741b31c25ffdd44fb8794eb45ccd ]
The DE signal is active high on this display, fill in the missing bus_flags. This aligns panel_desc with its display_timing.
--- drivers/gpu/drm/panel/panel-simple.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panel/panel-simple.c +2 -0
@@ -3782,6 +3782,7 @@ static const struct panel_desc tianma_tm070jdhg30 = { }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .connector_type = DRM_MODE_CONNECTOR_LVDS, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, };static const struct panel_desc tianma_tm070jvhg33 = {
@@ -3794,6 +3795,7 @@ static const struct panel_desc tianma_tm070jvhg33 = { }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .connector_type = DRM_MODE_CONNECTOR_LVDS, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, };static const struct display_timing tianma_tm070rvhg71_timing = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 302/331 drm/panel: samsung-s6d7aa0: drop DRM_BUS_FLAG_DE_HIGH for lsl080al02
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artur Weber <[email protected]>
[ Upstream commit 62b143b5ec4a14e1ae0dede5aabaf1832e3b0073 ]
It turns out that I had misconfigured the device I was using the panel with; the bus data polarity is not high for this panel, I had to change the config on the display controller's side.
Fix the panel config to properly reflect its accurate settings.
--- drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +1 -1
@@ -309,7 +309,7 @@ static const struct s6d7aa0_panel_desc s6d7aa0_lsl080al02_desc = { .off_func = s6d7aa0_lsl080al02_off, .drm_mode = &s6d7aa0_lsl080al02_mode, .mode_flags = MIPI_DSI_MODE_VSYNC_FLUSH | MIPI_DSI_MODE_VIDEO_NO_HFP, - .bus_flags = DRM_BUS_FLAG_DE_HIGH, + .bus_flags = 0, .has_backlight = false, .use_passwd3 = false,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 303/331 drm/bridge: sii902x: Fix probing race issue
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
[ Upstream commit 08ac6f132dd77e40f786d8af51140c96c6d739c9 ]
A null pointer dereference crash has been observed rarely on TI platforms using sii9022 bridge:
[ 53.271356] sii902x_get_edid+0x34/0x70 [sii902x] [ 53.276066] sii902x_bridge_get_edid+0x14/0x20 [sii902x] [ 53.281381] drm_bridge_get_edid+0x20/0x34 [drm] [ 53.286305] drm_bridge_connector_get_modes+0x8c/0xcc [drm_kms_helper] [ 53.292955] drm_helper_probe_single_connector_modes+0x190/0x538 [drm_kms_helper] [ 53.300510] drm_client_modeset_probe+0x1f0/0xbd4 [drm] [ 53.305958] __drm_fb_helper_initial_config_and_unlock+0x50/0x510 [drm_kms_helper] [ 53.313611] drm_fb_helper_initial_config+0x48/0x58 [drm_kms_helper] [ 53.320039] drm_fbdev_dma_client_hotplug+0x84/0xd4 [drm_dma_helper] [ 53.326401] drm_client_register+0x5c/0xa0 [drm] [ 53.331216] drm_fbdev_dma_setup+0xc8/0x13c [drm_dma_helper] [ 53.336881] tidss_probe+0x128/0x264 [tidss] [ 53.341174] platform_probe+0x68/0xc4 [ 53.344841] really_probe+0x188/0x3c4 [ 53.348501] __driver_probe_device+0x7c/0x16c [ 53.352854] driver_probe_device+0x3c/0x10c [ 53.357033] __device_attach_driver+0xbc/0x158 [ 53.361472] bus_for_each_drv+0x88/0xe8 [ 53.365303] __device_attach+0xa0/0x1b4 [ 53.369135] device_initial_probe+0x14/0x20 [ 53.373314] bus_probe_device+0xb0/0xb4 [ 53.377145] deferred_probe_work_func+0xcc/0x124 [ 53.381757] process_one_work+0x1f0/0x518 [ 53.385770] worker_thread+0x1e8/0x3dc [ 53.389519] kthread+0x11c/0x120 [ 53.392750] ret_from_fork+0x10/0x20
The issue here is as follows:
- tidss probes, but is deferred as sii902x is still missing.
- sii902x starts probing and enters sii902x_init().
- sii902x calls drm_bridge_add(). Now the sii902x bridge is ready from DRM's perspective.
- sii902x calls sii902x_audio_codec_init() and platform_device_register_data()
- The registration of the audio platform device causes probing of the deferred devices.
- tidss probes, which eventually causes sii902x_bridge_get_edid() to be called.
- sii902x_bridge_get_edid() tries to use the i2c to read the edid. However, the sii902x driver has not set up the i2c part yet, leading to the crash.
Fix this by moving the drm_bridge_add() to the end of the sii902x_init(), which is also at the very end of sii902x_probe().
--- drivers/gpu/drm/bridge/sii902x.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +16 -13
@@ -1080,16 +1080,6 @@ static int sii902x_init(struct sii902x *sii902x)return ret; } - sii902x->bridge.funcs = &sii902x_bridge_funcs; - sii902x->bridge.of_node = dev->of_node; - sii902x->bridge.timings = &default_sii902x_timings; - sii902x->bridge.ops =DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_EDID ; - -if (sii902x->i2c->irq >0 ) - sii902x->bridge.ops |=DRM_BRIDGE_OP_HPD ; - -drm_bridge_add (&sii902x->bridge); -sii902x_audio_codec_init (sii902x, dev);i2c_set_clientdata (sii902x->i2c, sii902x);
@@ -1102,7 +1092,21 @@ static int sii902x_init(struct sii902x *sii902x)return -ENOMEM ; sii902x->i2cmux->priv = sii902x; -return i2c_mux_add_adapter (sii902x->i2cmux,0 ,0 ,0 ); + ret =i2c_mux_add_adapter (sii902x->i2cmux,0 ,0 ,0 ); +if (ret) +return ret; + + sii902x->bridge.funcs = &sii902x_bridge_funcs; + sii902x->bridge.of_node = dev->of_node; + sii902x->bridge.timings = &default_sii902x_timings; + sii902x->bridge.ops =DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_EDID ; + +if (sii902x->i2c->irq >0 ) + sii902x->bridge.ops |=DRM_BRIDGE_OP_HPD ; + +drm_bridge_add (&sii902x->bridge); + +return 0 ; }static int sii902x_probe (struct i2c_client *client)
@@ -1170,12 +1174,11 @@ static int sii902x_probe(struct i2c_client *client) }static void sii902x_remove (struct i2c_client *client) - {struct sii902x *sii902x =i2c_get_clientdata (client); -i2c_mux_del_adapters (sii902x->i2cmux);drm_bridge_remove (&sii902x->bridge); +i2c_mux_del_adapters (sii902x->i2cmux); }static const struct of_device_id sii902x_dt_ids[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 304/331 drm/bridge: sii902x: Fix audio codec unregistration
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
[ Upstream commit 3fc6c76a8d208d3955c9e64b382d0ff370bc61fc ]
The driver never unregisters the audio codec platform device, which can lead to a crash on module reloading, nor does it handle the return value from sii902x_audio_codec_init().
--- drivers/gpu/drm/bridge/sii902x.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +17 -4
@@ -1080,7 +1080,9 @@ static int sii902x_init(struct sii902x *sii902x)return ret; } -sii902x_audio_codec_init (sii902x, dev); + ret =sii902x_audio_codec_init (sii902x, dev); +if (ret) +return ret;i2c_set_clientdata (sii902x->i2c, sii902x);
@@ -1088,13 +1090,15 @@ static int sii902x_init(struct sii902x *sii902x)1 ,0 ,I2C_MUX_GATE , sii902x_i2c_bypass_select, sii902x_i2c_bypass_deselect); -if (!sii902x->i2cmux) -return -ENOMEM ; +if (!sii902x->i2cmux) { + ret = -ENOMEM ; + goto err_unreg_audio; + } sii902x->i2cmux->priv = sii902x; ret =i2c_mux_add_adapter (sii902x->i2cmux,0 ,0 ,0 );if (ret) -return ret; + goto err_unreg_audio; sii902x->bridge.funcs = &sii902x_bridge_funcs; sii902x->bridge.of_node = dev->of_node;
@@ -1107,6 +1111,12 @@ static int sii902x_init(struct sii902x *sii902x)drm_bridge_add (&sii902x->bridge);return 0 ; + +err_unreg_audio: +if (!PTR_ERR_OR_ZERO (sii902x->audio.pdev)) +platform_device_unregister (sii902x->audio.pdev); + +return ret; }static int sii902x_probe (struct i2c_client *client)
@@ -1179,6 +1189,9 @@ static void sii902x_remove(struct i2c_client *client)drm_bridge_remove (&sii902x->bridge);i2c_mux_del_adapters (sii902x->i2cmux); + +if (!PTR_ERR_OR_ZERO (sii902x->audio.pdev)) +platform_device_unregister (sii902x->audio.pdev); }static const struct of_device_id sii902x_dt_ids[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 305/331 drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pin-yen Lin <[email protected]>
[ Upstream commit 26db46bc9c675e43230cc6accd110110a7654299 ]
The ps8640 bridge seems to expect everything to be power cycled at the disable process, but sometimes ps8640_aux_transfer() holds the runtime PM reference and prevents the bridge from suspend.
Prevent that by introducing a mutex lock between ps8640_aux_transfer() and .post_disable() to make sure the bridge is really powered off.
--- drivers/gpu/drm/bridge/parade-ps8640.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/bridge/parade-ps8640.c +16 -0
@@ -107,6 +107,7 @@ struct ps8640 {struct device_link *link;bool pre_enabled;bool need_post_hpd_delay; +struct mutex aux_lock; };static const struct regmap_config ps8640_regmap_config[] = {
@@ -345,6 +346,7 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux,struct device *dev = &ps_bridge->page[PAGE0_DP_CNTL ]->dev;int ret; +mutex_lock (&ps_bridge->aux_lock);pm_runtime_get_sync (dev); ret =_ps8640_wait_hpd_asserted (ps_bridge,200 *1000 );if (ret) {
@@ -354,6 +356,7 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, ret =ps8640_aux_transfer_msg (aux, msg);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); +mutex_unlock (&ps_bridge->aux_lock);return ret; }
@@ -475,7 +478,18 @@ static void ps8640_atomic_post_disable(struct drm_bridge *bridge, ps_bridge->pre_enabled = false;ps8640_bridge_vdo_control (ps_bridge,DISABLE ); + +/* +* The bridge seems to expect everything to be power cycled at the +* disable process, so grab a lock here to make sure +* ps8640_aux_transfer() is not holding a runtime PM reference and +* preventing the bridge from suspend. +*/ +mutex_lock (&ps_bridge->aux_lock); +pm_runtime_put_sync_suspend (&ps_bridge->page[PAGE0_DP_CNTL ]->dev); + +mutex_unlock (&ps_bridge->aux_lock); } static int ps8640_bridge_attach(struct drm_bridge *bridge,
@@ -624,6 +638,8 @@ static int ps8640_probe(struct i2c_client *client)if (!ps_bridge)return -ENOMEM ; +mutex_init (&ps_bridge->aux_lock); + ps_bridge->supplies[0 ].supply ="vdd12" ; ps_bridge->supplies[1 ].supply ="vdd33" ; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ps_bridge->supplies),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 306/331 drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit a20f1b02bafcbf5a32d96a1d4185d6981cf7d016 ]
After commit 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()"), if we hit the error case in ps8640_aux_transfer() then we return without dropping the mutex. Fix this oversight.
--- drivers/gpu/drm/bridge/parade-ps8640.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/parade-ps8640.c +3 -1
@@ -351,11 +351,13 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, ret =_ps8640_wait_hpd_asserted (ps_bridge,200 *1000 );if (ret) {pm_runtime_put_sync_suspend (dev); -return ret; + goto exit; } ret =ps8640_aux_transfer_msg (aux, msg);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); + +exit:mutex_unlock (&ps_bridge->aux_lock);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 307/331 memblock: fix crash when reserved memory is not added to memory
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yajun Deng <[email protected]>
[ Upstream commit 6a9531c3a88096a26cf3ac582f7ec44f94a7dcb2 ]
After commit 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()") nid of a reserved region is used by init_reserved_page() (with CONFIG_DEFERRED_STRUCT_PAGE_INIT=y) to access node strucure. In many cases the nid of the reserved memory is not set and this causes a crash.
When the nid of a reserved region is not set, fall back to early_pfn_to_nid(), so that nid of the first_online_node will be passed to init_reserved_page().
--- mm/memblock.c | 3 +++ 1 file changed, 3 insertions(+)
mm/memblock.c +3 -0
@@ -2119,6 +2119,9 @@ static void __init memmap_init_reserved_pages(void) start = region->base; end = start + region->size; +if (nid ==NUMA_NO_NODE || nid >=MAX_NUMNODES ) + nid =early_pfn_to_nid (PFN_DOWN (start)); +reserve_bootmem_region (start, end, nid); } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 308/331 drm/exynos: fix accidental on-stack copy of exynos_drm_plane
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 960b537e91725bcb17dd1b19e48950e62d134078 ]
gcc rightfully complains about excessive stack usage in the fimd_win_set_pixfmt() function:
drivers/gpu/drm/exynos/exynos_drm_fimd.c: In function 'fimd_win_set_pixfmt':drivers/gpu/drm/exynos/exynos_drm_fimd.c:750:1: error: the frame size of 1032 bytes is larger than 1024 byte drivers/gpu/drm/exynos/exynos5433_drm_decon.c: In function 'decon_win_set_pixfmt':drivers/gpu/drm/exynos/exynos5433_drm_decon.c:381:1: error: the frame size of 1032 bytes is larger than 1024 bytes
There is really no reason to copy the large exynos_drm_plane structure to the stack before using one of its members, so just use a pointer instead.
--- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +2 -2
@@ -319,9 +319,9 @@ static void decon_win_set_bldmod(struct decon_context *ctx, unsigned int win,static void decon_win_set_pixfmt (struct decon_context *ctx,unsigned int win,struct drm_framebuffer *fb) { -struct exynos_drm_plane plane = ctx->planes[win]; +struct exynos_drm_plane *plane = &ctx->planes[win];struct exynos_drm_plane_state *state = -to_exynos_plane_state (plane.base.state); +to_exynos_plane_state (plane->base.state);unsigned int alpha = state->base.alpha;unsigned int pixel_alpha;unsigned long val;
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -2
@@ -661,9 +661,9 @@ static void fimd_win_set_bldmod(struct fimd_context *ctx, unsigned int win,static void fimd_win_set_pixfmt (struct fimd_context *ctx,unsigned int win,struct drm_framebuffer *fb,int width) { -struct exynos_drm_plane plane = ctx->planes[win]; +struct exynos_drm_plane *plane = &ctx->planes[win];struct exynos_drm_plane_state *state = -to_exynos_plane_state (plane.base.state); +to_exynos_plane_state (plane->base.state);uint32_t pixel_format = fb->format->format;unsigned int alpha = state->base.alpha;u32 val = WINCONx_ENWIN;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 309/331 drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
[ Upstream commit 4050957c7c2c14aa795dbf423b4180d5ac04e113 ]
Do not forget to call clk_disable_unprepare() on the first element of ctx->clocks array.
Found by Linux Verification Center (linuxtesting.org).
--- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 -1
@@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)for (i =0 ; i < ctx->num_clocks; i++) { ret =clk_prepare_enable (ctx->clocks[i]);if (ret) { -while (--i >0 ) +while (--i >=0 )clk_disable_unprepare (ctx->clocks[i]);return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 310/331 firmware: arm_scmi: Use xa_insert() to store opps
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit e8ef4bbe39b9576a73f104f6af743fb9c7b624ba ]
When storing opps by level or index use xa_insert() instead of xa_store() and add error-checking to spot bad duplicates indexes possibly wrongly provided by the platform firmware.
--- drivers/firmware/arm_scmi/perf.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/firmware/arm_scmi/perf.c +18 -5
@@ -347,8 +347,8 @@ process_response_opp(struct scmi_opp *opp, unsigned int loop_idx, }static inline void -process_response_opp_v4 (struct perf_dom_info *dom,struct scmi_opp *opp, -unsigned int loop_idx, +process_response_opp_v4 (struct device *dev,struct perf_dom_info *dom, +struct scmi_opp *opp,unsigned int loop_idx,const struct scmi_msg_resp_perf_describe_levels_v4 *r) { opp->perf =le32_to_cpu (r->opp[loop_idx].perf_val);
@@ -359,10 +359,23 @@ process_response_opp_v4(struct perf_dom_info *dom, struct scmi_opp *opp,/* Note that PERF v4 reports always five 32-bit words */ opp->indicative_freq =le32_to_cpu (r->opp[loop_idx].indicative_freq);if (dom->level_indexing_mode) { +int ret; + opp->level_index =le32_to_cpu (r->opp[loop_idx].level_index); -xa_store (&dom->opps_by_idx, opp->level_index, opp,GFP_KERNEL ); -xa_store (&dom->opps_by_lvl, opp->perf, opp,GFP_KERNEL ); + ret =xa_insert (&dom->opps_by_idx, opp->level_index, opp, +GFP_KERNEL ); +if (ret) +dev_warn (dev, +"Failed to add opps_by_idx at %d - ret:%d\n" , + opp->level_index, ret); + + ret =xa_insert (&dom->opps_by_lvl, opp->perf, opp,GFP_KERNEL ); +if (ret) +dev_warn (dev, +"Failed to add opps_by_lvl at %d - ret:%d\n" , + opp->perf, ret); +hash_add (dom->opps_by_freq, &opp->hash, opp->indicative_freq); } }
@@ -379,7 +392,7 @@ iter_perf_levels_process_response(const struct scmi_protocol_handle *ph,if (PROTOCOL_REV_MAJOR (p->version) <=0x3 )process_response_opp (opp, st->loop_idx, response);else -process_response_opp_v4 (p->perf_dom, opp, st->loop_idx, +process_response_opp_v4 (ph->dev, p->perf_dom, opp, st->loop_idx, response); p->perf_dom->opp_count++;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 311/331 firmware: arm_scmi: Use xa_insert() when saving raw queues
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit b5dc0ffd36560dbadaed9a3d9fd7838055d62d74 ]
Use xa_insert() when saving per-channel raw queues to better check for duplicates.
--- drivers/firmware/arm_scmi/raw_mode.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/firmware/arm_scmi/raw_mode.c +8 -4
@@ -1111,7 +1111,6 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw,int i;for (i =0 ; i < num_chans; i++) { -void *xret;struct scmi_raw_queue *q; q =scmi_raw_queue_init (raw);
@@ -1120,13 +1119,12 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw, goto err_xa; } - xret =xa_store (&raw->chans_q, channels[i], q, + ret =xa_insert (&raw->chans_q, channels[i], q,GFP_KERNEL ); -if (xa_err (xret)) { +if (ret) {dev_err (dev,"Fail to allocate Raw queue 0x%02X\n" , channels[i]); - ret =xa_err (xret); goto err_xa; } }
@@ -1322,6 +1320,12 @@ void scmi_raw_message_report(void *r, struct scmi_xfer *xfer, dev = raw->handle->dev; q =scmi_raw_queue_select (raw, idx,SCMI_XFER_IS_CHAN_SET (xfer) ? chan_id :0 ); +if (!q) { +dev_warn (dev, +"RAW[%d] - NO queue for chan 0x%X. Dropping report.\n" , + idx, chan_id); +return ; + }/* * Grab the msg_q_lock upfront to avoid a possible race between
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 312/331 gpio: eic-sprd: Clear interrupt after set the interrupt type
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenhua Lin <[email protected]>
[ Upstream commit 84aef4ed59705585d629e81d633a83b7d416f5fb ]
The raw interrupt status of eic maybe set before the interrupt is enabled, since the eic interrupt has a latch function, which would trigger the interrupt event once enabled it from user side. To solve this problem, interrupts generated before setting the interrupt trigger type are ignored.
--- drivers/gpio/gpio-eic-sprd.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpio/gpio-eic-sprd.c +28 -4
@@ -321,20 +321,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)switch (flow_type) {case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IC ,1 );break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IC ,1 );break ;case IRQ_TYPE_EDGE_RISING :case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_EDGE_BOTH : state =sprd_eic_get (chip, offset); -if (state) +if (state) {sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,0 ); -else +sprd_eic_update (chip, offset, +SPRD_EIC_DBNC_IC ,1 ); + }else {sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,1 ); +sprd_eic_update (chip, offset, +SPRD_EIC_DBNC_IC ,1 ); + }break ;default :return -ENOTSUPP ;
@@ -346,20 +353,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)switch (flow_type) {case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTCLR ,1 );break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTCLR ,1 );break ;case IRQ_TYPE_EDGE_RISING :case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_EDGE_BOTH : state =sprd_eic_get (chip, offset); -if (state) +if (state) {sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,0 ); -else +sprd_eic_update (chip, offset, +SPRD_EIC_LATCH_INTCLR ,1 ); + }else {sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,1 ); +sprd_eic_update (chip, offset, +SPRD_EIC_LATCH_INTCLR ,1 ); + }break ;default :return -ENOTSUPP ;
@@ -373,29 +387,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_FALLING :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_BOTH :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;default :
@@ -408,29 +427,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_FALLING :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_BOTH :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;default :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 313/331 ARM: dts: exynos4212-tab3: add samsung,invert-vclk flag to fimd
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artur Weber <[email protected]>
[ Upstream commit eab4f56d3e75dad697acf8dc2c8be3c341d6c63e ]
After more investigation, I've found that it's not the panel driver config that needs to be modified to invert the data polarity, but the FIMD config.
Add the missing invert-vclk option that is required to get the display to work correctly.
--- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +1 -0
@@ -435,6 +435,7 @@ &exynos_usbphy { }; &fimd { + samsung,invert-vclk; status = "okay"; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 314/331 spi: intel-pci: Remove Meteor Lake-S SoC PCI ID from the list
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
[ Upstream commit 6c314425b9ef6b247cefd0903e287eb072580c3b ]
Turns out this "SoC" side controller does not support certain commands, such as reading chip JEDEC ID, so the controller is pretty much unusable in Linux. We should be using the "PCH" side controller instead. For this reason remove this PCI ID from the list.
--- drivers/spi/spi-intel-pci.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/spi-intel-pci.c +0 -1
@@ -84,7 +84,6 @@ static const struct pci_device_id intel_spi_pci_ids[] = { { PCI_VDEVICE(INTEL, 0xa2a4), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa324), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa3a4), (unsigned long)&cnl_info }, - { PCI_VDEVICE(INTEL, 0xae23), (unsigned long)&cnl_info }, { }, };MODULE_DEVICE_TABLE (pci, intel_spi_pci_ids);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 315/331 block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Lingfeng <[email protected]>
[ Upstream commit 7777f47f2ea64efd1016262e7b59fab34adfb869 ]
Commit 1a721de8489f ("block: don't add or resize partition on the disk with GENHD_FL_NO_PART") prevented all operations about partitions on disks with GENHD_FL_NO_PART in blkpg_do_ioctl() since they are meaningless. However, it changed error code in some scenarios. So move checking GENHD_FL_NO_PART to bdev_add_partition() to eliminate impact.
--- block/ioctl.c | 2 -- block/partitions/core.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-)
block/ioctl.c +0 -2
@@ -20,8 +20,6 @@ static int blkpg_do_ioctl(struct block_device *bdev,struct blkpg_partition p;sector_t start, length; -if (disk->flags &GENHD_FL_NO_PART ) -return -EINVAL ;if (!capable (CAP_SYS_ADMIN ))return -EACCES ;if (copy_from_user (&p, upart,sizeof (struct blkpg_partition )))
block/partitions/core.c +5 -0
@@ -458,6 +458,11 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, goto out; } +if (disk->flags &GENHD_FL_NO_PART ) { + ret = -EINVAL ; + goto out; + } +if (partition_overlaps (disk, start, length,-1 )) { ret = -EBUSY ; goto out;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 316/331 drm/bridge: anx7625: Ensure bridge is suspended in disable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Yi Wang <[email protected]>
[ Upstream commit 4d5b7daa3c610af3f322ad1e91fc0c752ff32f0e ]
Similar to commit 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()"). Add a mutex to ensure that aux transfer won't race with atomic_disable by holding the PM reference and prevent the bridge from suspend.
Also we need to use pm_runtime_put_sync_suspend() to suspend the bridge instead of idle with pm_runtime_put_sync().
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 7 ++++++- drivers/gpu/drm/bridge/analogix/anx7625.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +6 -1
@@ -1741,6 +1741,7 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux,u8 request = msg->request & ~DP_AUX_I2C_MOT ;int ret =0 ; +mutex_lock (&ctx->aux_lock);pm_runtime_get_sync (dev); msg->reply =0 ;switch (request) {
@@ -1757,6 +1758,7 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux, msg->size, msg->buffer);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); +mutex_unlock (&ctx->aux_lock);return ret; }
@@ -2453,7 +2455,9 @@ static void anx7625_bridge_atomic_disable(struct drm_bridge *bridge, ctx->connector =NULL ;anx7625_dp_stop (ctx); -pm_runtime_put_sync (dev); +mutex_lock (&ctx->aux_lock); +pm_runtime_put_sync_suspend (dev); +mutex_unlock (&ctx->aux_lock); } static enum drm_connector_status
@@ -2647,6 +2651,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)mutex_init (&platform->lock);mutex_init (&platform->hdcp_wq_lock); +mutex_init (&platform->aux_lock);INIT_DELAYED_WORK (&platform->hdcp_work, hdcp_check_work_func); platform->hdcp_workqueue =create_workqueue ("hdcp workqueue" );
drivers/gpu/drm/bridge/analogix/anx7625.h +2 -0
@@ -471,6 +471,8 @@ struct anx7625_data {struct workqueue_struct *hdcp_workqueue;/* Lock for hdcp work queue */ struct mutex hdcp_wq_lock; +/* Lock for aux transfer and disable */ +struct mutex aux_lock;char edid_block;struct display_timing dt;u8 display_timing_valid;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 317/331 cpufreq/amd-pstate: Fix setting scaling max/min freq values
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 22fb4f041999f5f16ecbda15a2859b4ef4cbf47e ]
Scaling min/max freq values were being cached and lagging a setting each time. Fix the ordering of the clamp call to ensure they work.
--- drivers/cpufreq/amd-pstate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/cpufreq/amd-pstate.c +3 -4
@@ -1232,14 +1232,13 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) max_limit_perf =div_u64 (policy->max * cpudata->highest_perf, cpudata->max_freq); min_limit_perf =div_u64 (policy->min * cpudata->highest_perf, cpudata->max_freq); +WRITE_ONCE (cpudata->max_limit_perf, max_limit_perf); +WRITE_ONCE (cpudata->min_limit_perf, min_limit_perf); + max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf, cpudata->max_limit_perf); min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, cpudata->max_limit_perf); - -WRITE_ONCE (cpudata->max_limit_perf, max_limit_perf); -WRITE_ONCE (cpudata->min_limit_perf, min_limit_perf); - value =READ_ONCE (cpudata->cppc_req_cached);if (cpudata->policy ==CPUFREQ_POLICY_PERFORMANCE )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 318/331 spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamal Dasu <[email protected]>
[ Upstream commit 574bf7bbe83794a902679846770f75a9b7f28176 ]
SFDP read shall use the mspi reads when using the bcm_qspi_exec_mem_op() call. This fixes SFDP parameter page read failures seen with parts that now use SFDP protocol to read the basic flash parameter table.
--- drivers/spi/spi-bcm-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-bcm-qspi.c +2 -2
@@ -19,7 +19,7 @@#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/spi/spi.h> -#include <linux/spi/spi-mem.h> +#include <linux/mtd/spi-nor.h> #include <linux/sysfs.h> #include <linux/types.h> #include "spi-bcm-qspi.h"
@@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,/* non-aligned and very short transfers are handled by MSPI */ if (!IS_ALIGNED ((uintptr_t )addr,4 ) || !IS_ALIGNED ((uintptr_t )buf,4 ) || - len <4 ) + len <4 || op->cmd.opcode ==SPINOR_OP_RDSFDP ) mspi_read = true;if (!has_bspi (qspi) || mspi_read)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 319/331 spi: spi-cadence: Reverse the order of interleaved write and read operations
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Kumar Mahapatra <[email protected]>
[ Upstream commit 633cd6fe6e1993ba80e0954c2db127a0b1a3e66f ]
In the existing implementation, when executing interleaved write and read operations in the ISR for a transfer length greater than the FIFO size, the TXFIFO write precedes the RXFIFO read. Consequently, the initially received data in the RXFIFO is pushed out and lost, leading to a failure in data integrity. To address this issue, reverse the order of interleaved operations and conduct the RXFIFO read followed by the TXFIFO write.
--- drivers/spi/spi-cadence.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/spi/spi-cadence.c +9 -8
@@ -317,6 +317,15 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx) xspi->rx_bytes -= nrx;while (ntx || nrx) { +if (nrx) { +u8 data =cdns_spi_read (xspi,CDNS_SPI_RXD ); + +if (xspi->rxbuf) + *xspi->rxbuf++ = data; + + nrx--; + } +if (ntx) {if (xspi->txbuf)cdns_spi_write (xspi,CDNS_SPI_TXD , *xspi->txbuf++);
@@ -326,14 +335,6 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx) ntx--; } -if (nrx) { -u8 data =cdns_spi_read (xspi,CDNS_SPI_RXD ); - -if (xspi->rxbuf) - *xspi->rxbuf++ = data; - - nrx--; - } } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 320/331 cifs: fix stray unlock in cifs_chan_skip_or_disable
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 993d1c346b1a51ac41b2193609a0d4e51e9748f4 ]
A recent change moved the code that decides to skip a channel or disable multichannel entirely, into a helper function.
During this, a mutex_unlock of the session_mutex
should have been removed. Doing that here.
--- fs/smb/client/smb2pdu.c | 1 - 1 file changed, 1 deletion(-)
fs/smb/client/smb2pdu.c +0 -1
@@ -195,7 +195,6 @@ cifs_chan_skip_or_disable(struct cifs_ses *ses, pserver = server->primary_server;cifs_signal_cifsd_for_reconnect (pserver, false); skip_terminate: -mutex_unlock (&ses->session_mutex);return -EHOSTDOWN ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 321/331 spi: fix finalize message on error return
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Lechner <[email protected]>
[ Upstream commit 8c2ae772fe08e33f3d7a83849e85539320701abd ]
In __spi_pump_transfer_message(), the message was not finalized in the first error return as it is in the other error return paths. Not finalizing the message could cause anything waiting on the message to complete to hang forever.
This adds the missing call to spi_finalize_current_message().
--- drivers/spi/spi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/spi/spi.c +4 -0
@@ -1624,6 +1624,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,pm_runtime_put_noidle (ctlr->dev.parent);dev_err (&ctlr->dev,"Failed to power device: %d\n" , ret); + + msg->status = ret; +spi_finalize_current_message (ctlr); +return ret; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 322/331 MIPS: lantiq: register smp_ops on non-smp platforms
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksander Jan Bajkowski <[email protected]>
[ Upstream commit 4bf2a626dc4bb46f0754d8ac02ec8584ff114ad5 ]
Lantiq uses a common kernel config for devices with 24Kc and 34Kc cores. The changes made previously to add support for interrupts on all cores work on 24Kc platforms with SMP disabled and 34Kc platforms with SMP enabled. This patch fixes boot issues on Danube (single core 24Kc) with SMP enabled.
--- arch/mips/lantiq/prom.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/mips/lantiq/prom.c +3 -4
@@ -108,10 +108,9 @@ void __init prom_init(void)prom_init_cmdline ();#if defined(CONFIG_MIPS_MT_SMP ) -if (cpu_has_mipsmt) { - lantiq_smp_ops = vsmp_smp_ops; + lantiq_smp_ops = vsmp_smp_ops; +if (cpu_has_mipsmt) lantiq_smp_ops.init_secondary = lantiq_init_secondary; -register_smp_ops (&lantiq_smp_ops); - } +register_smp_ops (&lantiq_smp_ops);#endif }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 323/331 drm: bridge: samsung-dsim: Dont use FORCE_STOP_STATE
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Walle <[email protected]>
[ Upstream commit ff3d5d04db07e5374758baa7e877fde8d683ebab ]
The FORCE_STOP_STATE bit is unsuitable to force the DSI link into LP-11 mode. It seems the bridge internally queues DSI packets and when the FORCE_STOP_STATE bit is cleared, they are sent in close succession without any useful timing (this also means that the DSI lanes won't go into LP-11 mode). The length of this gibberish varies between 1ms and 5ms. This sometimes breaks an attached bridge (TI SN65DSI84 in this case). In our case, the bridge will fail in about 1 per 500 reboots.
The FORCE_STOP_STATE handling was introduced to have the DSI lanes in LP-11 state during the .pre_enable phase. But as it turns out, none of this is needed at all. Between samsung_dsim_init() and samsung_dsim_set_display_enable() the lanes are already in LP-11 mode. The code as it was before commit 20c827683de0 ("drm: bridge:
samsung-dsim: Fix init during host transfer") and 0c14d3130654 ("drm:
bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec") was correct in this regard.
This patch basically reverts both commits. It was tested on an i.MX8M SoC with an SN65DSI84 bridge. The signals were probed and the DSI packets were decoded during initialization and link start-up. After this patch the first DSI packet on the link is a VSYNC packet and the timing is correct.
Command mode between .pre_enable and .enable was also briefly tested by a quick hack. There was no DSI link partner which would have responded, but it was made sure the DSI packet was send on the link. As a side note, the command mode seems to just work in HS mode. I couldn't find that the bridge will handle commands in LP mode.
--- drivers/gpu/drm/bridge/samsung-dsim.c | 32 ++------------------------- 1 file changed, 2 insertions(+), 30 deletions(-)
drivers/gpu/drm/bridge/samsung-dsim.c +2 -30
@@ -941,10 +941,6 @@ static int samsung_dsim_init_link(struct samsung_dsim *dsi) reg =samsung_dsim_read (dsi,DSIM_ESCMODE_REG ); reg &= ~DSIM_STOP_STATE_CNT_MASK ; reg |=DSIM_STOP_STATE_CNT (driver_data->reg_values[STOP_STATE_CNT ]); - -if (!samsung_dsim_hw_is_exynos (dsi->plat_data->hw_type)) - reg |=DSIM_FORCE_STOP_STATE ; -samsung_dsim_write (dsi,DSIM_ESCMODE_REG , reg); reg =DSIM_BTA_TIMEOUT (0xff ) |DSIM_LPDR_TIMEOUT (0xffff );
@@ -1401,18 +1397,6 @@ static void samsung_dsim_disable_irq(struct samsung_dsim *dsi)disable_irq (dsi->irq); } -static void samsung_dsim_set_stop_state (struct samsung_dsim *dsi,bool enable) -{ -u32 reg =samsung_dsim_read (dsi,DSIM_ESCMODE_REG ); - -if (enable) - reg |=DSIM_FORCE_STOP_STATE ; -else - reg &= ~DSIM_FORCE_STOP_STATE ; - -samsung_dsim_write (dsi,DSIM_ESCMODE_REG , reg); -} -static int samsung_dsim_init (struct samsung_dsim *dsi) {const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -1462,9 +1446,6 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, ret =samsung_dsim_init (dsi);if (ret)return ; - -samsung_dsim_set_display_mode (dsi); -samsung_dsim_set_display_enable (dsi, true); } }
@@ -1473,12 +1454,8 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, {struct samsung_dsim *dsi =bridge_to_dsi (bridge); -if (samsung_dsim_hw_is_exynos (dsi->plat_data->hw_type)) { -samsung_dsim_set_display_mode (dsi); -samsung_dsim_set_display_enable (dsi, true); - }else { -samsung_dsim_set_stop_state (dsi, false); - } +samsung_dsim_set_display_mode (dsi); +samsung_dsim_set_display_enable (dsi, true); dsi->state |=DSIM_STATE_VIDOUT_AVAILABLE ; }
@@ -1491,9 +1468,6 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge,if (!(dsi->state &DSIM_STATE_ENABLED ))return ; -if (!samsung_dsim_hw_is_exynos (dsi->plat_data->hw_type)) -samsung_dsim_set_stop_state (dsi, true); - dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE ; }
@@ -1795,8 +1769,6 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host,if (ret)return ret; -samsung_dsim_set_stop_state (dsi, false); - ret =mipi_dsi_create_packet (&xfer.packet, msg);if (ret <0 )return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 324/331 cxl/region:Fix overflow issue in alloc_hpa()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanquan Cao <[email protected]>
commit d76779dd3681c01a4c6c3cae4d0627c9083e0ee6 upstream.
Creating a region with 16 memory devices caused a problem. The div_u64_rem function, used for dividing an unsigned 64-bit number by a 32-bit one, faced an issue when SZ_256M * p->interleave_ways. The result surpassed the maximum limit of the 32-bit divisor (4G), leading to an overflow and a remainder of 0.
note: At this point, p->interleave_ways is 16, meaning 16 * 256M = 4G
To fix this issue, I replaced the div_u64_rem function with div64_u64_rem and adjusted the type of the remainder.
--- drivers/cxl/core/region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cxl/core/region.c +2 -2
@@ -525,7 +525,7 @@ static int alloc_hpa(struct cxl_region *struct cxl_root_decoder *cxlrd =to_cxl_root_decoder (cxlr->dev.parent);struct cxl_region_params *p = &cxlr->params;struct resource *res; -u32 remainder =0 ; +u64 remainder =0 ;lockdep_assert_held_write (&cxl_region_rwsem);
@@ -545,7 +545,7 @@ static int alloc_hpa(struct cxl_region * (cxlr->mode == CXL_DECODER_PMEM && uuid_is_null(&p->uuid)))return -ENXIO ; -div_u64_rem (size,SZ_256M * p->interleave_ways, &remainder); +div64_u64_rem (size, (u64 )SZ_256M * p->interleave_ways, &remainder);if (remainder)return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 325/331 mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xi Ruoyao <[email protected]>
commit 59be5c35850171e307ca5d3d703ee9ff4096b948 upstream.
If we still own the FPU after initializing fcr31, when we are preempted the dirty value in the FPU will be read out and stored into fcr31, clobbering our setting. This can cause an improper floating-point environment after execve(). For example:
zsh% cat measure.c
#include <fenv.h>
int main() { return fetestexcept(FE_INEXACT); } zsh% cc measure.c -o measure -lm
zsh% echo $((1.0/3)) # raising FE_INEXACT 0.33333333333333331
zsh% while ./measure; do ; done (stopped in seconds)
Call lose_fpu(0) before setting fcr31 to prevent this.
--- arch/mips/kernel/elf.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/mips/kernel/elf.c +6 -0
@@ -11,6 +11,7 @@#include <asm/cpu-features.h> #include <asm/cpu-info.h> +#include <asm/fpu.h> #ifdef CONFIG_MIPS_FP_SUPPORT
@@ -309,6 +310,11 @@ void mips_set_personality_nan(struct arcstruct cpuinfo_mips *c = &boot_cpu_data;struct task_struct *t = current; +/* Do this early so t->thread.fpu.fcr31 won't be clobbered in case +* we are preempted before the lose_fpu(0) in start_thread. +*/ +lose_fpu (0 ); + t->thread.fpu.fcr31 = c->fpu_csr31;switch (state->nan_2008) {case 0 :
Greg Kroah-Hartman
maintainerPATCH 326/331 genirq: Initialize resend_node hlist for all interrupt descriptors
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dawei Li <[email protected]>
commit b184c8c2889ceef0a137c7d0567ef9fe3d92276e upstream.
For a CONFIG_SPARSE_IRQ=n kernel, early_irq_init() is supposed to initialize all interrupt descriptors.
It does except for irq_desc::resend_node, which ia only initialized for the first descriptor.
Use the indexed decriptor and not the base pointer to address that.
--- kernel/irq/irqdesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irqdesc.c +1 -1
@@ -600,7 +600,7 @@ int __init early_irq_init(void)mutex_init (&desc[i].request_mutex);init_waitqueue_head (&desc[i].wait_for_threads);desc_set_defaults (i, &desc[i], node,NULL ,NULL ); -irq_resend_init (desc); +irq_resend_init (&desc[i]); }return arch_early_irq_init (); }
Greg Kroah-Hartman
maintainerPATCH 327/331 clocksource: Skip watchdog check for large watchdog intervals
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Wiesner <[email protected]>
commit 644649553508b9bacf0fc7a5bdc4f9e0165576a5 upstream.
There have been reports of the watchdog marking clocksources unstable on machines with 8 NUMA nodes:
clocksource: timekeeping watchdog on CPU373:
Marking clocksource 'tsc' as unstable because the skew is too large:
clocksource: 'hpet' wd_nsec: 14523447520
clocksource: 'tsc' cs_nsec: 14524115132
The measured clocksource skew - the absolute difference between cs_nsec and wd_nsec - was 668 microseconds:
cs_nsec - wd_nsec = 14524115132 - 14523447520 = 667612
The kernel used 200 microseconds for the uncertainty_margin of both the clocksource and watchdog, resulting in a threshold of 400 microseconds (the md variable). Both the cs_nsec and the wd_nsec value indicate that the readout interval was circa 14.5 seconds. The observed behaviour is that watchdog checks failed for large readout intervals on 8 NUMA node machines. This indicates that the size of the skew was directly proportinal to the length of the readout interval on those machines. The measured clocksource skew, 668 microseconds, was evaluated against a threshold (the md variable) that is suited for readout intervals of roughly WATCHDOG_INTERVAL, i.e. HZ >> 1, which is 0.5 second.
The intention of 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold") was to tighten the threshold for evaluating skew and set the lower bound for the uncertainty_margin of clocksources to twice WATCHDOG_MAX_SKEW. Later in c37e85c135ce ("clocksource: Loosen clocksource watchdog constraints"), the WATCHDOG_MAX_SKEW constant was increased to 125 microseconds to fit the limit of NTP, which is able to use a clocksource that suffers from up to 500 microseconds of skew per second. Both the TSC and the HPET use default uncertainty_margin. When the readout interval gets stretched the default uncertainty_margin is no longer a suitable lower bound for evaluating skew - it imposes a limit that is far stricter than the skew with which NTP can deal.
The root causes of the skew being directly proportinal to the length of the readout interval are:
* the inaccuracy of the shift/mult pairs of clocksources and the watchdog
* the conversion to nanoseconds is imprecise for large readout intervals
Prevent this by skipping the current watchdog check if the readout interval exceeds 2 * WATCHDOG_INTERVAL. Considering the maximum readout interval of 2 * WATCHDOG_INTERVAL, the current default uncertainty margin (of the TSC and HPET) corresponds to a limit on clocksource skew of 250 ppm (microseconds of skew per second). To keep the limit imposed by NTP (500 microseconds of skew per second) for all possible readout intervals, the margins would have to be scaled so that the threshold value is proportional to the length of the actual readout interval.
As for why the readout interval may get stretched: Since the watchdog is executed in softirq context the expiration of the watchdog timer can get severely delayed on account of a ksoftirqd thread not getting to run in a timely manner. Surely, a system with such belated softirq execution is not working well and the scheduling issue should be looked into but the clocksource watchdog should be able to deal with it accordingly.
--- kernel/time/clocksource.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
kernel/time/clocksource.c +24 -1
@@ -99,6 +99,7 @@ static u64 suspend_start;* Interval: 0.5sec. */ #define WATCHDOG_INTERVAL (HZ >> 1) +#define WATCHDOG_INTERVAL_MAX_NS ((2 * WATCHDOG_INTERVAL) * (NSEC_PER_SEC / HZ))/* * Threshold: 0.0312s, when doubled: 0.0625s.
@@ -134,6 +135,7 @@ static DECLARE_WORK(watchdog_work, clockstatic DEFINE_SPINLOCK (watchdog_lock);static int watchdog_running;static atomic_t watchdog_reset_pending; +static int64_t watchdog_max_interval;static inline void clocksource_watchdog_lock (unsigned long *flags) {
@@ -399,8 +401,8 @@ static inline void clocksource_reset_watstatic void clocksource_watchdog (struct timer_list *unused) {u64 csnow, wdnow, cslast, wdlast, delta; +int64_t wd_nsec, cs_nsec, interval;int next_cpu, reset_pending; -int64_t wd_nsec, cs_nsec;struct clocksource *cs;enum wd_read_status read_ret;unsigned long extra_wait =0 ;
@@ -470,6 +472,27 @@ static void clocksource_watchdog(structif (atomic_read (&watchdog_reset_pending))continue ; +/* +* The processing of timer softirqs can get delayed (usually +* on account of ksoftirqd not getting to run in a timely +* manner), which causes the watchdog interval to stretch. +* Skew detection may fail for longer watchdog intervals +* on account of fixed margins being used. +* Some clocksources, e.g. acpi_pm, cannot tolerate +* watchdog intervals longer than a few seconds. +*/ + interval =max (cs_nsec, wd_nsec); +if (unlikely (interval >WATCHDOG_INTERVAL_MAX_NS )) { +if (system_state >SYSTEM_SCHEDULING && + interval >2 * watchdog_max_interval) { + watchdog_max_interval = interval; +pr_warn ("Long readout interval, skipping watchdog check: cs_nsec: %lld wd_nsec: %lld\n" , + cs_nsec, wd_nsec); + } + watchdog_timer.expires = jiffies; +continue ; + } +/* Check the deviation from the watchdog clocksource. */ md = cs->uncertainty_margin + watchdog->uncertainty_margin;if (abs (cs_nsec - wd_nsec) > md) {
Greg Kroah-Hartman
maintainerPATCH 328/331 tick/sched: Preserve number of idle sleeps across CPU hotplug events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Chen <[email protected]>
commit 9a574ea9069be30b835a3da772c039993c43369b upstream.
Commit 71fee48f ("tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug") preserved total idle sleep time and iowait sleeptime across CPU hotplug events.
Similar reasoning applies to the number of idle calls and idle sleeps to get the proper average of sleep time per idle invocation.
Preserve those fields too.
--- kernel/time/tick-sched.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/time/tick-sched.c +5 -0
@@ -1548,6 +1548,7 @@ void tick_cancel_sched_timer(int cpu) {struct tick_sched *ts = &per_cpu (tick_cpu_sched, cpu);ktime_t idle_sleeptime, iowait_sleeptime; +unsigned long idle_calls, idle_sleeps;# ifdef CONFIG_HIGH_RES_TIMERS if (ts->sched_timer.base)
@@ -1556,9 +1557,13 @@ void tick_cancel_sched_timer(int cpu) idle_sleeptime = ts->idle_sleeptime; iowait_sleeptime = ts->iowait_sleeptime; + idle_calls = ts->idle_calls; + idle_sleeps = ts->idle_sleeps;memset (ts,0 ,sizeof (*ts)); ts->idle_sleeptime = idle_sleeptime; ts->iowait_sleeptime = iowait_sleeptime; + ts->idle_calls = idle_calls; + ts->idle_sleeps = idle_sleeps; }#endif
Greg Kroah-Hartman
maintainerPATCH 329/331 x86/entry/ia32: Ensure s32 is sign extended to s64
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Palethorpe <[email protected]>
commit 56062d60f117dccfb5281869e0ab61e090baf864 upstream.
Presently ia32 registers stored in ptregs are unconditionally cast to unsigned int by the ia32 stub. They are then cast to long when passed to __se_sys*, but will not be sign extended.
This takes the sign of the syscall argument into account in the ia32 stub. It still casts to unsigned int to avoid implementation specific behavior. However then casts to int or unsigned int as necessary. So that the following cast to long sign extends the value.
This fixes the io_pgetevents02 LTP test when compiled with -m32. Presently the systemcall io_pgetevents_time64() unexpectedly accepts -1 for the maximum number of events.
It doesn't appear other systemcalls with signed arguments are effected because they all have compat variants defined and wired up.
--- arch/x86/include/asm/syscall_wrapper.h | 25 +++++++++++++++++++++---- include/linux/syscalls.h | 1 + 2 files changed, 22 insertions(+), 4 deletions(-)
arch/x86/include/asm/syscall_wrapper.h +21 -4
@@ -58,12 +58,29 @@ extern long __ia32_sys_ni_syscall(const ,,regs->di,,regs->si,,regs->dx \ ,,regs->r10,,regs->r8,,regs->r9) \ + +/* SYSCALL_PT_ARGS is Adapted from s390x */ +#define SYSCALL_PT_ARG6 (m, t1, t2, t3, t4, t5, t6) \ + SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5), m(t6, (regs->bp)) +#define SYSCALL_PT_ARG5 (m, t1, t2, t3, t4, t5) \ + SYSCALL_PT_ARG4(m, t1, t2, t3, t4), m(t5, (regs->di)) +#define SYSCALL_PT_ARG4 (m, t1, t2, t3, t4) \ + SYSCALL_PT_ARG3(m, t1, t2, t3), m(t4, (regs->si)) +#define SYSCALL_PT_ARG3 (m, t1, t2, t3) \ + SYSCALL_PT_ARG2(m, t1, t2), m(t3, (regs->dx)) +#define SYSCALL_PT_ARG2 (m, t1, t2) \ + SYSCALL_PT_ARG1(m, t1), m(t2, (regs->cx)) +#define SYSCALL_PT_ARG1 (m, t1) m(t1, (regs->bx)) +#define SYSCALL_PT_ARGS (x, ...) SYSCALL_PT_ARG##x(__VA_ARGS__) + +#define __SC_COMPAT_CAST (t, a) \ + (__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U))) \ + (unsigned int)a +/* Mapping of registers to parameters for syscalls on i386 */ #define SC_IA32_REGS_TO_ARGS (x, ...) \ - __MAP(x,__SC_ARGS \ - ,,(unsigned int)regs->bx,,(unsigned int)regs->cx \ - ,,(unsigned int)regs->dx,,(unsigned int)regs->si \ - ,,(unsigned int)regs->di,,(unsigned int)regs->bp) + SYSCALL_PT_ARGS(x, __SC_COMPAT_CAST, \ + __MAP(x, __SC_TYPE, __VA_ARGS__)) \#define __SYS_STUB0 (abi, name) \ long __##abi##_##name(const struct pt_regs *regs); \
include/linux/syscalls.h +1 -0
@@ -125,6 +125,7 @@ struct cachestat;#define __TYPE_IS_LL (t) (__TYPE_AS(t, 0LL) || __TYPE_AS(t, 0ULL))#define __SC_LONG (t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a#define __SC_CAST (t, a) (__force t) a +#define __SC_TYPE (t, a) t#define __SC_ARGS (t, a) a#define __SC_TEST (t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long))
Greg Kroah-Hartman
maintainerPATCH 330/331 serial: core: fix kernel-doc for uart_port_unlock_irqrestore()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
commit 29bff582b74ed0bdb7e6986482ad9e6799ea4d2f upstream.
Fix the function name to avoid a kernel-doc warning:
include/linux/serial_core.h:666: warning: expecting prototype for uart_port_lock_irqrestore(). Prototype was for uart_port_unlock_irqrestore() instead
--- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/serial_core.h +1 -1
@@ -658,7 +658,7 @@ static inline void uart_port_unlock_irq( }/** -* uart_port_lock_irqrestore - Unlock the UART port, restore interrupts +* uart_port_unlock_irqrestore - Unlock the UART port, restore interrupts * @up: Pointer to UART port structure * @flags: The saved interrupt flags for restore */
Greg Kroah-Hartman
maintainerPATCH 331/331 thermal: trip: Drop lockdep assertion from thermal_zone_trip_id()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 108ffd12be24ba1d74b3314df8db32a0a6d55ba5 upstream.
The lockdep assertion in thermal_zone_trip_id() triggers when the trip point sysfs attribute of a thermal instance is read, because there is no thermal zone locking in that code path.
This is not verly useful, though, because there is no mechanism by which the location of the trips[] table in a thermal zone or its size can change after binding cooling devices to the trips in that thermal zone and before those cooling devices are unbound from them. Thus it is not in fact necessary to hold the thermal zone lock when thermal_zone_trip_id() is called from trip_point_show() and so the lockdep asserion in the former is invalid.
Accordingly, drop that lockdep assertion.
--- drivers/thermal/thermal_trip.c | 2 -- 1 file changed, 2 deletions(-)
drivers/thermal/thermal_trip.c +0 -2
@@ -178,8 +178,6 @@ int thermal_zone_trip_id(struct thermal_ {int i; -lockdep_assert_held (&tz->lock); -for (i =0 ; i < tz->num_trips; i++) {if (&tz->trips[i] == trip)return i;
Hello,
Quoted 5 lines · On Mon, 29 Jan 2024 09:01:04 -0800 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] 1ff49073b88b ("Linux 6.6.15-rc1")
Thanks,
SJ
[...]
---
[32m
ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: reclaim.sh
ok 11 selftests: damon: lru_sort.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m_remote_run_corr.sh SUCCESS
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my x86_64 and ARM64 test systems. No errors or regressions.
Thanks.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Successfully compiled and installed the kernel on my computer (Acer Aspire E15, Intel Core i3 Haswell). No noticeable regressions.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.
KernelCI report for stable-rc/linux-6.6.y for this week :-
## stable-rc HEAD for linux-6.6.y:
Date: 2024-01-30
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/log/?h=1ff49073b88be8a41ff42ecbbc2bb82e18783a7e
## Build failures:
No build failures seen for the stable-rc/linux-6.6.y commit head \o/
## Boot failures:
No **new** boot failures seen for the stable-rc/linux-6.6.y commit head \o/
Thanks,
Shreeya Patel
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
6.6.15-rc1 tested.
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
[ 0.000000] Linux version 6.6.15-rc1rv
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Tue Jan 30 20:22:49 JST 2024
Thanks
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.6:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 116 pass, 0 failLinux version: 6.6.15-rc1-g1ff49073b88b
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.6.15-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-6.6.y
* git commit: 1ff49073b88be8a41ff42ecbbc2bb82e18783a7e
* git describe: v6.6.14-332-g1ff49073b88b
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.14-332-g1ff49073b88b
## Test Regressions (compared to v6.6.13-581-g86b2b02ae53b)
## Metric Regressions (compared to v6.6.13-581-g86b2b02ae53b)
## Test Fixes (compared to v6.6.13-581-g86b2b02ae53b)
## Metric Fixes (compared to v6.6.13-581-g86b2b02ae53b)
## Test result summary
total: 155176, pass: 133177, fail: 2238, skip: 19572, xfail: 189
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 145 total, 144 passed, 1 failed
* arm64: 52 total, 49 passed, 3 failed
* i386: 41 total, 40 passed, 1 failed
* mips: 26 total, 26 passed, 0 failed
* parisc: 4 total, 4 passed, 0 failed
* powerpc: 36 total, 36 passed, 0 failed
* riscv: 25 total, 24 passed, 1 failed
* s390: 13 total, 13 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 8 total, 8 passed, 0 failed
* x86_64: 46 total, 44 passed, 2 failed
## Test suites summary
* boot
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-vm
* kselftest-watchdog
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* perf
* rcutorture
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.15 release. There are 331 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
No regressions found on WSL (x86 and arm64).
Built, booted, and reviewed dmesg.
Thank you.