5.19.2-rc1 review
Subsystems (12)
Greg Kroah-Hartman
maintainerPATCH 110/1157 ksmbd: prevent out of bound read for SMB2_WRITE
In reply to Greg Kroah-HartmanFrom: Hyunchul Lee <[email protected]>
commit ac60778b87e45576d7bfdbd6f53df902654e6f09 upstream.
OOB read memory can be written to a file,
if DataOffset is 0 and Length is too large
in SMB2_WRITE request of compound request.
To prevent this, when checking the length of the data area of SMB2_WRITE in smb2_get_data_area_len(), let the minimum of DataOffset be the size of SMB2 header + the size of SMB2_WRITE header.
This bug can lead an oops looking something like:
[ 798.008715] BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0xd3d/0x14b0 [ 798.008724] Read of size 252 at addr ffff88800f863e90 by task kworker/0:2/2859 ... [ 798.008754] Call Trace: [ 798.008756] <TASK> [ 798.008759] dump_stack_lvl+0x49/0x5f [ 798.008764] print_report.cold+0x5e/0x5cf [ 798.008768] ? __filemap_get_folio+0x285/0x6d0 [ 798.008774] ? copy_page_from_iter_atomic+0xd3d/0x14b0 [ 798.008777] kasan_report+0xaa/0x120 [ 798.008781] ? copy_page_from_iter_atomic+0xd3d/0x14b0 [ 798.008784] kasan_check_range+0x100/0x1e0 [ 798.008788] memcpy+0x24/0x60 [ 798.008792] copy_page_from_iter_atomic+0xd3d/0x14b0 [ 798.008795] ? pagecache_get_page+0x53/0x160 [ 798.008799] ? iov_iter_get_pages_alloc+0x1590/0x1590 [ 798.008803] ? ext4_write_begin+0xfc0/0xfc0 [ 798.008807] ? current_time+0x72/0x210 [ 798.008811] generic_perform_write+0x2c8/0x530 [ 798.008816] ? filemap_fdatawrite_wbc+0x180/0x180 [ 798.008820] ? down_write+0xb4/0x120 [ 798.008824] ? down_write_killable+0x130/0x130 [ 798.008829] ext4_buffered_write_iter+0x137/0x2c0 [ 798.008833] ext4_file_write_iter+0x40b/0x1490 [ 798.008837] ? __fsnotify_parent+0x275/0xb20 [ 798.008842] ? __fsnotify_update_child_dentry_flags+0x2c0/0x2c0 [ 798.008846] ? ext4_buffered_write_iter+0x2c0/0x2c0 [ 798.008851] __kernel_write+0x3a1/0xa70 [ 798.008855] ? __x64_sys_preadv2+0x160/0x160 [ 798.008860] ? security_file_permission+0x4a/0xa0 [ 798.008865] kernel_write+0xbb/0x360 [ 798.008869] ksmbd_vfs_write+0x27e/0xb90 [ksmbd] [ 798.008881] ? ksmbd_vfs_read+0x830/0x830 [ksmbd] [ 798.008892] ? _raw_read_unlock+0x2a/0x50 [ 798.008896] smb2_write+0xb45/0x14e0 [ksmbd] [ 798.008909] ? __kasan_check_write+0x14/0x20 [ 798.008912] ? _raw_spin_lock_bh+0xd0/0xe0 [ 798.008916] ? smb2_read+0x15e0/0x15e0 [ksmbd] [ 798.008927] ? memcpy+0x4e/0x60 [ 798.008931] ? _raw_spin_unlock+0x19/0x30 [ 798.008934] ? ksmbd_smb2_check_message+0x16af/0x2350 [ksmbd] [ 798.008946] ? _raw_spin_lock_bh+0xe0/0xe0 [ 798.008950] handle_ksmbd_work+0x30e/0x1020 [ksmbd] [ 798.008962] process_one_work+0x778/0x11c0 [ 798.008966] ? _raw_spin_lock_irq+0x8e/0xe0 [ 798.008970] worker_thread+0x544/0x1180 [ 798.008973] ? __cpuidle_text_end+0x4/0x4 [ 798.008977] kthread+0x282/0x320 [ 798.008982] ? process_one_work+0x11c0/0x11c0 [ 798.008985] ? kthread_complete_and_exit+0x30/0x30 [ 798.008989] ret_from_fork+0x1f/0x30 [ 798.008995] </TASK>
--- fs/ksmbd/smb2misc.c | 7 +++++-- fs/ksmbd/smb2pdu.c | 8 +++----- 2 files changed, 8 insertions(+), 7 deletions(-)
fs/ksmbd/smb2misc.c +5 -2
@@ -131,8 +131,11 @@ static int smb2_get_data_area_len(unsign *len =le16_to_cpu (((struct smb2_read_req *)hdr)->ReadChannelInfoLength);break ;case SMB2_WRITE : -if (((struct smb2_write_req *)hdr)->DataOffset) { - *off =le16_to_cpu (((struct smb2_write_req *)hdr)->DataOffset); +if (((struct smb2_write_req *)hdr)->DataOffset || + ((struct smb2_write_req *)hdr)->Length) { + *off = max_t(unsigned int, +le16_to_cpu (((struct smb2_write_req *)hdr)->DataOffset), + offsetof(struct smb2_write_req , Buffer)); *len =le32_to_cpu (((struct smb2_write_req *)hdr)->Length);break ; }
fs/ksmbd/smb2pdu.c +3 -5
@@ -6499,14 +6499,12 @@ int smb2_write(struct ksmbd_work *work) writethrough = true;if (is_rdma_channel == false) { -if ((u64 )le16_to_cpu (req->DataOffset) + length > -get_rfc1002_len (work->request_buf)) { -pr_err ("invalid write data offset %u, smb_len %u\n" , -le16_to_cpu (req->DataOffset), -get_rfc1002_len (work->request_buf)); +if (le16_to_cpu (req->DataOffset) < + offsetof(struct smb2_write_req , Buffer)) { err = -EINVAL ; goto out; } + data_buf = (char *)(((char *)&req->hdr.ProtocolId) +le16_to_cpu (req->DataOffset));
Greg Kroah-Hartman
maintainerPATCH 111/1157 ksmbd: fix use-after-free bug in smb2_tree_disconect
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit cf6531d98190fa2cf92a6d8bbc8af0a4740a223c upstream.
smb2_tree_disconnect() freed the struct ksmbd_tree_connect, but it left the dangling pointer. It can be accessed again under compound requests.
This bug can lead an oops looking something link:
[ 1685.468014 ] BUG: KASAN: use-after-free in ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd] [ 1685.468068 ] Read of size 4 at addr ffff888102172180 by task kworker/1:2/4807
...
[ 1685.468130 ] Call Trace:
[ 1685.468132 ] <TASK> [ 1685.468135 ] dump_stack_lvl+0x49/0x5f [ 1685.468141 ] print_report.cold+0x5e/0x5cf [ 1685.468145 ] ? ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd] [ 1685.468157 ] kasan_report+0xaa/0x120 [ 1685.468194 ] ? ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd] [ 1685.468206 ] __asan_report_load4_noabort+0x14/0x20 [ 1685.468210 ] ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd] [ 1685.468222 ] smb2_tree_disconnect+0x175/0x250 [ksmbd] [ 1685.468235 ] handle_ksmbd_work+0x30e/0x1020 [ksmbd] [ 1685.468247 ] process_one_work+0x778/0x11c0 [ 1685.468251 ] ? _raw_spin_lock_irq+0x8e/0xe0 [ 1685.468289 ] worker_thread+0x544/0x1180 [ 1685.468293 ] ? __cpuidle_text_end+0x4/0x4 [ 1685.468297 ] kthread+0x282/0x320 [ 1685.468301 ] ? process_one_work+0x11c0/0x11c0 [ 1685.468305 ] ? kthread_complete_and_exit+0x30/0x30 [ 1685.468309 ] ret_from_fork+0x1f/0x30
--- fs/ksmbd/smb2pdu.c | 1 + 1 file changed, 1 insertion(+)
fs/ksmbd/smb2pdu.c +1 -0
@@ -2043,6 +2043,7 @@ int smb2_tree_disconnect(struct ksmbd_woksmbd_close_tree_conn_fds (work);ksmbd_tree_conn_disconnect (sess, tcon); + work->tcon =NULL ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 112/1157 ksmbd: fix heap-based overflow in set_ntacl_dacl()
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 8f0541186e9ad1b62accc9519cc2b7a7240272a7 upstream.
The testcase use SMB2_SET_INFO_HE command to set a malformed file attribute under the label security.NTACL. SMB2_QUERY_INFO_HE command in testcase trigger the following overflow.
[ 4712.003781] ================================================================== [ 4712.003790] BUG: KASAN: slab-out-of-bounds in build_sec_desc+0x842/0x1dd0 [ksmbd] [ 4712.003807] Write of size 1060 at addr ffff88801e34c068 by task kworker/0:0/4190
[ 4712.003813] CPU: 0 PID: 4190 Comm: kworker/0:0 Not tainted 5.19.0-rc5 #1 [ 4712.003850] Workqueue: ksmbd-io handle_ksmbd_work [ksmbd] [ 4712.003867] Call Trace: [ 4712.003870] <TASK> [ 4712.003873] dump_stack_lvl+0x49/0x5f [ 4712.003935] print_report.cold+0x5e/0x5cf [ 4712.003972] ? ksmbd_vfs_get_sd_xattr+0x16d/0x500 [ksmbd] [ 4712.003984] ? cmp_map_id+0x200/0x200 [ 4712.003988] ? build_sec_desc+0x842/0x1dd0 [ksmbd] [ 4712.004000] kasan_report+0xaa/0x120 [ 4712.004045] ? build_sec_desc+0x842/0x1dd0 [ksmbd] [ 4712.004056] kasan_check_range+0x100/0x1e0 [ 4712.004060] memcpy+0x3c/0x60 [ 4712.004064] build_sec_desc+0x842/0x1dd0 [ksmbd] [ 4712.004076] ? parse_sec_desc+0x580/0x580 [ksmbd] [ 4712.004088] ? ksmbd_acls_fattr+0x281/0x410 [ksmbd] [ 4712.004099] smb2_query_info+0xa8f/0x6110 [ksmbd] [ 4712.004111] ? psi_group_change+0x856/0xd70 [ 4712.004148] ? update_load_avg+0x1c3/0x1af0 [ 4712.004152] ? asym_cpu_capacity_scan+0x5d0/0x5d0 [ 4712.004157] ? xas_load+0x23/0x300 [ 4712.004162] ? smb2_query_dir+0x1530/0x1530 [ksmbd] [ 4712.004173] ? _raw_spin_lock_bh+0xe0/0xe0 [ 4712.004179] handle_ksmbd_work+0x30e/0x1020 [ksmbd] [ 4712.004192] process_one_work+0x778/0x11c0 [ 4712.004227] ? _raw_spin_lock_irq+0x8e/0xe0 [ 4712.004231] worker_thread+0x544/0x1180 [ 4712.004234] ? __cpuidle_text_end+0x4/0x4 [ 4712.004239] kthread+0x282/0x320 [ 4712.004243] ? process_one_work+0x11c0/0x11c0 [ 4712.004246] ? kthread_complete_and_exit+0x30/0x30 [ 4712.004282] ret_from_fork+0x1f/0x30
This patch add the buffer validation for security descriptor that is stored by malformed SMB2_SET_INFO_HE command. and allocate large response buffer about SMB2_O_INFO_SECURITY file info class.
--- fs/ksmbd/smb2pdu.c | 39 ++++++++++----- fs/ksmbd/smbacl.c | 130 +++++++++++++++++++++++++++++++++++------------------ fs/ksmbd/smbacl.h | 2 fs/ksmbd/vfs.c | 5 ++ 4 files changed, 119 insertions(+), 57 deletions(-)
fs/ksmbd/smb2pdu.c +25 -14
@@ -535,9 +535,10 @@ int smb2_allocate_rsp_buf(struct ksmbd_wstruct smb2_query_info_req *req; req =smb2_get_msg (work->request_buf); -if (req->InfoType ==SMB2_O_INFO_FILE && - (req->FileInfoClass ==FILE_FULL_EA_INFORMATION || - req->FileInfoClass ==FILE_ALL_INFORMATION )) +if ((req->InfoType ==SMB2_O_INFO_FILE && + (req->FileInfoClass ==FILE_FULL_EA_INFORMATION || + req->FileInfoClass ==FILE_ALL_INFORMATION )) || + req->InfoType ==SMB2_O_INFO_SECURITY ) sz = large_sz; }
@@ -2974,7 +2975,7 @@ int smb2_open(struct ksmbd_work *work) goto err_out; rc = build_sec_desc(user_ns, - pntsd, NULL, + pntsd, NULL, 0, OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO,
@@ -3819,6 +3820,15 @@ static int verify_info_level(int info_lereturn 0 ; } +static int smb2_resp_buf_len (struct ksmbd_work *work,unsigned short hdr2_len) +{ +int free_len; + + free_len = (int )(work->response_sz - + (get_rfc1002_len (work->response_buf) +4 )) - hdr2_len; +return free_len; +} +static int smb2_calc_max_out_buf_len (struct ksmbd_work *work,unsigned short hdr2_len,unsigned int out_buf_len)
@@ -3828,9 +3838,7 @@ static int smb2_calc_max_out_buf_len(strif (out_buf_len > work->conn->vals->max_trans_size)return -EINVAL ; - free_len = (int )(work->response_sz - - (get_rfc1002_len (work->response_buf) +4 )) - - hdr2_len; + free_len =smb2_resp_buf_len (work, hdr2_len);if (free_len <0 )return -EINVAL ;
@@ -5093,10 +5101,10 @@ static int smb2_get_info_sec(struct ksmbstruct smb_ntsd *pntsd = (struct smb_ntsd *)rsp->Buffer, *ppntsd =NULL ;struct smb_fattr fattr = {{0 }};struct inode *inode; -__u32 secdesclen; +__u32 secdesclen =0 ;unsigned int id =KSMBD_NO_FID , pid =KSMBD_NO_FID ;int addition_info =le32_to_cpu (req->AdditionalInformation); -int rc; +int rc =0 , ppntsd_size =0 ; if (addition_info & ~(OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO | PROTECTED_DACL_SECINFO |
@@ -5142,11 +5150,14 @@ static int smb2_get_info_sec(struct ksmbif (test_share_config_flag (work->tcon->share_conf,KSMBD_SHARE_FLAG_ACL_XATTR )) -ksmbd_vfs_get_sd_xattr (work->conn, user_ns, - fp->filp->f_path.dentry, &ppntsd); - - rc =build_sec_desc (user_ns, pntsd, ppntsd, addition_info, - &secdesclen, &fattr); + ppntsd_size =ksmbd_vfs_get_sd_xattr (work->conn, user_ns, + fp->filp->f_path.dentry, + &ppntsd); + +/* Check if sd buffer size exceeds response buffer size */ +if (smb2_resp_buf_len (work,8 ) > ppntsd_size) + rc =build_sec_desc (user_ns, pntsd, ppntsd, ppntsd_size, + addition_info, &secdesclen, &fattr);posix_acl_release (fattr.cf_acls);posix_acl_release (fattr.cf_dacls);kfree (ppntsd);
fs/ksmbd/smbacl.c +88 -42
238 lines not on this page · raw message
fs/ksmbd/smbacl.h +1 -1
@@ -193,7 +193,7 @@ struct posix_acl_state {int parse_sec_desc (struct user_namespace *user_ns,struct smb_ntsd *pntsd,int acl_len,struct smb_fattr *fattr);int build_sec_desc (struct user_namespace *user_ns,struct smb_ntsd *pntsd, -struct smb_ntsd *ppntsd,int addition_info, +struct smb_ntsd *ppntsd,int ppntsd_size,int addition_info,__u32 *secdesclen,struct smb_fattr *fattr);int init_acl_state (struct posix_acl_state *state,int cnt);void free_acl_state (struct posix_acl_state *state);
fs/ksmbd/vfs.c +5 -0
@@ -1540,6 +1540,11 @@ int ksmbd_vfs_get_sd_xattr(struct ksmbd_ } *pntsd = acl.sd_buf; +if (acl.sd_size <sizeof (struct smb_ntsd )) { +pr_err ("sd size is invalid\n" ); + goto out_free; + } + (*pntsd)->osidoffset =cpu_to_le32 (le32_to_cpu ((*pntsd)->osidoffset) -NDR_NTSD_OFFSETOF ); (*pntsd)->gsidoffset = cpu_to_le32(le32_to_cpu((*pntsd)->gsidoffset) -
Greg Kroah-Hartman
maintainerPATCH 113/1157 fuse: limit nsec
In reply to Greg Kroah-HartmanFrom: Miklos Szeredi <[email protected]>
commit 47912eaa061a6a81e4aa790591a1874c650733c0 upstream.
Limit nanoseconds to 0..999999999.
--- fs/fuse/inode.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/fuse/inode.c +6 -0
@@ -180,6 +180,12 @@ void fuse_change_attributes_common(struc inode->i_uid =make_kuid (fc->user_ns, attr->uid); inode->i_gid =make_kgid (fc->user_ns, attr->gid); inode->i_blocks = attr->blocks; + +/* Sanitize nsecs */ + attr->atimensec =min_t (u32, attr->atimensec,NSEC_PER_SEC -1 ); + attr->mtimensec =min_t (u32, attr->mtimensec,NSEC_PER_SEC -1 ); + attr->ctimensec =min_t (u32, attr->ctimensec,NSEC_PER_SEC -1 ); + inode->i_atime.tv_sec = attr->atime; inode->i_atime.tv_nsec = attr->atimensec;/* mtime from server may be stale due to local buffered write */
Greg Kroah-Hartman
maintainerPATCH 114/1157 fuse: ioctl: translate ENOSYS
In reply to Greg Kroah-HartmanFrom: Miklos Szeredi <[email protected]>
commit 02c0cab8e7345b06f1c0838df444e2902e4138d3 upstream.
Overlayfs may fail to complete updates when a filesystem lacks fileattr/xattr syscall support and responds with an ENOSYS error code, resulting in an unexpected "Function not implemented" error.
This bug may occur with FUSE filesystems, such as davfs2.
Steps to reproduce:
# install davfs2, e.g., apk add davfs2 mkdir /test mkdir /test/lower /test/upper /test/work /test/mnt yes '' | mount -t davfs -o ro http://some-web-dav-server/path \ /test/lower mount -t overlay -o upperdir=/test/upper,lowerdir=/test/lower \ -o workdir=/test/work overlay /test/mnt
# when "some-file" exists in the lowerdir, this fails with "Function # not implemented", with dmesg showing "overlayfs: failed to retrieve # lower fileattr (/some-file, err=-38)" touch /test/mnt/some-file
The underlying cause of this regresion is actually in FUSE, which fails to translate the ENOSYS error code returned by userspace filesystem (which means that the ioctl operation is not supported) to ENOTTY.
--- fs/fuse/ioctl.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
fs/fuse/ioctl.c +13 -2
@@ -9,6 +9,17 @@#include <linux/compat.h> #include <linux/fileattr.h> +static ssize_t fuse_send_ioctl (struct fuse_mount *fm,struct fuse_args *args) +{ +ssize_t ret =fuse_simple_request (fm, args); + +/* Translate ENOSYS, which shouldn't be returned from fs */ +if (ret == -ENOSYS ) + ret = -ENOTTY ; + +return ret; +} +/* * CUSE servers compiled on 32bit broke on 64bit kernels because the * ABI was defined to be 'struct iovec' which is different on 32bit
@@ -259,7 +270,7 @@ long fuse_do_ioctl(struct file *file, un ap.args.out_pages = true; ap.args.out_argvar = true; - transferred =fuse_simple_request (fm, &ap.args); + transferred =fuse_send_ioctl (fm, &ap.args); err = transferred;if (transferred <0 ) goto out;
@@ -393,7 +404,7 @@ static int fuse_priv_ioctl(struct inode args.out_args[1 ].size = inarg.out_size; args.out_args[1 ].value = ptr; - err =fuse_simple_request (fm, &args); + err =fuse_send_ioctl (fm, &args);if (!err) {if (outarg.result <0 ) err = outarg.result;
Greg Kroah-Hartman
maintainerPATCH 115/1157 fuse: write inode in fuse_release()
In reply to Greg Kroah-HartmanFrom: Miklos Szeredi <[email protected]>
commit 035ff33cf4db101250fb980a3941bf078f37a544 upstream.
A race between write(2) and close(2) allows pages to be dirtied after fuse_flush -> write_inode_now(). If these pages are not flushed from fuse_release(), then there might not be a writable open file later. So any remaining dirty pages must be written back before the file is released.
This is a partial revert of the blamed commit.
--- fs/fuse/file.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/fuse/file.c +9 -0
@@ -338,6 +338,15 @@ static int fuse_open(struct inode *inodestatic int fuse_release (struct inode *inode,struct file *file) { +struct fuse_conn *fc =get_fuse_conn (inode); + +/* +* Dirty pages might remain despite write_inode_now() call from +* fuse_flush() due to writes racing with the close. +*/ +if (fc->writeback_cache) +write_inode_now (inode,1 ); +fuse_release_common (file, false);/* return value is ignored by VFS */
Greg Kroah-Hartman
maintainerPATCH 116/1157 fuse: fix deadlock between atomic O_TRUNC and page invalidation
In reply to Greg Kroah-HartmanFrom: Miklos Szeredi <[email protected]>
commit 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b upstream.
fuse_finish_open() will be called with FUSE_NOWRITE set in case of atomic O_TRUNC open(), so commit 76224355db75 ("fuse: truncate pagecache on atomic_o_trunc") replaced invalidate_inode_pages2() by truncate_pagecache() in such a case to avoid the A-A deadlock. However, we found another A-B-B-A deadlock related to the case above, which will cause the xfstests generic/464 testcase hung in our virtio-fs test environment.
For example, consider two processes concurrently open one same file, one with O_TRUNC and another without O_TRUNC. The deadlock case is described below, if open(O_TRUNC) is already set_nowrite(acquired A), and is trying to lock a page (acquiring B), open() could have held the page lock (acquired B), and waiting on the page writeback (acquiring A). This would lead to deadlocks.
open(O_TRUNC)
----------------------------------------------------------------fuse_open_common
inode_lock [C acquire]
fuse_set_nowrite [A acquire]
fuse_finish_open
truncate_pagecache
lock_page [B acquire]
truncate_inode_page
unlock_page [B release]
fuse_release_nowrite [A release]
inode_unlock [C release]
----------------------------------------------------------------
open()
----------------------------------------------------------------fuse_open_common
fuse_finish_open
invalidate_inode_pages2
lock_page [B acquire]
fuse_launder_page
fuse_wait_on_page_writeback [A acquire & release]
unlock_page [B release]
----------------------------------------------------------------
Besides this case, all calls of invalidate_inode_pages2() and invalidate_inode_pages2_range() in fuse code also can deadlock with open(O_TRUNC).
Fix by moving the truncate_pagecache() call outside the nowrite protected region. The nowrite protection is only for delayed writeback (writeback_cache) case, where inode lock does not protect against truncation racing with writes on the server. Write syscalls racing with page cache truncation still get the inode lock protection.
This patch also changes the order of filemap_invalidate_lock() vs. fuse_set_nowrite() in fuse_open_common(). This new order matches the order found in fuse_file_fallocate() and fuse_do_setattr().
--- fs/fuse/dir.c | 7 ++++++- fs/fuse/file.c | 30 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-)
fs/fuse/dir.c +6 -1
@@ -537,6 +537,7 @@ static int fuse_create_open(struct inodestruct fuse_file *ff;void *security_ctx =NULL ;u32 security_ctxlen; +bool trunc = flags &O_TRUNC ;/* Userspace expects S_IFREG in create mode */ BUG_ON ((mode &S_IFMT ) !=S_IFREG );
@@ -561,7 +562,7 @@ static int fuse_create_open(struct inode inarg.mode = mode; inarg.umask =current_umask (); -if (fm->fc->handle_killpriv_v2 && (flags &O_TRUNC ) && +if (fm->fc->handle_killpriv_v2 && trunc && !(flags &O_EXCL ) && !capable (CAP_FSETID )) { inarg.open_flags |=FUSE_OPEN_KILL_SUIDGID ; }
@@ -623,6 +624,10 @@ static int fuse_create_open(struct inode }else { file->private_data = ff;fuse_finish_open (inode, file); +if (fm->fc->atomic_o_trunc && trunc) +truncate_pagecache (inode,0 ); +else if (!(ff->open_flags &FOPEN_KEEP_CACHE )) +invalidate_inode_pages2 (inode->i_mapping); }return err;
fs/fuse/file.c +17 -13
@@ -210,13 +210,9 @@ void fuse_finish_open(struct inode *inod fi->attr_version =atomic64_inc_return (&fc->attr_version);i_size_write (inode,0 );spin_unlock (&fi->lock); -truncate_pagecache (inode,0 );file_update_time (file);fuse_invalidate_attr_mask (inode,FUSE_STATX_MODSIZE ); - }else if (!(ff->open_flags &FOPEN_KEEP_CACHE )) { -invalidate_inode_pages2 (inode->i_mapping); } -if ((file->f_mode &FMODE_WRITE ) && fc->writeback_cache)fuse_link_write_file (file); }
@@ -239,30 +235,38 @@ int fuse_open_common(struct inode *inodeif (err)return err; -if (is_wb_truncate || dax_truncate) { +if (is_wb_truncate || dax_truncate)inode_lock (inode); -fuse_set_nowrite (inode); - }if (dax_truncate) {filemap_invalidate_lock (inode->i_mapping); err =fuse_dax_break_layouts (inode,0 ,0 );if (err) - goto out; + goto out_inode_unlock; } +if (is_wb_truncate || dax_truncate) +fuse_set_nowrite (inode); + err =fuse_do_open (fm,get_node_id (inode), file, isdir);if (!err)fuse_finish_open (inode, file); -out: +if (is_wb_truncate || dax_truncate) +fuse_release_nowrite (inode); +if (!err) { +struct fuse_file *ff = file->private_data; + +if (fc->atomic_o_trunc && (file->f_flags &O_TRUNC )) +truncate_pagecache (inode,0 ); +else if (!(ff->open_flags &FOPEN_KEEP_CACHE )) +invalidate_inode_pages2 (inode->i_mapping); + }if (dax_truncate)filemap_invalidate_unlock (inode->i_mapping); - -if (is_wb_truncate | dax_truncate) { -fuse_release_nowrite (inode); +out_inode_unlock: +if (is_wb_truncate || dax_truncate)inode_unlock (inode); - }return err; }
Greg Kroah-Hartman
maintainerPATCH 117/1157 serial: mvebu-uart: uart2 error bits clearing
In reply to Greg Kroah-HartmanFrom: Narendra Hadke <[email protected]>
commit a7209541239e5dd44d981289e5f9059222d40fd1 upstream.
For mvebu uart2, error bits are not cleared on buffer read. This causes interrupt loop and system hang.
--- drivers/tty/serial/mvebu-uart.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/tty/serial/mvebu-uart.c +11 -0
@@ -265,6 +265,7 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status)struct tty_port *tport = &port->state->port;unsigned char ch =0 ;char flag =0 ; +int ret; do { if (status & STAT_RX_RDY(port)) {
@@ -277,6 +278,16 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) port->icount.parity++; } +/* +* For UART2, error bits are not cleared on buffer read. +* This causes interrupt loop and system hang. +*/ +if (IS_EXTENDED (port) && (status &STAT_BRK_ERR )) { + ret =readl (port->membase +UART_STAT ); + ret |=STAT_BRK_ERR ; +writel (ret, port->membase +UART_STAT ); + } +if (status &STAT_BRK_DET ) { port->icount.brk++; status &= ~(STAT_FRM_ERR |STAT_PAR_ERR );
Signature · 1 line
2.37.1
Greg Kroah-Hartman
maintainerPATCH 118/1157 md-raid: destroy the bitmap after destroying the thread
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit e151db8ecfb019b7da31d076130a794574c89f6f upstream.
When we ran the lvm test "shell/integrity-blocksize-3.sh" on a kernel with kasan, we got failure in write_page.
The reason for the failure is that md_bitmap_destroy is called before destroying the thread and the thread may be waiting in the function write_page for the bio to complete. When the thread finishes waiting, it executes "if (test_bit(BITMAP_WRITE_ERROR, &bitmap->flags))", which triggers the kasan warning.
Note that the commit 48df498daf62 that caused this bug claims that it is neede for md-cluster, you should check md-cluster and possibly find another bugfix for it.
BUG: KASAN: use-after-free in write_page+0x18d/0x680 [md_mod] Read of size 8 at addr ffff889162030c78 by task mdX_raid1/5539 CPU: 10 PID: 5539 Comm: mdX_raid1 Not tainted 5.19.0-rc2 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x34/0x44 print_report.cold+0x45/0x57a ? __lock_text_start+0x18/0x18 ? write_page+0x18d/0x680 [md_mod] kasan_report+0xa8/0xe0 ? write_page+0x18d/0x680 [md_mod] kasan_check_range+0x13f/0x180 write_page+0x18d/0x680 [md_mod] ? super_sync+0x4d5/0x560 [dm_raid] ? md_bitmap_file_kick+0xa0/0xa0 [md_mod] ? rs_set_dev_and_array_sectors+0x2e0/0x2e0 [dm_raid] ? mutex_trylock+0x120/0x120 ? preempt_count_add+0x6b/0xc0 ? preempt_count_sub+0xf/0xc0 md_update_sb+0x707/0xe40 [md_mod] md_reap_sync_thread+0x1b2/0x4a0 [md_mod] md_check_recovery+0x533/0x960 [md_mod] raid1d+0xc8/0x2a20 [raid1] ? var_wake_function+0xe0/0xe0 ? psi_group_change+0x411/0x500 ? preempt_count_sub+0xf/0xc0 ? _raw_spin_lock_irqsave+0x78/0xc0 ? __lock_text_start+0x18/0x18 ? raid1_end_read_request+0x2a0/0x2a0 [raid1] ? preempt_count_sub+0xf/0xc0 ? _raw_spin_unlock_irqrestore+0x19/0x40 ? del_timer_sync+0xa9/0x100 ? try_to_del_timer_sync+0xc0/0xc0 ? _raw_spin_lock_irqsave+0x78/0xc0 ? __lock_text_start+0x18/0x18 ? __list_del_entry_valid+0x68/0xa0 ? finish_wait+0xa3/0x100 md_thread+0x161/0x260 [md_mod] ? unregister_md_personality+0xa0/0xa0 [md_mod] ? _raw_spin_lock_irqsave+0x78/0xc0 ? prepare_to_wait_event+0x2c0/0x2c0 ? unregister_md_personality+0xa0/0xa0 [md_mod] kthread+0x148/0x180 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 </TASK> Allocated by task 5522: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x80/0xa0 md_bitmap_create+0xa8/0xe80 [md_mod] md_run+0x777/0x1300 [md_mod] raid_ctr+0x249c/0x4a30 [dm_raid] dm_table_add_target+0x2b0/0x620 [dm_mod] table_load+0x1c8/0x400 [dm_mod] ctl_ioctl+0x29e/0x560 [dm_mod] dm_compat_ctl_ioctl+0x7/0x20 [dm_mod] __do_compat_sys_ioctl+0xfa/0x160 do_syscall_64+0x90/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 5680: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x40 kasan_set_free_info+0x20/0x40 __kasan_slab_free+0xf7/0x140 kfree+0x80/0x240 md_bitmap_free+0x1c3/0x280 [md_mod] __md_stop+0x21/0x120 [md_mod] md_stop+0x9/0x40 [md_mod] raid_dtr+0x1b/0x40 [dm_raid] dm_table_destroy+0x98/0x1e0 [dm_mod] __dm_destroy+0x199/0x360 [dm_mod] dev_remove+0x10c/0x160 [dm_mod] ctl_ioctl+0x29e/0x560 [dm_mod] dm_compat_ctl_ioctl+0x7/0x20 [dm_mod] __do_compat_sys_ioctl+0xfa/0x160 do_syscall_64+0x90/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0
--- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
@@ -6244,11 +6244,11 @@ static void mddev_detach(struct mddev *mstatic void __md_stop (struct mddev *mddev) {struct md_personality *pers = mddev->pers; -md_bitmap_destroy (mddev);mddev_detach (mddev);/* Ensure ->event_work is done */ if (mddev->event_work.func)flush_workqueue (md_misc_wq); +md_bitmap_destroy (mddev);spin_lock (&mddev->lock); mddev->pers =NULL ;spin_unlock (&mddev->lock);
Greg Kroah-Hartman
maintainerPATCH 119/1157 md-raid10: fix KASAN warning
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit d17f744e883b2f8d13cca252d71cfe8ace346f7d upstream.
There's a KASAN warning in raid10_remove_disk when running the lvm test lvconvert-raid-reshape.sh. We fix this warning by verifying that the value "number" is valid.
BUG: KASAN: slab-out-of-bounds in raid10_remove_disk+0x61/0x2a0 [raid10] Read of size 8 at addr ffff889108f3d300 by task mdX_raid10/124682 CPU: 3 PID: 124682 Comm: mdX_raid10 Not tainted 5.19.0-rc6 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x34/0x44 print_report.cold+0x45/0x57a ? __lock_text_start+0x18/0x18 ? raid10_remove_disk+0x61/0x2a0 [raid10] kasan_report+0xa8/0xe0 ? raid10_remove_disk+0x61/0x2a0 [raid10] raid10_remove_disk+0x61/0x2a0 [raid10] Buffer I/O error on dev dm-76, logical block 15344, async page read ? __mutex_unlock_slowpath.constprop.0+0x1e0/0x1e0 remove_and_add_spares+0x367/0x8a0 [md_mod] ? super_written+0x1c0/0x1c0 [md_mod] ? mutex_trylock+0xac/0x120 ? _raw_spin_lock+0x72/0xc0 ? _raw_spin_lock_bh+0xc0/0xc0 md_check_recovery+0x848/0x960 [md_mod] raid10d+0xcf/0x3360 [raid10] ? sched_clock_cpu+0x185/0x1a0 ? rb_erase+0x4d4/0x620 ? var_wake_function+0xe0/0xe0 ? psi_group_change+0x411/0x500 ? preempt_count_sub+0xf/0xc0 ? _raw_spin_lock_irqsave+0x78/0xc0 ? __lock_text_start+0x18/0x18 ? raid10_sync_request+0x36c0/0x36c0 [raid10] ? preempt_count_sub+0xf/0xc0 ? _raw_spin_unlock_irqrestore+0x19/0x40 ? del_timer_sync+0xa9/0x100 ? try_to_del_timer_sync+0xc0/0xc0 ? _raw_spin_lock_irqsave+0x78/0xc0 ? __lock_text_start+0x18/0x18 ? _raw_spin_unlock_irq+0x11/0x24 ? __list_del_entry_valid+0x68/0xa0 ? finish_wait+0xa3/0x100 md_thread+0x161/0x260 [md_mod] ? unregister_md_personality+0xa0/0xa0 [md_mod] ? _raw_spin_lock_irqsave+0x78/0xc0 ? prepare_to_wait_event+0x2c0/0x2c0 ? unregister_md_personality+0xa0/0xa0 [md_mod] kthread+0x148/0x180 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 </TASK> Allocated by task 124495: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x80/0xa0 setup_conf+0x140/0x5c0 [raid10] raid10_run+0x4cd/0x740 [raid10] md_run+0x6f9/0x1300 [md_mod] raid_ctr+0x2531/0x4ac0 [dm_raid] dm_table_add_target+0x2b0/0x620 [dm_mod] table_load+0x1c8/0x400 [dm_mod] ctl_ioctl+0x29e/0x560 [dm_mod] dm_compat_ctl_ioctl+0x7/0x20 [dm_mod] __do_compat_sys_ioctl+0xfa/0x160 do_syscall_64+0x90/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0x9e/0xc0 kvfree_call_rcu+0x84/0x480 timerfd_release+0x82/0x140 L __fput+0xfa/0x400 task_work_run+0x80/0xc0 exit_to_user_mode_prepare+0x155/0x160 syscall_exit_to_user_mode+0x12/0x40 do_syscall_64+0x42/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0x9e/0xc0 kvfree_call_rcu+0x84/0x480 timerfd_release+0x82/0x140 __fput+0xfa/0x400 task_work_run+0x80/0xc0 exit_to_user_mode_prepare+0x155/0x160 syscall_exit_to_user_mode+0x12/0x40 do_syscall_64+0x42/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff889108f3d200 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 0 bytes to the right of
256-byte region [ffff889108f3d200, ffff889108f3d300)
The buggy address belongs to the physical page:
page:000000007ef2a34c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1108f3c
head:000000007ef2a34c order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=2)
raw: 4000000000010200 0000000000000000 dead000000000001 ffff889100042b40
raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff889108f3d200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff889108f3d280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff889108f3d300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff889108f3d380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff889108f3d400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00--- drivers/md/raid10.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/md/raid10.c +4 -1
@@ -2167,9 +2167,12 @@ static int raid10_remove_disk(struct mddint err =0 ;int number = rdev->raid_disk;struct md_rdev **rdevp; -struct raid10_info *p = conf->mirrors + number; +struct raid10_info *p;print_conf (conf); +if (unlikely (number >= mddev->raid_disks)) +return 0 ; + p = conf->mirrors + number;if (rdev == p->rdev) rdevp = &p->rdev;else if (rdev == p->replacement)
Greg Kroah-Hartman
maintainerPATCH 120/1157 mbcache: dont reclaim used entries
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 58318914186c157477b978b1739dfe2f1b9dc0fe upstream.
Do not reclaim entries that are currently used by somebody from a shrinker. Firstly, these entries are likely useful. Secondly, we will need to keep such entries to protect pending increment of xattr block refcount.
--- fs/mbcache.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
fs/mbcache.c +9 -1
@@ -288,7 +288,7 @@ static unsigned long mb_cache_shrink(strwhile (nr_to_scan-- && !list_empty (&cache->c_list)) { entry =list_first_entry (&cache->c_list, struct mb_cache_entry, e_list); -if (entry->e_referenced) { +if (entry->e_referenced ||atomic_read (&entry->e_refcnt) >2 ) { entry->e_referenced =0 ;list_move_tail (&entry->e_list, &cache->c_list);continue ;
@@ -302,6 +302,14 @@ static unsigned long mb_cache_shrink(strspin_unlock (&cache->c_list_lock); head =mb_cache_entry_head (cache, entry->e_key);hlist_bl_lock (head); +/* Now a reliable check if the entry didn't get used... */ +if (atomic_read (&entry->e_refcnt) >2 ) { +hlist_bl_unlock (head); +spin_lock (&cache->c_list_lock); +list_add_tail (&entry->e_list, &cache->c_list); + cache->c_entry_count++; +continue ; + }if (!hlist_bl_unhashed (&entry->e_hash_list)) {hlist_bl_del_init (&entry->e_hash_list);atomic_dec (&entry->e_refcnt);
Greg Kroah-Hartman
maintainerPATCH 121/1157 mbcache: add functions to delete entry if unused
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 3dc96bba65f53daa217f0a8f43edad145286a8f5 upstream.
Add function mb_cache_entry_delete_or_get() to delete mbcache entry if it is unused and also add a function to wait for entry to become unused
- mb_cache_entry_wait_unused(). We do not share code between the two deleting function as one of them will go away soon.
--- fs/mbcache.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++-- include/linux/mbcache.h | 10 ++++++- 2 files changed, 73 insertions(+), 3 deletions(-)
fs/mbcache.c +64 -2
@@ -11,7 +11,7 @@/* * Mbcache is a simple key-value store. Keys need not be unique, however * key-value pairs are expected to be unique (we use this fact in -* mb_cache_entry_delete()). +* mb_cache_entry_delete_or_get()). * * Ext2 and ext4 use this cache for deduplication of extended attribute blocks. * Ext4 also uses it for deduplication of xattr values stored in inodes.
@@ -125,6 +125,19 @@ void __mb_cache_entry_free(struct mb_cac }EXPORT_SYMBOL (__mb_cache_entry_free); +/* +* mb_cache_entry_wait_unused - wait to be the last user of the entry +* +* @entry - entry to work on +* +* Wait to be the last user of the entry. +*/ +void mb_cache_entry_wait_unused (struct mb_cache_entry *entry) +{ +wait_var_event (&entry->e_refcnt,atomic_read (&entry->e_refcnt) <=3 ); +} +EXPORT_SYMBOL (mb_cache_entry_wait_unused); +static struct mb_cache_entry *__entry_find (struct mb_cache *cache,struct mb_cache_entry *entry,u32 key)
@@ -217,7 +230,7 @@ out: }EXPORT_SYMBOL (mb_cache_entry_get); -/* mb_cache_entry_delete - remove a cache entry +/* mb_cache_entry_delete - try to remove a cache entry * @cache - cache we work with * @key - key * @value - value
@@ -254,6 +267,55 @@ void mb_cache_entry_delete(struct mb_cac }EXPORT_SYMBOL (mb_cache_entry_delete); +/* mb_cache_entry_delete_or_get - remove a cache entry if it has no users +* @cache - cache we work with +* @key - key +* @value - value +* +* Remove entry from cache @cache with key @key and value @value. The removal +* happens only if the entry is unused. The function returns NULL in case the +* entry was successfully removed or there's no entry in cache. Otherwise the +* function grabs reference of the entry that we failed to delete because it +* still has users and return it. +*/ +struct mb_cache_entry *mb_cache_entry_delete_or_get (struct mb_cache *cache, +u32 key,u64 value) +{ +struct hlist_bl_node *node; +struct hlist_bl_head *head; +struct mb_cache_entry *entry; + + head =mb_cache_entry_head (cache, key); +hlist_bl_lock (head); +hlist_bl_for_each_entry (entry, node, head, e_hash_list) { +if (entry->e_key == key && entry->e_value == value) { +if (atomic_read (&entry->e_refcnt) >2 ) { +atomic_inc (&entry->e_refcnt); +hlist_bl_unlock (head); +return entry; + } +/* We keep hash list reference to keep entry alive */ +hlist_bl_del_init (&entry->e_hash_list); +hlist_bl_unlock (head); +spin_lock (&cache->c_list_lock); +if (!list_empty (&entry->e_list)) { +list_del_init (&entry->e_list); +if (!WARN_ONCE (cache->c_entry_count ==0 , +"mbcache: attempt to decrement c_entry_count past zero" )) + cache->c_entry_count--; +atomic_dec (&entry->e_refcnt); + } +spin_unlock (&cache->c_list_lock); +mb_cache_entry_put (cache, entry); +return NULL ; + } + } +hlist_bl_unlock (head); + +return NULL ; +} +EXPORT_SYMBOL (mb_cache_entry_delete_or_get); +/* mb_cache_entry_touch - cache entry got used * @cache - cache the entry belongs to * @entry - entry that got used
include/linux/mbcache.h +9 -1
@@ -30,15 +30,23 @@ void mb_cache_destroy(struct mb_cache *cint mb_cache_entry_create (struct mb_cache *cache,gfp_t mask,u32 key,u64 value,bool reusable);void __mb_cache_entry_free (struct mb_cache_entry *entry); +void mb_cache_entry_wait_unused (struct mb_cache_entry *entry);static inline int mb_cache_entry_put (struct mb_cache *cache,struct mb_cache_entry *entry) { -if (!atomic_dec_and_test (&entry->e_refcnt)) +unsigned int cnt =atomic_dec_return (&entry->e_refcnt); + +if (cnt >0 ) { +if (cnt <=3 ) +wake_up_var (&entry->e_refcnt);return 0 ; + }__mb_cache_entry_free (entry);return 1 ; } +struct mb_cache_entry *mb_cache_entry_delete_or_get (struct mb_cache *cache, +u32 key,u64 value);void mb_cache_entry_delete (struct mb_cache *cache,u32 key,u64 value);struct mb_cache_entry *mb_cache_entry_get (struct mb_cache *cache,u32 key,u64 value);
Greg Kroah-Hartman
maintainerPATCH 122/1157 media: isl7998x: select V4L2_FWNODE to fix build error
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
commit 81e005842d0b8167c059553a1c29c36d8a7a9329 upstream.
Fix build error when VIDEO_ISL7998X=y and V4L2_FWNODE=m by selecting V4L2_FWNODE.
microblaze-linux-ld: drivers/media/i2c/isl7998x.o: in function `isl7998x_probe':
(.text+0x8f4): undefined reference to `v4l2_fwnode_endpoint_parse'
--- drivers/media/i2c/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/media/i2c/Kconfig +1 -0
@@ -1178,6 +1178,7 @@ config VIDEO_ISL7998X depends on OF_GPIO select MEDIA_CONTROLLER select VIDEO_V4L2_SUBDEV_API + select V4L2_FWNODE help Support for Intersil ISL7998x analog to MIPI-CSI2 or BT.656 decoder.
Greg Kroah-Hartman
maintainerPATCH 123/1157 media: [PATCH] pci: atomisp_cmd: fix three missing checks on list iterator
In reply to Greg Kroah-HartmanFrom: Xiaomeng Tong <[email protected]>
commit 09b204eb9de9fdf07d028c41c4331b5cfeb70dd7 upstream.
The three bugs are here:
__func__, s3a_buf->s3a_data->exp_id); __func__, md_buf->metadata->exp_id); __func__, dis_buf->dis_data->exp_id);
The list iterator 's3a_buf/md_buf/dis_buf' will point to a bogus position containing HEAD if the list is empty or no element is found. This case must be checked before any use of the iterator, otherwise it will lead to a invalid memory access.
To fix this bug, add an check. Use a new variable '*_iter' as the list iterator, while use the old variable '*_buf' as a dedicated pointer to point to the found element.
--- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 57 +++++++++++++++--------- 1 file changed, 36 insertions(+), 21 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_cmd.c +36 -21
@@ -901,9 +901,9 @@ void atomisp_buf_done(struct atomisp_subint err;unsigned long irqflags;struct ia_css_frame *frame =NULL ; -struct atomisp_s3a_buf *s3a_buf =NULL , *_s3a_buf_tmp; -struct atomisp_dis_buf *dis_buf =NULL , *_dis_buf_tmp; -struct atomisp_metadata_buf *md_buf =NULL , *_md_buf_tmp; +struct atomisp_s3a_buf *s3a_buf =NULL , *_s3a_buf_tmp, *s3a_iter; +struct atomisp_dis_buf *dis_buf =NULL , *_dis_buf_tmp, *dis_iter; +struct atomisp_metadata_buf *md_buf =NULL , *_md_buf_tmp, *md_iter;enum atomisp_metadata_type md_type;struct atomisp_device *isp = asd->isp;struct v4l2_control ctrl;
@@ -942,60 +942,75 @@ void atomisp_buf_done(struct atomisp_subswitch (buf_type) {case IA_CSS_BUFFER_TYPE_3A_STATISTICS : -list_for_each_entry_safe (s3a_buf, _s3a_buf_tmp, +list_for_each_entry_safe (s3a_iter, _s3a_buf_tmp, &asd->s3a_stats_in_css, list) { -if (s3a_buf->s3a_data == +if (s3a_iter->s3a_data == buffer.css_buffer.data.stats_3a) { -list_del_init (&s3a_buf->list); -list_add_tail (&s3a_buf->list, +list_del_init (&s3a_iter->list); +list_add_tail (&s3a_iter->list, &asd->s3a_stats_ready); + s3a_buf = s3a_iter;break ; } } asd->s3a_bufs_in_css[css_pipe_id]--;atomisp_3a_stats_ready_event (asd, buffer.css_buffer.exp_id); -dev_dbg (isp->dev,"%s: s3a stat with exp_id %d is ready\n" , - __func__, s3a_buf->s3a_data->exp_id); +if (s3a_buf) +dev_dbg (isp->dev,"%s: s3a stat with exp_id %d is ready\n" , + __func__, s3a_buf->s3a_data->exp_id); +else +dev_dbg (isp->dev,"%s: s3a stat is ready with no exp_id found\n" , + __func__);break ;case IA_CSS_BUFFER_TYPE_METADATA :if (error)break ; md_type =atomisp_get_metadata_type (asd, css_pipe_id); -list_for_each_entry_safe (md_buf, _md_buf_tmp, +list_for_each_entry_safe (md_iter, _md_buf_tmp, &asd->metadata_in_css[md_type], list) { -if (md_buf->metadata == +if (md_iter->metadata == buffer.css_buffer.data.metadata) { -list_del_init (&md_buf->list); -list_add_tail (&md_buf->list, +list_del_init (&md_iter->list); +list_add_tail (&md_iter->list, &asd->metadata_ready[md_type]); + md_buf = md_iter;break ; } } asd->metadata_bufs_in_css[stream_id][css_pipe_id]--;atomisp_metadata_ready_event (asd, md_type); -dev_dbg (isp->dev,"%s: metadata with exp_id %d is ready\n" , - __func__, md_buf->metadata->exp_id); +if (md_buf) +dev_dbg (isp->dev,"%s: metadata with exp_id %d is ready\n" , + __func__, md_buf->metadata->exp_id); +else +dev_dbg (isp->dev,"%s: metadata is ready with no exp_id found\n" , + __func__);break ;case IA_CSS_BUFFER_TYPE_DIS_STATISTICS : -list_for_each_entry_safe (dis_buf, _dis_buf_tmp, +list_for_each_entry_safe (dis_iter, _dis_buf_tmp, &asd->dis_stats_in_css, list) { -if (dis_buf->dis_data == +if (dis_iter->dis_data == buffer.css_buffer.data.stats_dvs) {spin_lock_irqsave (&asd->dis_stats_lock, irqflags); -list_del_init (&dis_buf->list); -list_add (&dis_buf->list, &asd->dis_stats); +list_del_init (&dis_iter->list); +list_add (&dis_iter->list, &asd->dis_stats); asd->params.dis_proj_data_valid = true;spin_unlock_irqrestore (&asd->dis_stats_lock, irqflags); + dis_buf = dis_iter;break ; } } asd->dis_bufs_in_css--; -dev_dbg (isp->dev,"%s: dis stat with exp_id %d is ready\n" , - __func__, dis_buf->dis_data->exp_id); +if (dis_buf) +dev_dbg (isp->dev,"%s: dis stat with exp_id %d is ready\n" , + __func__, dis_buf->dis_data->exp_id); +else +dev_dbg (isp->dev,"%s: dis stat is ready with no exp_id found\n" , + __func__);break ;case IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME :case IA_CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME :
Greg Kroah-Hartman
maintainerPATCH 124/1157 ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr()
In reply to Greg Kroah-HartmanFrom: Alexander Lobakin <[email protected]>
commit e5a16a5c4602c119262f350274021f90465f479d upstream.
test_bit(), as any other bitmap op, takes unsigned long * as a second argument (pointer to the actual bitmap), as any bitmap itself is an array of unsigned longs. However, the ia64_get_irr() code passes a ref to u64 as a second argument.
This works with the ia64 bitops implementation due to that they have void * as the second argument and then cast it later on. This works with the bitmap API itself due to that unsigned long has the same size on ia64 as u64 (unsigned long long), but from the compiler PoV those two are different.
Define @irr as unsigned long to fix that. That implies no functional changes. Has been hidden for 16 years!
--- arch/ia64/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/include/asm/processor.h +1 -1
@@ -538,7 +538,7 @@ ia64_get_irr(unsigned int vector) {unsigned int reg = vector /64 ;unsigned int bit = vector %64 ; -u64 irr; +unsigned long irr;switch (reg) {case 0 : irr =ia64_getreg (_IA64_REG_CR_IRR0);break ;
Greg Kroah-Hartman
maintainerPATCH 125/1157 powerpc: Restore CONFIG_DEBUG_INFO in defconfigs
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 92f89ec1b534b6eca2b81bae97d30a786932f51a upstream.
Commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable from a choice") broke the selection of CONFIG_DEBUG_INFO by powerpc defconfigs.
It is now necessary to select one of the three DEBUG_INFO_DWARF* options to get DEBUG_INFO enabled.
Replace DEBUG_INFO=y by DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y in all defconfigs using the following command:
sed -i s/DEBUG_INFO=y/DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y/g git grep -l DEBUG_INFO arch/powerpc/configs/
--- arch/powerpc/configs/44x/akebono_defconfig | 2 +- arch/powerpc/configs/44x/currituck_defconfig | 2 +- arch/powerpc/configs/44x/fsp2_defconfig | 2 +- arch/powerpc/configs/44x/iss476-smp_defconfig | 2 +- arch/powerpc/configs/44x/warp_defconfig | 2 +- arch/powerpc/configs/52xx/lite5200b_defconfig | 2 +- arch/powerpc/configs/52xx/motionpro_defconfig | 2 +- arch/powerpc/configs/52xx/tqm5200_defconfig | 2 +- arch/powerpc/configs/adder875_defconfig | 2 +- arch/powerpc/configs/ep8248e_defconfig | 2 +- arch/powerpc/configs/ep88xc_defconfig | 2 +- arch/powerpc/configs/fsl-emb-nonhw.config | 2 +- arch/powerpc/configs/mgcoge_defconfig | 2 +- arch/powerpc/configs/mpc5200_defconfig | 2 +- arch/powerpc/configs/mpc8272_ads_defconfig | 2 +- arch/powerpc/configs/mpc885_ads_defconfig | 2 +- arch/powerpc/configs/ppc6xx_defconfig | 2 +- arch/powerpc/configs/pq2fads_defconfig | 2 +- arch/powerpc/configs/ps3_defconfig | 2 +- arch/powerpc/configs/tqm8xx_defconfig | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-)
arch/powerpc/configs/44x/akebono_defconfig +1 -1
@@ -118,7 +118,7 @@ CONFIG_CRAMFS=y CONFIG_NLS_DEFAULT="n" CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y CONFIG_XMON=y
arch/powerpc/configs/44x/currituck_defconfig +1 -1
@@ -73,7 +73,7 @@ CONFIG_NFS_FS=y CONFIG_NFS_V3_ACL=y CONFIG_NFS_V4=y CONFIG_NLS_DEFAULT="n" -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y CONFIG_XMON=y
arch/powerpc/configs/44x/fsp2_defconfig +1 -1
@@ -110,7 +110,7 @@ CONFIG_XZ_DEC=y CONFIG_PRINTK_TIME=y CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3 CONFIG_DYNAMIC_DEBUG=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y CONFIG_CRYPTO_CBC=y
arch/powerpc/configs/44x/iss476-smp_defconfig +1 -1
@@ -56,7 +56,7 @@ CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_CRAMFS=y # CONFIG_NETWORK_FILESYSTEMS is not set -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y CONFIG_PPC_EARLY_DEBUG=y
arch/powerpc/configs/44x/warp_defconfig +1 -1
@@ -88,7 +88,7 @@ CONFIG_NLS_UTF8=y CONFIG_CRC_CCITT=y CONFIG_CRC_T10DIF=y CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y
arch/powerpc/configs/52xx/lite5200b_defconfig +1 -1
@@ -58,6 +58,6 @@ CONFIG_NFS_FS=y CONFIG_NFS_V4=y CONFIG_ROOT_NFS=y CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DETECT_HUNG_TASK=y # CONFIG_DEBUG_BUGVERBOSE is not set
arch/powerpc/configs/52xx/motionpro_defconfig +1 -1
@@ -84,7 +84,7 @@ CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DETECT_HUNG_TASK=y # CONFIG_DEBUG_BUGVERBOSE is not set CONFIG_CRYPTO_ECB=y
arch/powerpc/configs/52xx/tqm5200_defconfig +1 -1
@@ -85,7 +85,7 @@ CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DETECT_HUNG_TASK=y # CONFIG_DEBUG_BUGVERBOSE is not set CONFIG_CRYPTO_ECB=y
arch/powerpc/configs/adder875_defconfig +1 -1
@@ -45,7 +45,7 @@ CONFIG_CRAMFS=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_CRC32_SLICEBY4=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y
arch/powerpc/configs/ep8248e_defconfig +1 -1
@@ -59,7 +59,7 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHED_DEBUG is not set CONFIG_BDI_SWITCH=y
arch/powerpc/configs/ep88xc_defconfig +1 -1
@@ -48,6 +48,6 @@ CONFIG_CRAMFS=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_CRC32_SLICEBY4=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y
arch/powerpc/configs/fsl-emb-nonhw.config +1 -1
@@ -24,7 +24,7 @@ CONFIG_CRYPTO_PCBC=m CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_DEBUG_FS=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_SHIRQ=y CONFIG_DETECT_HUNG_TASK=y
arch/powerpc/configs/mgcoge_defconfig +1 -1
@@ -73,7 +73,7 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHED_DEBUG is not set
arch/powerpc/configs/mpc5200_defconfig +1 -1
@@ -122,6 +122,6 @@ CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_KERNEL=y CONFIG_DETECT_HUNG_TASK=y
arch/powerpc/configs/mpc8272_ads_defconfig +1 -1
@@ -67,7 +67,7 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y CONFIG_BDI_SWITCH=y
arch/powerpc/configs/mpc885_ads_defconfig +1 -1
@@ -71,7 +71,7 @@ CONFIG_ROOT_NFS=y CONFIG_CRYPTO=y CONFIG_CRYPTO_DEV_TALITOS=y CONFIG_CRC32_SLICEBY4=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_FS=y CONFIG_DEBUG_VM_PGTABLE=y
arch/powerpc/configs/ppc6xx_defconfig +1 -1
@@ -1065,7 +1065,7 @@ CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_HEADERS_INSTALL=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_KERNEL=y
arch/powerpc/configs/pq2fads_defconfig +1 -1
@@ -68,7 +68,7 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y # CONFIG_SCHED_DEBUG is not set
arch/powerpc/configs/ps3_defconfig +1 -1
@@ -153,7 +153,7 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_CRC_CCITT=m CONFIG_CRC_T10DIF=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_MEMORY_INIT=y CONFIG_DEBUG_STACKOVERFLOW=y
arch/powerpc/configs/tqm8xx_defconfig +1 -1
@@ -55,6 +55,6 @@ CONFIG_CRAMFS=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_CRC32_SLICEBY4=y -CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=y
Greg Kroah-Hartman
maintainerPATCH 126/1157 powerpc/64e: Fix early TLB miss with KUAP
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 09317643117ade87c03158341e87466413fa8f1a upstream.
With KUAP, the TLB miss handler bails out when an access to user memory is performed with a nul TID.
But the normal TLB miss routine which is only used early during boot does the check regardless for all memory areas, not only user memory.
By chance there is no early IO or vmalloc access, but when KASAN come we will start having early TLB misses.
Fix it by creating a special branch for user accesses similar to the one in the 'bolted' TLB miss handlers. Unfortunately SPRN_MAS1 is now read too early and there are no registers available to preserve it so it will be read a second time.
--- arch/powerpc/mm/nohash/tlb_low_64e.S | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
arch/powerpc/mm/nohash/tlb_low_64e.S +8 -9
@@ -583,7 +583,7 @@ itlb_miss_fault_e6500: */ rlwimi r11,r14,32-19,27,27 rlwimi r11,r14,32-16,19,19 - beq normal_tlb_miss + beq normal_tlb_miss_user /* XXX replace the RMW cycles with immediate loads + writes */ 1: mfspr r10,SPRN_MAS1 cmpldi cr0,r15,8 /* Check for vmalloc region */
@@ -626,7 +626,7 @@ itlb_miss_fault_e6500: cmpldi cr0,r15,0 /* Check for user region */ std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */ - beq normal_tlb_miss + beq normal_tlb_miss_user li r11,_PAGE_PRESENT|_PAGE_BAP_SX /* Base perm */ oris r11,r11,_PAGE_ACCESSED@h
@@ -653,6 +653,12 @@ itlb_miss_fault_e6500: * r11 = PTE permission mask * r10 = crap (free to use) */ +normal_tlb_miss_user: +#ifdef CONFIG_PPC_KUAP + mfspr r14,SPRN_MAS1 + rlwinm. r14,r14,0,0x3fff0000 + beq- normal_tlb_miss_access_fault /* KUAP fault */ +#endif normal_tlb_miss: /* So we first construct the page table address. We do that by * shifting the bottom of the address (not the region ID) by
@@ -683,11 +689,6 @@ finish_normal_tlb_miss: /* Check if required permissions are met */ andc. r15,r11,r14 bne- normal_tlb_miss_access_fault -#ifdef CONFIG_PPC_KUAP - mfspr r11,SPRN_MAS1 - rlwinm. r10,r11,0,0x3fff0000 - beq- normal_tlb_miss_access_fault /* KUAP fault */ -#endif /* Now we build the MAS: *
@@ -709,9 +710,7 @@ finish_normal_tlb_miss: rldicl r10,r14,64-8,64-8 cmpldi cr0,r10,BOOK3E_PAGESZ_4K beq- 1f -#ifndef CONFIG_PPC_KUAP mfspr r11,SPRN_MAS1 -#endif rlwimi r11,r14,31,21,24 rlwinm r11,r11,0,21,19 mtspr SPRN_MAS1,r11
Greg Kroah-Hartman
maintainerPATCH 127/1157 powerpc/fsl-pci: Fix Class Code of PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
commit 0c551abfa004ce154d487d91777bf221c808a64f upstream.
By default old pre-3.0 Freescale PCIe controllers reports invalid PCI Class Code 0x0b20 for PCIe Root Port. It can be seen by lspci -b output on P2020 board which has this pre-3.0 controller:
$ lspci -bvnn
00:00.0 Power PC [0b20]: Freescale Semiconductor Inc P2020E [1957:0070] (rev 21)
!!! Invalid class 0b20 for header type 01
Capabilities: [4c] Express Root Port (Slot-), MSI 00Fix this issue by programming correct PCI Class Code 0x0604 for PCIe Root Port to the Freescale specific PCIe register 0x474.
With this change lspci -b output is:
$ lspci -bvnn
00:00.0 PCI bridge [0604]: Freescale Semiconductor Inc P2020E [1957:0070] (rev 21) (prog-if 00 [Normal decode])
Capabilities: [4c] Express Root Port (Slot-), MSI 00Without any "Invalid class" error. So class code was properly reflected into standard (read-only) PCI register 0x08.
Same fix is already implemented in U-Boot pcie_fsl.c driver in commit:
http://source.denx.de/u-boot/u-boot/-/commit/d18d06ac35229345a0af80977a408cfbe1d1015b
Fix activated by U-Boot stay active also after booting Linux kernel. But boards which use older U-Boot version without that fix are affected and still require this fix.
So implement this class code fix also in kernel fsl_pci.c driver.
--- arch/powerpc/sysdev/fsl_pci.c | 8 ++++++++ arch/powerpc/sysdev/fsl_pci.h | 1 + 2 files changed, 9 insertions(+)
arch/powerpc/sysdev/fsl_pci.c +8 -0
@@ -521,6 +521,7 @@ int fsl_add_bridge(struct platform_devicstruct resource rsrc;const int *bus_range;u8 hdr_type, progif; +u32 class_code;struct device_node *dev;struct ccsr_pci __iomem *pci;u16 temp;
@@ -594,6 +595,13 @@ int fsl_add_bridge(struct platform_devicPPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS ;if (fsl_pcie_check_link (hose)) hose->indirect_type |=PPC_INDIRECT_TYPE_NO_PCIE_LINK ; +/* Fix Class Code to PCI_CLASS_BRIDGE_PCI_NORMAL for pre-3.0 controller */ +if (in_be32 (&pci->block_rev1) <PCIE_IP_REV_3_0 ) { +early_read_config_dword (hose,0 ,0 ,PCIE_FSL_CSR_CLASSCODE , &class_code); + class_code &=0xff ; + class_code |=PCI_CLASS_BRIDGE_PCI_NORMAL <<8 ; +early_write_config_dword (hose,0 ,0 ,PCIE_FSL_CSR_CLASSCODE , class_code); + } }else {/* * Set PBFR(PCI Bus Function Register)[10] = 1 to
arch/powerpc/sysdev/fsl_pci.h +1 -0
@@ -18,6 +18,7 @@ struct platform_device;#define PCIE_LTSSM 0x0404/* PCIE Link Training and Status */ #define PCIE_LTSSM_L0 0x16/* L0 state */ +#define PCIE_FSL_CSR_CLASSCODE 0x474/* FSL GPEX CSR */ #define PCIE_IP_REV_2_2 0x02080202/* PCIE IP block version Rev2.2 */ #define PCIE_IP_REV_3_0 0x02080300/* PCIE IP block version Rev3.0 */ #define PIWAR_EN 0x80000000/* Enable */
Greg Kroah-Hartman
maintainerPATCH 128/1157 powerpc/ptdump: Fix display of RW pages on FSL_BOOK3E
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit dd8de84b57b02ba9c1fe530a6d916c0853f136bd upstream.
On FSL_BOOK3E, _PAGE_RW is defined with two bits, one for user and one for supervisor. As soon as one of the two bits is set, the page has to be display as RW. But the way it is implemented today requires both bits to be set in order to display it as RW.
Instead of display RW when _PAGE_RW bits are set and R otherwise, reverse the logic and display R when _PAGE_RW bits are all 0 and RW otherwise.
This change has no impact on other platforms as _PAGE_RW is a single bit on all of them.
--- arch/powerpc/mm/ptdump/shared.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/mm/ptdump/shared.c +3 -3
@@ -17,9 +17,9 @@ static const struct flag_info flag_array .clear = " ", }, { .mask = _PAGE_RW, - .val = _PAGE_RW, - .set = "rw", - .clear = "r ", + .val = 0, + .set = "r ", + .clear = "rw", }, { .mask = _PAGE_EXEC, .val = _PAGE_EXEC,
Greg Kroah-Hartman
maintainerPATCH 129/1157 powerpc/powernv: Avoid crashing if rng is NULL
In reply to Greg Kroah-HartmanFrom: Michael Ellerman <[email protected]>
commit 90b5d4fe0b3ba7f589c6723c6bfb559d9e83956a upstream.
On a bare-metal Power8 system that doesn't have an "ibm,power-rng", a malicious QEMU and guest that ignore the absence of the KVM_CAP_PPC_HWRNG flag, and calls H_RANDOM anyway, will dereference a NULL pointer.
In practice all Power8 machines have an "ibm,power-rng", but let's not rely on that, add a NULL check and early return in powernv_get_random_real_mode().
--- arch/powerpc/platforms/powernv/rng.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/platforms/powernv/rng.c +2 -0
@@ -63,6 +63,8 @@ int powernv_get_random_real_mode(unsignestruct powernv_rng *rng; rng =raw_cpu_read (powernv_rng); +if (!rng) +return 0 ; *v =rng_whiten (rng,__raw_rm_readq (rng->regs_real));
Greg Kroah-Hartman
maintainerPATCH 130/1157 MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
In reply to Greg Kroah-HartmanFrom: Huacai Chen <[email protected]>
commit e1a534f5d074db45ae5cbac41d8912b98e96a006 upstream.
When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, cpu_max_bits_warn() generates a runtime warning similar as below while we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit) instead of NR_CPUS to iterate CPUs.
[ 3.052463] ------------[ cut here ]------------ [ 3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0 [ 3.070072] Modules linked in: efivarfs autofs4 [ 3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052 [ 3.084034] Hardware name: Loongson Loongson-3A4000-7A1000-1w-V0.1-CRB/Loongson-LS3A4000-7A1000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V2.0.04082-beta7 04/27 [ 3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000 [ 3.109127] 9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430 [ 3.118774] 90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff [ 3.128412] 0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890 [ 3.138056] 0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa [ 3.147711] ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000 [ 3.157364] 900000000101c998 0000000000000004 9000000000ef7430 0000000000000000 [ 3.167012] 0000000000000009 000000000000006c 0000000000000000 0000000000000000 [ 3.176641] 9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286 [ 3.186260] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c [ 3.195868] ... [ 3.199917] Call Trace: [ 3.203941] [<98000000002086d8>] show_stack+0x38/0x14c [ 3.210666] [<9800000000cf846c>] dump_stack_lvl+0x60/0x88 [ 3.217625] [<980000000023d268>] __warn+0xd0/0x100 [ 3.223958] [<9800000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc [ 3.231150] [<9800000000210220>] show_cpuinfo+0x5e8/0x5f0 [ 3.238080] [<98000000004f578c>] seq_read_iter+0x354/0x4b4 [ 3.245098] [<98000000004c2e90>] new_sync_read+0x17c/0x1c4 [ 3.252114] [<98000000004c5174>] vfs_read+0x138/0x1d0 [ 3.258694] [<98000000004c55f8>] ksys_read+0x70/0x100 [ 3.265265] [<9800000000cfde9c>] do_syscall+0x7c/0x94 [ 3.271820] [<9800000000202fe4>] handle_syscall+0xc4/0x160 [ 3.281824] ---[ end trace 8b484262b4b8c24c ]---
--- arch/mips/kernel/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/proc.c +1 -1
@@ -311,7 +311,7 @@ static void *c_start(struct seq_file *m, {unsigned long i = *pos; -return i <NR_CPUS ? (void *) (i +1 ) :NULL ; +return i < nr_cpu_ids ? (void *) (i +1 ) :NULL ; }static void *c_next (struct seq_file *m,void *v,loff_t *pos)
Greg Kroah-Hartman
maintainerPATCH 131/1157 coresight: Clear the connection field properly
In reply to Greg Kroah-HartmanFrom: Suzuki K Poulose <[email protected]>
commit 2af89ebacf299b7fba5f3087d35e8a286ec33706 upstream.
coresight devices track their connections (output connections) and hold a reference to the fwnode. When a device goes away, we walk through the devices on the coresight bus and make sure that the references are dropped. This happens both ways:
a) For all output connections from the device, drop the reference to the target device via coresight_release_platform_data()
b) Iterate over all the devices on the coresight bus and drop the reference to fwnode if *this* device is the target of the output connection, via coresight_remove_conns()->coresight_remove_match().
However, the coresight_remove_match() doesn't clear the fwnode field, after dropping the reference, this causes use-after-free and additional refcount drops on the fwnode.
e.g., if we have two devices, A and B, with a connection, A -> B. If we remove B first, B would clear the reference on B, from A via coresight_remove_match(). But when A is removed, it still has a connection with fwnode still pointing to B. Thus it tries to drops the reference in coresight_release_platform_data(), raising the bells like :
[ 91.990153] ------------[ cut here ]------------ [ 91.990163] refcount_t: addition on 0; use-after-free. [ 91.990212] WARNING: CPU: 0 PID: 461 at lib/refcount.c:25 refcount_warn_saturate+0xa0/0x144 [ 91.990260] Modules linked in: coresight_funnel coresight_replicator coresight_etm4x(-) crct10dif_ce coresight ip_tables x_tables ipv6 [last unloaded: coresight_cpu_debug] [ 91.990398] CPU: 0 PID: 461 Comm: rmmod Tainted: G W T 5.19.0-rc2+ #53 [ 91.990418] Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Feb 1 2019 [ 91.990434] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 91.990454] pc : refcount_warn_saturate+0xa0/0x144 [ 91.990476] lr : refcount_warn_saturate+0xa0/0x144 [ 91.990496] sp : ffff80000c843640 [ 91.990509] x29: ffff80000c843640 x28: ffff800009957c28 x27: ffff80000c8439a8 [ 91.990560] x26: ffff00097eff1990 x25: ffff8000092b6ad8 x24: ffff00097eff19a8 [ 91.990610] x23: ffff80000c8439a8 x22: 0000000000000000 x21: ffff80000c8439c2 [ 91.990659] x20: 0000000000000000 x19: ffff00097eff1a10 x18: ffff80000ab99c40 [ 91.990708] x17: 0000000000000000 x16: 0000000000000000 x15: ffff80000abf6fa0 [ 91.990756] x14: 000000000000001d x13: 0a2e656572662d72 x12: 657466612d657375 [ 91.990805] x11: 203b30206e6f206e x10: 6f69746964646120 x9 : ffff8000081aba28 [ 91.990854] x8 : 206e6f206e6f6974 x7 : 69646461203a745f x6 : 746e756f63666572 [ 91.990903] x5 : ffff00097648ec58 x4 : 0000000000000000 x3 : 0000000000000027 [ 91.990952] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00080260ba00 [ 91.991000] Call trace: [ 91.991012] refcount_warn_saturate+0xa0/0x144 [ 91.991034] kobject_get+0xac/0xb0 [ 91.991055] of_node_get+0x2c/0x40 [ 91.991076] of_fwnode_get+0x40/0x60 [ 91.991094] fwnode_handle_get+0x3c/0x60 [ 91.991116] fwnode_get_nth_parent+0xf4/0x110 [ 91.991137] fwnode_full_name_string+0x48/0xc0 [ 91.991158] device_node_string+0x41c/0x530 [ 91.991178] pointer+0x320/0x3ec [ 91.991198] vsnprintf+0x23c/0x750 [ 91.991217] vprintk_store+0x104/0x4b0 [ 91.991238] vprintk_emit+0x8c/0x360 [ 91.991257] vprintk_default+0x44/0x50 [ 91.991276] vprintk+0xcc/0xf0 [ 91.991295] _printk+0x68/0x90 [ 91.991315] of_node_release+0x13c/0x14c [ 91.991334] kobject_put+0x98/0x114 [ 91.991354] of_node_put+0x24/0x34 [ 91.991372] of_fwnode_put+0x40/0x5c [ 91.991390] fwnode_handle_put+0x38/0x50 [ 91.991411] coresight_release_platform_data+0x74/0xb0 [coresight] [ 91.991472] coresight_unregister+0x64/0xcc [coresight] [ 91.991525] etm4_remove_dev+0x64/0x78 [coresight_etm4x] [ 91.991563] etm4_remove_amba+0x1c/0x2c [coresight_etm4x] [ 91.991598] amba_remove+0x3c/0x19c
Reproducible by: (Build all coresight components as modules):
#!/bin/sh
while true
do
for m in tmc stm cpu_debug etm4x replicator funnel do
modprobe coresight_${m}
done
for m in tmc stm cpu_debug etm4x replicator funnel do
rmmode coresight_${m}
done
done
--- drivers/hwtracing/coresight/coresight-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwtracing/coresight/coresight-core.c +1 -0
@@ -1424,6 +1424,7 @@ static int coresight_remove_match(struct* platform data. */ fwnode_handle_put (conn->child_fwnode); + conn->child_fwnode =NULL ;/* No need to continue */ break ; }
Greg Kroah-Hartman
maintainerPATCH 132/1157 usb: typec: ucsi: Acknowledge the GET_ERROR_STATUS command completion
In reply to Greg Kroah-HartmanFrom: Linyu Yuan <[email protected]>
commit a7dc438b5e446afcd1b3b6651da28271400722f2 upstream.
We found PPM will not send any notification after it report error status and OPM issue GET_ERROR_STATUS command to read the details about error.
According UCSI spec, PPM may clear the Error Status Data after the OPM has acknowledged the command completion.
This change add operation to acknowledge the command completion from PPM.
--- drivers/usb/typec/ucsi/ucsi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/typec/ucsi/ucsi.c +4 -0
@@ -76,6 +76,10 @@ static int ucsi_read_error(struct ucsi *if (ret)return ret; + ret =ucsi_acknowledge_command (ucsi); +if (ret) +return ret; +switch (error) {case UCSI_ERROR_INCOMPATIBLE_PARTNER :return -EOPNOTSUPP ;
Greg Kroah-Hartman
maintainerPATCH 133/1157 USB: HCD: Fix URB giveback issue in tasklet function
In reply to Greg Kroah-HartmanFrom: Weitao Wang <[email protected]>
commit 26c6c2f8a907c9e3a2f24990552a4d77235791e6 upstream.
Usb core introduce the mechanism of giveback of URB in tasklet context to reduce hardware interrupt handling time. On some test situation(such as FIO with 4KB block size), when tasklet callback function called to giveback URB, interrupt handler add URB node to the bh->head list also. If check bh->head list again after finish all URB giveback of local_list, then it may introduce a "dynamic balance" between giveback URB and add URB to bh->head list. This tasklet callback function may not exit for a long time, which will cause other tasklet function calls to be delayed. Some real-time applications(such as KB and Mouse) will see noticeable lag.
In order to prevent the tasklet function from occupying the cpu for a long time at a time, new URBS will not be added to the local_list even though the bh->head list is not empty. But also need to ensure the left URB giveback to be processed in time, so add a member high_prio for structure giveback_urb_bh to prioritize tasklet and schelule this tasklet again if bh->head list is not empty.
At the same time, we are able to prioritize tasklet through structure member high_prio. So, replace the local high_prio_bh variable with this structure member in usb_hcd_giveback_urb.
--- drivers/usb/core/hcd.c | 26 +++++++++++++++----------- include/linux/usb/hcd.h | 1 + 2 files changed, 16 insertions(+), 11 deletions(-)
drivers/usb/core/hcd.c +15 -11
@@ -1691,7 +1691,6 @@ static void usb_giveback_urb_bh(struct tspin_lock_irq (&bh->lock); bh->running = true; - restart:list_replace_init (&bh->head, &local_list);spin_unlock_irq (&bh->lock);
@@ -1705,10 +1704,17 @@ static void usb_giveback_urb_bh(struct t bh->completing_ep =NULL ; } -/* check if there are new URBs to giveback */ +/* +* giveback new URBs next time to prevent this function +* from not exiting for a long time. +*/ spin_lock_irq (&bh->lock); -if (!list_empty (&bh->head)) - goto restart; +if (!list_empty (&bh->head)) { +if (bh->high_prio) +tasklet_hi_schedule (&bh->bh); +else +tasklet_schedule (&bh->bh); + } bh->running = false;spin_unlock_irq (&bh->lock); }
@@ -1737,7 +1743,7 @@ static void usb_giveback_urb_bh(struct tvoid usb_hcd_giveback_urb (struct usb_hcd *hcd,struct urb *urb,int status) {struct giveback_urb_bh *bh; -bool running, high_prio_bh; +bool running;/* pass status to tasklet via unlinked */ if (likely (!urb->unlinked))
@@ -1748,13 +1754,10 @@ void usb_hcd_giveback_urb(struct usb_hcdreturn ; } -if (usb_pipeisoc (urb->pipe) ||usb_pipeint (urb->pipe)) { +if (usb_pipeisoc (urb->pipe) ||usb_pipeint (urb->pipe)) bh = &hcd->high_prio_bh; - high_prio_bh = true; - }else { +else bh = &hcd->low_prio_bh; - high_prio_bh = false; - }spin_lock (&bh->lock);list_add_tail (&urb->urb_list, &bh->head);
@@ -1763,7 +1766,7 @@ void usb_hcd_giveback_urb(struct usb_hcdif (running) ; -else if (high_prio_bh) +else if (bh->high_prio)tasklet_hi_schedule (&bh->bh);else tasklet_schedule (&bh->bh);
@@ -2959,6 +2962,7 @@ int usb_add_hcd(struct usb_hcd *hcd,/* initialize tasklets */ init_giveback_urb_bh (&hcd->high_prio_bh); + hcd->high_prio_bh.high_prio = true;init_giveback_urb_bh (&hcd->low_prio_bh);/* enable irqs just before we start the controller,
include/linux/usb/hcd.h +1 -0
@@ -66,6 +66,7 @@struct giveback_urb_bh {bool running; +bool high_prio;spinlock_t lock;struct list_head head;struct tasklet_struct bh;
Greg Kroah-Hartman
maintainerPATCH 134/1157 Revert "net: usb: ax88179_178a needs FLAG_SEND_ZLP"
In reply to Greg Kroah-HartmanFrom: Jose Alonso <[email protected]>
commit 6fd2c17fb6e02a8c0ab51df1cfec82ce96b8e83d upstream.
This reverts commit 36a15e1cb134c0395261ba1940762703f778438c.
The usage of FLAG_SEND_ZLP causes problems to other firmware/hardware versions that have no issues.
The FLAG_SEND_ZLP is not safe to use in this context. See:
https://patchwork.ozlabs.org/project/netdev/patch/1270599787.8900.8.camel@Linuxdev4-laptop/#118378
The original problem needs another way to solve.
--- drivers/net/usb/ax88179_178a.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/net/usb/ax88179_178a.c +13 -13
@@ -1801,7 +1801,7 @@ static const struct driver_info ax88179_ .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1814,7 +1814,7 @@ static const struct driver_info ax88178a .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1827,7 +1827,7 @@ static const struct driver_info cypress_ .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1840,7 +1840,7 @@ static const struct driver_info dlink_du .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1853,7 +1853,7 @@ static const struct driver_info sitecom_ .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1866,7 +1866,7 @@ static const struct driver_info samsung_ .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1879,7 +1879,7 @@ static const struct driver_info lenovo_i .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1892,7 +1892,7 @@ static const struct driver_info belkin_i .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1905,7 +1905,7 @@ static const struct driver_info toshiba_ .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1918,7 +1918,7 @@ static const struct driver_info mct_info .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1931,7 +1931,7 @@ static const struct driver_info at_umc20 .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1944,7 +1944,7 @@ static const struct driver_info at_umc20 .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
@@ -1957,7 +1957,7 @@ static const struct driver_info at_umc20 .link_reset = ax88179_link_reset, .reset = ax88179_reset, .stop = ax88179_stop, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, + .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88179_rx_fixup, .tx_fixup = ax88179_tx_fixup, };
Greg Kroah-Hartman
maintainerPATCH 135/1157 ARM: dts: uniphier: Fix USB interrupts for PXs2 SoC
In reply to Greg Kroah-HartmanFrom: Kunihiko Hayashi <[email protected]>
commit 9b0dc7abb5cc43a2dbf90690c3c6011dcadc574d upstream.
An interrupt for USB device are shared with USB host. Set interrupt-names property to common "dwc_usb3" instead of "host" and "peripheral".
--- arch/arm/boot/dts/uniphier-pxs2.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/uniphier-pxs2.dtsi +4 -4
@@ -597,8 +597,8 @@ compatible = "socionext,uniphier-dwc3", "snps,dwc3"; status = "disabled"; reg = <0x65a00000 0xcd00>; - interrupt-names = "host", "peripheral"; - interrupts = <0 134 4>, <0 135 4>; + interrupt-names = "dwc_usb3"; + interrupts = <0 134 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb2>; clock-names = "ref", "bus_early", "suspend";
@@ -693,8 +693,8 @@ compatible = "socionext,uniphier-dwc3", "snps,dwc3"; status = "disabled"; reg = <0x65c00000 0xcd00>; - interrupt-names = "host", "peripheral"; - interrupts = <0 137 4>, <0 138 4>; + interrupt-names = "dwc_usb3"; + interrupts = <0 137 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb1>, <&pinctrl_usb3>; clock-names = "ref", "bus_early", "suspend";
Greg Kroah-Hartman
maintainerPATCH 136/1157 arm64: dts: uniphier: Fix USB interrupts for PXs3 SoC
In reply to Greg Kroah-HartmanFrom: Kunihiko Hayashi <[email protected]>
commit fe17b91a7777df140d0f1433991da67ba658796c upstream.
An interrupt for USB device are shared with USB host. Set interrupt-names property to common "dwc_usb3" instead of "host" and "peripheral".
--- arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi +4 -4
@@ -599,8 +599,8 @@ compatible = "socionext,uniphier-dwc3", "snps,dwc3"; status = "disabled"; reg = <0x65a00000 0xcd00>; - interrupt-names = "host", "peripheral"; - interrupts = <0 134 4>, <0 135 4>; + interrupt-names = "dwc_usb3"; + interrupts = <0 134 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb2>; clock-names = "ref", "bus_early", "suspend";
@@ -701,8 +701,8 @@ compatible = "socionext,uniphier-dwc3", "snps,dwc3"; status = "disabled"; reg = <0x65c00000 0xcd00>; - interrupt-names = "host", "peripheral"; - interrupts = <0 137 4>, <0 138 4>; + interrupt-names = "dwc_usb3"; + interrupts = <0 137 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb1>, <&pinctrl_usb3>; clock-names = "ref", "bus_early", "suspend";
Greg Kroah-Hartman
maintainerPATCH 137/1157 USB: gadget: Fix use-after-free Read in usb_udc_uevent()
In reply to Greg Kroah-HartmanFrom: Alan Stern <[email protected]>
commit 2191c00855b03aa59c20e698be713d952d51fc18 upstream.
The syzbot fuzzer found a race between uevent callbacks and gadget driver unregistration that can cause a use-after-free bug:
---------------------------------------------------------------
BUG: KASAN: use-after-free in usb_udc_uevent+0x11f/0x130 drivers/usb/gadget/udc/core.c:1732 Read of size 8 at addr ffff888078ce2050 by task udevd/2968 CPU: 1 PID: 2968 Comm: udevd Not tainted 5.19.0-rc4-next-20220628-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xbe/0x1f0 mm/kasan/report.c:495 usb_udc_uevent+0x11f/0x130 drivers/usb/gadget/udc/core.c:1732 dev_uevent+0x290/0x770 drivers/base/core.c:2424 ---------------------------------------------------------------
The bug occurs because usb_udc_uevent() dereferences udc->driver but does so without acquiring the udc_lock mutex, which protects this field. If the gadget driver is unbound from the udc concurrently with uevent processing, the driver structure may be accessed after it has been deallocated.
To prevent the race, we make sure that the routine holds the mutex around the racing accesses.
--- drivers/usb/gadget/udc/core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/usb/gadget/udc/core.c +6 -5
@@ -1728,13 +1728,14 @@ static int usb_udc_uevent(struct devicereturn ret; } -if (udc->driver) { +mutex_lock (&udc_lock); +if (udc->driver) ret =add_uevent_var (env,"USB_UDC_DRIVER=%s" , udc->driver->function); -if (ret) { -dev_err (dev,"failed to add uevent USB_UDC_DRIVER\n" ); -return ret; - } +mutex_unlock (&udc_lock); +if (ret) { +dev_err (dev,"failed to add uevent USB_UDC_DRIVER\n" ); +return ret; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 138/1157 usb: dwc3: gadget: refactor dwc3_repare_one_trb
In reply to Greg Kroah-HartmanFrom: Michael Grzeschik <[email protected]>
commit 23385cec5f354794dadced7f28c31da7ae3eb54c upstream.
The function __dwc3_prepare_one_trb has many parameters. Since it is only used in dwc3_prepare_one_trb there is no point in keeping the function. We merge both functions and get rid of the big list of parameters.
--- drivers/usb/dwc3/gadget.c | 92 ++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 52 deletions(-)
drivers/usb/dwc3/gadget.c +40 -52
@@ -1182,17 +1182,49 @@ static u32 dwc3_calc_trbs_left(struct dwreturn trbs_left; } -static void __dwc3_prepare_one_trb (struct dwc3_ep *dep,struct dwc3_trb *trb, -dma_addr_t dma,unsigned int length,unsigned int chain, -unsigned int node,unsigned int stream_id, -unsigned int short_not_ok,unsigned int no_interrupt, -unsigned int is_last,bool must_interrupt) +/** +* dwc3_prepare_one_trb - setup one TRB from one request +* @dep: endpoint for which this request is prepared +* @req: dwc3_request pointer +* @trb_length: buffer size of the TRB +* @chain: should this TRB be chained to the next? +* @node: only for isochronous endpoints. First TRB needs different type. +* @use_bounce_buffer: set to use bounce buffer +* @must_interrupt: set to interrupt on TRB completion +*/ +static void dwc3_prepare_one_trb (struct dwc3_ep *dep, +struct dwc3_request *req,unsigned int trb_length, +unsigned int chain,unsigned int node,bool use_bounce_buffer, +bool must_interrupt) { +struct dwc3_trb *trb; +dma_addr_t dma; +unsigned int stream_id = req->request.stream_id; +unsigned int short_not_ok = req->request.short_not_ok; +unsigned int no_interrupt = req->request.no_interrupt; +unsigned int is_last = req->request.is_last;struct dwc3 *dwc = dep->dwc;struct usb_gadget *gadget = dwc->gadget;enum usb_device_speed speed = gadget->speed; - trb->size =DWC3_TRB_SIZE_LENGTH (length); +if (use_bounce_buffer) + dma = dep->dwc->bounce_addr; +else if (req->request.num_sgs >0 ) + dma =sg_dma_address (req->start_sg); +else + dma = req->request.dma; + + trb = &dep->trb_pool[dep->trb_enqueue]; + +if (!req->trb) { +dwc3_gadget_move_started_request (req); + req->trb = trb; + req->trb_dma =dwc3_trb_dma_offset (dep, trb); + } + + req->num_trbs++; + + trb->size =DWC3_TRB_SIZE_LENGTH (trb_length); trb->bpl =lower_32_bits (dma); trb->bph =upper_32_bits (dma);
@@ -1232,10 +1264,10 @@ static void __dwc3_prepare_one_trb(strucunsigned int mult =2 ;unsigned int maxp =usb_endpoint_maxp (ep->desc); -if (length <= (2 * maxp)) +if (trb_length <= (2 * maxp)) mult--; -if (length <= maxp) +if (trb_length <= maxp) mult--; trb->size |=DWC3_TRB_SIZE_PCM1 (mult);
@@ -1309,50 +1341,6 @@ static void __dwc3_prepare_one_trb(structrace_dwc3_prepare_trb (dep, trb); } -/** -* dwc3_prepare_one_trb - setup one TRB from one request -* @dep: endpoint for which this request is prepared -* @req: dwc3_request pointer -* @trb_length: buffer size of the TRB -* @chain: should this TRB be chained to the next? -* @node: only for isochronous endpoints. First TRB needs different type. -* @use_bounce_buffer: set to use bounce buffer -* @must_interrupt: set to interrupt on TRB completion -*/ -static void dwc3_prepare_one_trb (struct dwc3_ep *dep, -struct dwc3_request *req,unsigned int trb_length, -unsigned int chain,unsigned int node,bool use_bounce_buffer, -bool must_interrupt) -{ -struct dwc3_trb *trb; -dma_addr_t dma; -unsigned int stream_id = req->request.stream_id; -unsigned int short_not_ok = req->request.short_not_ok; -unsigned int no_interrupt = req->request.no_interrupt; -unsigned int is_last = req->request.is_last; - -if (use_bounce_buffer) - dma = dep->dwc->bounce_addr; -else if (req->request.num_sgs >0 ) - dma =sg_dma_address (req->start_sg); -else - dma = req->request.dma; - - trb = &dep->trb_pool[dep->trb_enqueue]; - -if (!req->trb) { -dwc3_gadget_move_started_request (req); - req->trb = trb; - req->trb_dma =dwc3_trb_dma_offset (dep, trb); - } - - req->num_trbs++; - -__dwc3_prepare_one_trb (dep, trb, dma, trb_length, chain, node, - stream_id, short_not_ok, no_interrupt, is_last, - must_interrupt); -} -static bool dwc3_needs_extra_trb (struct dwc3_ep *dep,struct dwc3_request *req) {unsigned int maxp =usb_endpoint_maxp (dep->endpoint.desc);
Greg Kroah-Hartman
maintainerPATCH 139/1157 usb: dwc3: gadget: fix high speed multiplier setting
In reply to Greg Kroah-HartmanFrom: Michael Grzeschik <[email protected]>
commit 8affe37c525d800a2628c4ecfaed13b77dc5634a upstream.
For High-Speed Transfers the prepare_one_trb function is calculating the multiplier setting for the trb based on the length parameter of the trb currently prepared. This assumption is wrong. For trbs with a sg list, the length of the actual request has to be taken instead.
--- drivers/usb/dwc3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc3/gadget.c +2 -2
@@ -1264,10 +1264,10 @@ static void dwc3_prepare_one_trb(structunsigned int mult =2 ;unsigned int maxp =usb_endpoint_maxp (ep->desc); -if (trb_length <= (2 * maxp)) +if (req->request.length <= (2 * maxp)) mult--; -if (trb_length <= maxp) +if (req->request.length <= maxp) mult--; trb->size |=DWC3_TRB_SIZE_PCM1 (mult);
Greg Kroah-Hartman
maintainerPATCH 140/1157 netfilter: nf_tables: do not allow SET_ID to refer to another table
In reply to Greg Kroah-HartmanFrom: Thadeu Lima de Souza Cascardo <[email protected]>
commit 470ee20e069a6d05ae549f7d0ef2bdbcee6a81b2 upstream.
When doing lookups for sets on the same batch by using its ID, a set from a different table can be used.
Then, when the table is removed, a reference to the set may be kept after the set is freed, leading to a potential use-after-free.
When looking for sets by ID, use the table that was used for the lookup by name, and only return sets belonging to that same table.
This fixes CVE-2022-2586, also reported as ZDI-CAN-17470.
--- net/netfilter/nf_tables_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +3 -1
@@ -3842,6 +3842,7 @@ static struct nft_set *nft_set_lookup_by }static struct nft_set *nft_set_lookup_byid (const struct net *net, +const struct nft_table *table,const struct nlattr *nla,u8 genmask) {struct nftables_pernet *nft_net =nft_pernet (net);
@@ -3853,6 +3854,7 @@ static struct nft_set *nft_set_lookup_bystruct nft_set *set =nft_trans_set (trans);if (id ==nft_trans_set_id (trans) && + set->table == table &&nft_active_genmask (set, genmask))return set; }
@@ -3873,7 +3875,7 @@ struct nft_set *nft_set_lookup_global(coif (!nla_set_id)return set; - set =nft_set_lookup_byid (net, nla_set_id, genmask); + set =nft_set_lookup_byid (net, table, nla_set_id, genmask); }return set; }
Greg Kroah-Hartman
maintainerPATCH 141/1157 netfilter: nf_tables: do not allow CHAIN_ID to refer to another table
In reply to Greg Kroah-HartmanFrom: Thadeu Lima de Souza Cascardo <[email protected]>
commit 95f466d22364a33d183509629d0879885b4f547e upstream.
When doing lookups for chains on the same batch by using its ID, a chain from a different table can be used. If a rule is added to a table but refers to a chain in a different table, it will be linked to the chain in table2, but would have expressions referring to objects in table1.
Then, when table1 is removed, the rule will not be removed as its linked to a chain in table2. When expressions in the rule are processed or removed, that will lead to a use-after-free.
When looking for chains by ID, use the table that was used for the lookup by name, and only return chains belonging to that same table.
--- net/netfilter/nf_tables_api.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/netfilter/nf_tables_api.c +4 -2
@@ -2472,6 +2472,7 @@ err: }static struct nft_chain *nft_chain_lookup_byid (const struct net *net, +const struct nft_table *table,const struct nlattr *nla) {struct nftables_pernet *nft_net =nft_pernet (net);
@@ -2482,6 +2483,7 @@ static struct nft_chain *nft_chain_lookustruct nft_chain *chain = trans->ctx.chain;if (trans->msg_type ==NFT_MSG_NEWCHAIN && + chain->table == table && id ==nft_trans_chain_id (trans))return chain; }
@@ -3417,7 +3419,7 @@ static int nf_tables_newrule(struct sk_breturn -EOPNOTSUPP ; }else if (nla[NFTA_RULE_CHAIN_ID ]) { - chain =nft_chain_lookup_byid (net, nla[NFTA_RULE_CHAIN_ID ]); + chain =nft_chain_lookup_byid (net, table, nla[NFTA_RULE_CHAIN_ID ]);if (IS_ERR (chain)) {NL_SET_BAD_ATTR (extack, nla[NFTA_RULE_CHAIN_ID ]);return PTR_ERR (chain);
@@ -9607,7 +9609,7 @@ static int nft_verdict_init(const struct tb[NFTA_VERDICT_CHAIN ], genmask); }else if (tb[NFTA_VERDICT_CHAIN_ID ]) { - chain =nft_chain_lookup_byid (ctx->net, + chain =nft_chain_lookup_byid (ctx->net, ctx->table, tb[NFTA_VERDICT_CHAIN_ID ]);if (IS_ERR (chain))return PTR_ERR (chain);
Greg Kroah-Hartman
maintainerPATCH 142/1157 netfilter: nf_tables: do not allow RULE_ID to refer to another chain
In reply to Greg Kroah-HartmanFrom: Thadeu Lima de Souza Cascardo <[email protected]>
commit 36d5b2913219ac853908b0f1c664345e04313856 upstream.
When doing lookups for rules on the same batch by using its ID, a rule from a different chain can be used. If a rule is added to a chain but tries to be positioned next to a rule from a different chain, it will be linked to chain2, but the use counter on chain1 would be the one to be incremented.
When looking for rules by ID, use the chain that was used for the lookup by name. The chain used in the context copied to the transaction needs to match that same chain. That way, struct nft_rule does not need to get enlarged with another member.
--- net/netfilter/nf_tables_api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/netfilter/nf_tables_api.c +5 -2
@@ -3373,6 +3373,7 @@ static int nft_table_validate(struct net }static struct nft_rule *nft_rule_lookup_byid (const struct net *net, +const struct nft_chain *chain,const struct nlattr *nla);#define NFT_RULE_MAXEXPRS 128
@@ -3461,7 +3462,7 @@ static int nf_tables_newrule(struct sk_breturn PTR_ERR (old_rule); } }else if (nla[NFTA_RULE_POSITION_ID ]) { - old_rule =nft_rule_lookup_byid (net, nla[NFTA_RULE_POSITION_ID ]); + old_rule =nft_rule_lookup_byid (net, chain, nla[NFTA_RULE_POSITION_ID ]);if (IS_ERR (old_rule)) {NL_SET_BAD_ATTR (extack, nla[NFTA_RULE_POSITION_ID ]);return PTR_ERR (old_rule);
@@ -3606,6 +3607,7 @@ err_release_expr: }static struct nft_rule *nft_rule_lookup_byid (const struct net *net, +const struct nft_chain *chain,const struct nlattr *nla) {struct nftables_pernet *nft_net =nft_pernet (net);
@@ -3616,6 +3618,7 @@ static struct nft_rule *nft_rule_lookup_struct nft_rule *rule =nft_trans_rule (trans);if (trans->msg_type ==NFT_MSG_NEWRULE && + trans->ctx.chain == chain && id ==nft_trans_rule_id (trans))return rule; }
@@ -3665,7 +3668,7 @@ static int nf_tables_delrule(struct sk_b err =nft_delrule (&ctx, rule); }else if (nla[NFTA_RULE_ID ]) { - rule =nft_rule_lookup_byid (net, nla[NFTA_RULE_ID ]); + rule =nft_rule_lookup_byid (net, chain, nla[NFTA_RULE_ID ]);if (IS_ERR (rule)) {NL_SET_BAD_ATTR (extack, nla[NFTA_RULE_ID ]);return PTR_ERR (rule);
Greg Kroah-Hartman
maintainerPATCH 143/1157 netfilter: nf_tables: upfront validation of data via nft_data_init()
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
commit 341b6941608762d8235f3fd1e45e4d7114ed8c2c upstream.
Instead of parsing the data and then validate that type and length are correct, pass a description of the expected data so it can be validated upfront before parsing it to bail out earlier.
This patch adds a new .size field to specify the maximum size of the data area. The .len field is optional and it is used as an input/output field, it provides the specific length of the expected data in the input path. If then .len field is not specified, then obtained length from the netlink attribute is stored. This is required by cmp, bitwise, range and immediate, which provide no netlink attribute that describes the data length. The immediate expression uses the destination register type to infer the expected data type.
Relying on opencoded validation of the expected data might lead to subtle bugs as described in 7e6bc1f6cabc ("netfilter: nf_tables:
stricter validation of element data").
--- include/net/netfilter/nf_tables.h | 4 - net/netfilter/nf_tables_api.c | 78 +++++++++++++++++++------------------- net/netfilter/nft_bitwise.c | 66 ++++++++++++++++---------------- net/netfilter/nft_cmp.c | 44 +++++++++------------ net/netfilter/nft_immediate.c | 22 +++++++++- net/netfilter/nft_range.c | 27 +++++-------- 6 files changed, 126 insertions(+), 115 deletions(-)
include/net/netfilter/nf_tables.h +2 -2
@@ -208,11 +208,11 @@ struct nft_ctx {struct nft_data_desc {enum nft_data_types type; +unsigned int size;unsigned int len; }; -int nft_data_init (const struct nft_ctx *ctx, -struct nft_data *data,unsigned int size, +int nft_data_init (const struct nft_ctx *ctx,struct nft_data *data,struct nft_data_desc *desc,const struct nlattr *nla);void nft_data_hold (const struct nft_data *data,enum nft_data_types type);void nft_data_release (const struct nft_data *data,enum nft_data_types type);
net/netfilter/nf_tables_api.c +40 -38
141 lines not on this page · raw message
net/netfilter/nft_bitwise.c +33 -33
112 lines not on this page · raw message
net/netfilter/nft_cmp.c +20 -24
94 lines not on this page · raw message
net/netfilter/nft_immediate.c +19 -3
@@ -29,20 +29,36 @@ static const struct nla_policy nft_immed [NFTA_IMMEDIATE_DATA] = { .type = NLA_NESTED }, }; +static enum nft_data_types nft_reg_to_type (const struct nlattr *nla) +{ +enum nft_data_types type; +u8 reg; + + reg =ntohl (nla_get_be32 (nla)); +if (reg ==NFT_REG_VERDICT ) + type =NFT_DATA_VERDICT ; +else + type =NFT_DATA_VALUE ; + +return type; +} +static int nft_immediate_init (const struct nft_ctx *ctx,const struct nft_expr *expr,const struct nlattr *const tb[]) {struct nft_immediate_expr *priv =nft_expr_priv (expr); -struct nft_data_desc desc; +struct nft_data_desc desc = { + .size =sizeof (priv->data), + };int err;if (tb[NFTA_IMMEDIATE_DREG ] ==NULL || tb[NFTA_IMMEDIATE_DATA ] ==NULL )return -EINVAL ; - err =nft_data_init (ctx, &priv->data,sizeof (priv->data), &desc, - tb[NFTA_IMMEDIATE_DATA ]); + desc.type =nft_reg_to_type (tb[NFTA_IMMEDIATE_DREG ]); + err =nft_data_init (ctx, &priv->data, &desc, tb[NFTA_IMMEDIATE_DATA ]);if (err <0 )return err;
net/netfilter/nft_range.c +12 -15
@@ -51,7 +51,14 @@ static int nft_range_init(const struct n const struct nlattr * const tb[]) {struct nft_range_expr *priv =nft_expr_priv (expr); -struct nft_data_desc desc_from, desc_to; +struct nft_data_desc desc_from = { + .type =NFT_DATA_VALUE , + .size =sizeof (priv->data_from), + }; +struct nft_data_desc desc_to = { + .type =NFT_DATA_VALUE , + .size =sizeof (priv->data_to), + };int err;u32 op;
@@ -61,26 +68,16 @@ static int nft_range_init(const struct n !tb[NFTA_RANGE_TO_DATA])return -EINVAL ; - err =nft_data_init (NULL , &priv->data_from,sizeof (priv->data_from), - &desc_from, tb[NFTA_RANGE_FROM_DATA ]); + err =nft_data_init (NULL , &priv->data_from, &desc_from, + tb[NFTA_RANGE_FROM_DATA ]);if (err <0 )return err; -if (desc_from.type !=NFT_DATA_VALUE ) { - err = -EINVAL ; - goto err1; - } - - err =nft_data_init (NULL , &priv->data_to,sizeof (priv->data_to), - &desc_to, tb[NFTA_RANGE_TO_DATA ]); + err =nft_data_init (NULL , &priv->data_to, &desc_to, + tb[NFTA_RANGE_TO_DATA ]);if (err <0 ) goto err1; -if (desc_to.type !=NFT_DATA_VALUE ) { - err = -EINVAL ; - goto err2; - } -if (desc_from.len != desc_to.len) { err = -EINVAL ; goto err2;
Greg Kroah-Hartman
maintainerPATCH 144/1157 netfilter: nf_tables: disallow jump to implicit chain from set element
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
commit f323ef3a0d49e147365284bc1f02212e617b7f09 upstream.
Extend struct nft_data_desc to add a flag field that specifies nft_data_init() is being called for set element data.
Use it to disallow jump to implicit chain from set element, only jump to chain via immediate expression is allowed.
--- include/net/netfilter/nf_tables.h | 5 +++++ net/netfilter/nf_tables_api.c | 4 ++++ 2 files changed, 9 insertions(+)
include/net/netfilter/nf_tables.h +5 -0
@@ -206,10 +206,15 @@ struct nft_ctx {bool report; }; +enum nft_data_desc_flags { +NFT_DATA_DESC_SETELEM = (1 <<0 ), +}; +struct nft_data_desc {enum nft_data_types type;unsigned int size;unsigned int len; +unsigned int flags; }; int nft_data_init(const struct nft_ctx *ctx, struct nft_data *data,
net/netfilter/nf_tables_api.c +4 -0
@@ -5226,6 +5226,7 @@ static int nft_setelem_parse_data(struct desc->type = dtype; desc->size =NFT_DATA_VALUE_MAXLEN ; desc->len = set->dlen; + desc->flags =NFT_DATA_DESC_SETELEM ;return nft_data_init (ctx, data, desc, attr); }
@@ -9611,6 +9612,9 @@ static int nft_verdict_init(const structreturn PTR_ERR (chain);if (nft_is_base_chain (chain))return -EOPNOTSUPP ; +if (desc->flags &NFT_DATA_DESC_SETELEM && + chain->flags &NFT_CHAIN_BINDING ) +return -EINVAL ; chain->use++; data->verdict.chain = chain;
Greg Kroah-Hartman
maintainerPATCH 145/1157 netfilter: nf_tables: fix null deref due to zeroed list head
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
commit 580077855a40741cf511766129702d97ff02f4d9 upstream.
In nf_tables_updtable, if nf_tables_table_enable returns an error, nft_trans_destroy is called to free the transaction object.
nft_trans_destroy() calls list_del(), but the transaction was never placed on a list -- the list head is all zeroes, this results in a null dereference:
BUG: KASAN: null-ptr-deref in nft_trans_destroy+0x26/0x59 Call Trace: nft_trans_destroy+0x26/0x59 nf_tables_newtable+0x4bc/0x9bc [..]
Its sane to assume that nft_trans_destroy() can be called on the transaction object returned by nft_trans_alloc(), so make sure the list head is initialised.
--- net/netfilter/nf_tables_api.c | 1 + 1 file changed, 1 insertion(+)
net/netfilter/nf_tables_api.c +1 -0
@@ -153,6 +153,7 @@ static struct nft_trans *nft_trans_allocif (trans ==NULL )return NULL ; +INIT_LIST_HEAD (&trans->list); trans->msg_type = msg_type; trans->ctx = *ctx;
Greg Kroah-Hartman
maintainerPATCH 146/1157 epoll: autoremove wakers even more aggressively
In reply to Greg Kroah-HartmanFrom: Benjamin Segall <[email protected]>
commit a16ceb13961068f7209e34d7984f8e42d2c06159 upstream.
If a process is killed or otherwise exits while having active network connections and many threads waiting on epoll_wait, the threads will all be woken immediately, but not removed from ep->wq. Then when network traffic scans ep->wq in wake_up, every wakeup attempt will fail, and will not remove the entries from the list.
This means that the cost of the wakeup attempt is far higher than usual, does not decrease, and this also competes with the dying threads trying to actually make progress and remove themselves from the wq.
Handle this by removing visited epoll wq entries unconditionally, rather than only when the wakeup succeeds - the structure of ep_poll means that the only potential loss is the timed_out->eavail heuristic, which now can race and result in a redundant ep_send_events attempt. (But only when incoming data and a timeout actually race, not on every timeout)
Shakeel added:
: We are seeing this issue in production with real workloads and it has : caused hard lockups. Particularly network heavy workloads with a lot : of threads in epoll_wait() can easily trigger this issue if they get : killed (oom-killed in our case).
--- fs/eventpoll.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
fs/eventpoll.c +22 -0
@@ -1747,6 +1747,21 @@ static struct timespec64 *ep_timeout_to_return to; } +/* +* autoremove_wake_function, but remove even on failure to wake up, because we +* know that default_wake_function/ttwu will only fail if the thread is already +* woken, and in that case the ep_poll loop will remove the entry anyways, not +* try to reuse it. +*/ +static int ep_autoremove_wake_function (struct wait_queue_entry *wq_entry, +unsigned int mode,int sync,void *key) +{ +int ret =default_wake_function (wq_entry, mode, sync, key); + +list_del_init (&wq_entry->entry); +return ret; +} +/** * ep_poll - Retrieves ready events, and delivers them to the caller-supplied * event buffer.
@@ -1828,8 +1843,15 @@ static int ep_poll(struct eventpoll *ep,* normal wakeup path no need to call __remove_wait_queue() * explicitly, thus ep->lock is not taken, which halts the * event delivery. +* +* In fact, we now use an even more aggressive function that +* unconditionally removes, because we don't reuse the wait +* entry between loop iterations. This lets us also avoid the +* performance issue if a process is killed, causing all of its +* threads to wake up without being removed normally. */ init_wait (&wait); + wait.func = ep_autoremove_wake_function;write_lock_irq (&ep->lock);/*
Greg Kroah-Hartman
maintainerPATCH 147/1157 x86: Handle idle=nomwait cmdline properly for x86_idle
In reply to Greg Kroah-HartmanFrom: Wyes Karny <[email protected]>
[ Upstream commit 8bcedb4ce04750e1ccc9a6b6433387f6a9166a56 ]
When kernel is booted with idle=nomwait do not use MWAIT as the default idle state.
If the user boots the kernel with idle=nomwait, it is a clear direction to not use mwait as the default idle state. However, the current code does not take this into consideration while selecting the default idle state on x86.
Fix it by checking for the idle=nomwait boot option in prefer_mwait_c1_over_halt().
Also update the documentation around idle=nomwait appropriately.
[ dhansen: tweak commit message ]
--- Documentation/admin-guide/pm/cpuidle.rst | 15 +++++++++------ arch/x86/kernel/process.c | 9 ++++++--- 2 files changed, 15 insertions(+), 9 deletions(-)
Documentation/admin-guide/pm/cpuidle.rst +9 -6
@@ -612,8 +612,8 @@ the ``menu`` governor to be used on the systems that use the ``ladder`` governor by default this way, for example. The other kernel command line parameters controlling CPU idle time management -described below are only relevant for the *x86* architecture and some of -them affect Intel processors only. +described below are only relevant for the *x86* architecture and references +to ``intel_idle`` affect Intel processors only. The *x86* architecture support code recognizes three kernel command line options related to CPU idle time management: ``idle=poll``, ``idle=halt``,
@@ -635,10 +635,13 @@ idle, so it very well may hurt single-thread computations performance as well as energy-efficiency. Thus using it for performance reasons may not be a good idea at all.] -The ``idle=nomwait`` option disables the ``intel_idle`` driver and causes -``acpi_idle`` to be used (as long as all of the information needed by it is -there in the system's ACPI tables), but it is not allowed to use the -``MWAIT`` instruction of the CPUs to ask the hardware to enter idle states. +The ``idle=nomwait`` option prevents the use of ``MWAIT`` instruction of +the CPU to enter idle states. When this option is used, the ``acpi_idle`` +driver will use the ``HLT`` instruction instead of ``MWAIT``. On systems +running Intel processors, this option disables the ``intel_idle`` driver +and forces the use of the ``acpi_idle`` driver instead. Note that in either +case, ``acpi_idle`` driver will function only if all the information needed +by it is in the system's ACPI tables. In addition to the architecture-level kernel command line options affecting CPU idle time management, there are parameters affecting individual ``CPUIdle``
arch/x86/kernel/process.c +6 -3
@@ -821,6 +821,10 @@ static void amd_e400_idle(void)*/ static int prefer_mwait_c1_over_halt (const struct cpuinfo_x86 *c) { +/* User has disallowed the use of MWAIT. Fallback to HALT */ +if (boot_option_idle_override ==IDLE_NOMWAIT ) +return 0 ; +if (c->x86_vendor !=X86_VENDOR_INTEL )return 0 ;
@@ -932,9 +936,8 @@ static int __init idle_setup(char *str) }else if (!strcmp (str,"nomwait" )) {/* * If the boot option of "idle=nomwait" is added, -* it means that mwait will be disabled for CPU C2/C3 -* states. In such case it won't touch the variable -* of boot_option_idle_override. +* it means that mwait will be disabled for CPU C1/C2/C3 +* states. */ boot_option_idle_override =IDLE_NOMWAIT ; }else
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 148/1157 arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic
In reply to Greg Kroah-HartmanFrom: Mark Rutland <[email protected]>
[ Upstream commit 4510bffb4d0246cdcc1f14c7367c026b807a862d ]
On most architectures, IRQ flag tracing is disabled in NMI context, and architectures need to define and select TRACE_IRQFLAGS_NMI_SUPPORT in order to enable this.
Commit:
859d069ee1ddd878 ("lockdep: Prepare for NMI IRQ state tracking")
Permitted IRQ flag tracing in NMI context, allowing lockdep to work in NMI context where an architecture had suitable entry logic. At the time, most architectures did not have such suitable entry logic, and this broke lockdep on such architectures. Thus, this was partially disabled in commit:
ed00495333ccc80f ("locking/lockdep: Fix TRACE_IRQFLAGS vs. NMIs")
... with architectures needing to select TRACE_IRQFLAGS_NMI_SUPPORT to enable IRQ flag tracing in NMI context.
Currently TRACE_IRQFLAGS_NMI_SUPPORT is defined under arch/x86/Kconfig.debug. Move it to arch/Kconfig so architectures can select it without having to provide their own definition.
Since the regular TRACE_IRQFLAGS_SUPPORT is selected by arch/x86/Kconfig, the select of TRACE_IRQFLAGS_NMI_SUPPORT is moved there too.
There should be no functional change as a result of this patch.
--- arch/Kconfig | 3 +++ arch/x86/Kconfig | 1 + arch/x86/Kconfig.debug | 3 --- 3 files changed, 4 insertions(+), 3 deletions(-)
arch/Kconfig +3 -0
@@ -223,6 +223,9 @@ config HAVE_FUNCTION_DESCRIPTORS config TRACE_IRQFLAGS_SUPPORT bool +config TRACE_IRQFLAGS_NMI_SUPPORT + bool + # # An arch should select this if it provides all these things: #
arch/x86/Kconfig +1 -0
@@ -278,6 +278,7 @@ config X86 select SYSCTL_EXCEPTION_TRACE select THREAD_INFO_IN_TASK select TRACE_IRQFLAGS_SUPPORT + select TRACE_IRQFLAGS_NMI_SUPPORT select USER_STACKTRACE_SUPPORT select VIRT_TO_BUS select HAVE_ARCH_KCSAN if X86_64
arch/x86/Kconfig.debug +0 -3
@@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -config TRACE_IRQFLAGS_NMI_SUPPORT - def_bool y - config EARLY_PRINTK_USB bool
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 149/1157 arm64: kasan: do not instrument stacktrace.c
In reply to Greg Kroah-HartmanFrom: Andrey Konovalov <[email protected]>
[ Upstream commit 802b91118d11227b527153849ea761b280691373 ]
Disable KASAN instrumentation of arch/arm64/kernel/stacktrace.c.
This speeds up Generic KASAN by 5-20%.
As a side-effect, KASAN is now unable to detect bugs in the stack trace collection code. This is taken as an acceptable downside.
Also replace READ_ONCE_NOCHECK() with READ_ONCE() in stacktrace.c. As the file is now not instrumented, there is no need to use the NOCHECK version of READ_ONCE().
--- arch/arm64/kernel/Makefile | 5 +++++ arch/arm64/kernel/stacktrace.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
arch/arm64/kernel/Makefile +5 -0
@@ -14,6 +14,11 @@ CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_syscall.o = -fstack-protector -fstack-protector-strong CFLAGS_syscall.o += -fno-stack-protector +# When KASAN is enabled, a stack trace is recorded for every alloc/free, which +# can significantly impact performance. Avoid instrumenting the stack trace +# collection code to minimize this impact. +KASAN_SANITIZE_stacktrace.o := n + # It's not safe to invoke KCOV when portions of the kernel environment aren't # available or are out-of-sync with HW state. Since `noinstr` doesn't always # inhibit KCOV instrumentation, disable it for the entire compilation unit.
arch/arm64/kernel/stacktrace.c +2 -2
@@ -124,8 +124,8 @@ static int notrace unwind_next(struct task_struct *tsk,* Record this frame record's values and location. The prev_fp and * prev_type are only meaningful to the next unwind_next() invocation. */ - state->fp =READ_ONCE_NOCHECK (*(unsigned long *)(fp)); - state->pc =READ_ONCE_NOCHECK (*(unsigned long *)(fp +8 )); + state->fp =READ_ONCE (*(unsigned long *)(fp)); + state->pc =READ_ONCE (*(unsigned long *)(fp +8 )); state->prev_fp = fp; state->prev_type = info.type;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 150/1157 arm64: stacktrace: use non-atomic __set_bit
In reply to Greg Kroah-HartmanFrom: Andrey Konovalov <[email protected]>
[ Upstream commit 446297b28a21244e4045026c4599d1b14a67e2ce ]
Use the non-atomic version of set_bit() in arch/arm64/kernel/stacktrace.c, as there is no concurrent accesses to frame->prev_type.
This speeds up stack trace collection and improves the boot time of Generic KASAN by 2-5%.
--- arch/arm64/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/stacktrace.c +1 -1
@@ -117,7 +117,7 @@ static int notrace unwind_next(struct task_struct *tsk,if (fp <= state->prev_fp)return -EINVAL ; }else { -set_bit (state->prev_type, state->stacks_done); +__set_bit (state->prev_type, state->stacks_done); }/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 151/1157 arm64: Do not forget syscall when starting a new thread.
In reply to Greg Kroah-HartmanFrom: Francis Laniel <[email protected]>
[ Upstream commit de6921856f99c11d3986c6702d851e1328d4f7f6 ]
Enable tracing of the execve*() system calls with the syscalls:sys_exit_execve tracepoint by removing the call to forget_syscall() when starting a new thread and preserving the value of regs->syscallno across exec.
--- arch/arm64/include/asm/processor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/include/asm/processor.h +2 -1
@@ -272,8 +272,9 @@ void tls_preserve_current_state(void);static inline void start_thread_common (struct pt_regs *regs,unsigned long pc) { +s32 previous_syscall = regs->syscallno;memset (regs,0 ,sizeof (*regs)); -forget_syscall (regs); + regs->syscallno = previous_syscall; regs->pc = pc;if (system_uses_irq_prio_masking ())
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 152/1157 arm64: fix oops in concurrently setting insn_emulation sysctls
In reply to Greg Kroah-HartmanFrom: haibinzhang (张海斌) <[email protected]>
[ Upstream commit af483947d472eccb79e42059276c4deed76f99a6 ]
emulation_proc_handler() changes table->data for proc_dointvec_minmax and can generate the following Oops if called concurrently with itself:
| Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 | Internal error: Oops: 96000006 [#1] SMP | Call trace: | update_insn_emulation_mode+0xc0/0x148 | emulation_proc_handler+0x64/0xb8 | proc_sys_call_handler+0x9c/0xf8 | proc_sys_write+0x18/0x20 | __vfs_write+0x20/0x48 | vfs_write+0xe4/0x1d0 | ksys_write+0x70/0xf8 | __arm64_sys_write+0x20/0x28 | el0_svc_common.constprop.0+0x7c/0x1c0 | el0_svc_handler+0x2c/0xa0 | el0_svc+0x8/0x200
To fix this issue, keep the table->data as &insn->current_mode and use container_of() to retrieve the insn pointer. Another mutex is used to protect against the current_mode update but not for retrieving insn_emulation as table->data is no longer changing.
--- arch/arm64/kernel/armv8_deprecated.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm64/kernel/armv8_deprecated.c +5 -4
@@ -59,6 +59,7 @@ struct insn_emulation {static LIST_HEAD (insn_emulation);static int nr_insn_emulated__initdata ;static DEFINE_RAW_SPINLOCK (insn_emulation_lock); +static DEFINE_MUTEX (insn_emulation_mutex);static void register_emulation_hooks (struct insn_emulation_ops *ops) {
@@ -207,10 +208,10 @@ static int emulation_proc_handler(struct ctl_table *table, int write, loff_t *ppos) {int ret =0 ; -struct insn_emulation *insn = (struct insn_emulation *) table->data; + struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode);enum insn_emulation_mode prev_mode = insn->current_mode; - table->data = &insn->current_mode; +mutex_lock (&insn_emulation_mutex); ret =proc_dointvec_minmax (table, write, buffer, lenp, ppos);if (ret || !write || prev_mode == insn->current_mode)
@@ -223,7 +224,7 @@ static int emulation_proc_handler(struct ctl_table *table, int write,update_insn_emulation_mode (insn,INSN_UNDEF ); } ret: - table->data = insn; +mutex_unlock (&insn_emulation_mutex);return ret; }
@@ -247,7 +248,7 @@ static void __init register_insn_emulation_sysctl(void) sysctl->maxlen =sizeof (int ); sysctl->procname = insn->ops->name; - sysctl->data = insn; + sysctl->data = &insn->current_mode; sysctl->extra1 = &insn->min; sysctl->extra2 = &insn->max; sysctl->proc_handler = emulation_proc_handler;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 153/1157 arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags"
In reply to Greg Kroah-HartmanFrom: Catalin Marinas <[email protected]>
[ Upstream commit 20794545c14692094a882d2221c251c4573e6adf ]
This reverts commit e5b8d9218951e59df986f627ec93569a0d22149b.
Pages mapped in user-space with PROT_MTE have the allocation tags either zeroed or copied/restored to some user values. In order for the kernel to access such pages via page_address(), resetting the tag in page->flags was necessary. This tag resetting was deferred to set_pte_at() -> mte_sync_page_tags() but it can race with another CPU reading the flags (via page_to_virt()):
P0 (mte_sync_page_tags): P1 (memcpy from virt_to_page):
Rflags!=0xff
Wflags=0xff
DMB (doesn't help)
Wtags=0
Rtags=0 // fault
Since now the post_alloc_hook() function resets the page->flags tag when unpoisoning is skipped for user pages (including the __GFP_ZEROTAGS case), revert the arm64 commit calling page_kasan_tag_reset().
--- arch/arm64/kernel/hibernate.c | 5 ----- arch/arm64/kernel/mte.c | 9 --------- arch/arm64/mm/copypage.c | 9 --------- arch/arm64/mm/mteswap.c | 9 --------- 4 files changed, 32 deletions(-)
arch/arm64/kernel/hibernate.c +0 -5
@@ -300,11 +300,6 @@ static void swsusp_mte_restore_tags(void)unsigned long pfn = xa_state.xa_index;struct page *page =pfn_to_online_page (pfn); -/* -* It is not required to invoke page_kasan_tag_reset(page) -* at this point since the tags stored in page->flags are -* already restored. -*/ mte_restore_page_tags (page_address (page), tags);mte_free_tag_storage (tags);
arch/arm64/kernel/mte.c +0 -9
@@ -48,15 +48,6 @@ static void mte_sync_page_tags(struct page *page, pte_t old_pte,if (!pte_is_tagged)return ; -page_kasan_tag_reset (page); -/* -* We need smp_wmb() in between setting the flags and clearing the -* tags because if another thread reads page->flags and builds a -* tagged address out of it, there is an actual dependency to the -* memory access, but on the current thread we do not guarantee that -* the new page->flags are visible before the tags were updated. -*/ -smp_wmb ();mte_clear_page_tags (page_address (page)); }
arch/arm64/mm/copypage.c +0 -9
@@ -23,15 +23,6 @@ void copy_highpage(struct page *to, struct page *from)if (system_supports_mte () &&test_bit (PG_mte_tagged, &from->flags)) {set_bit (PG_mte_tagged, &to->flags); -page_kasan_tag_reset (to); -/* -* We need smp_wmb() in between setting the flags and clearing the -* tags because if another thread reads page->flags and builds a -* tagged address out of it, there is an actual dependency to the -* memory access, but on the current thread we do not guarantee that -* the new page->flags are visible before the tags were updated. -*/ -smp_wmb ();mte_copy_page_tags (kto, kfrom); } }
arch/arm64/mm/mteswap.c +0 -9
@@ -53,15 +53,6 @@ bool mte_restore_tags(swp_entry_t entry, struct page *page)if (!tags)return false; -page_kasan_tag_reset (page); -/* -* We need smp_wmb() in between setting the flags and clearing the -* tags because if another thread reads page->flags and builds a -* tagged address out of it, there is an actual dependency to the -* memory access, but on the current thread we do not guarantee that -* the new page->flags are visible before the tags were updated. -*/ -smp_wmb ();mte_restore_page_tags (page_address (page), tags);return true;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 154/1157 arm64: errata: Remove AES hwcap for COMPAT tasks
In reply to Greg Kroah-HartmanFrom: James Morse <[email protected]>
[ Upstream commit 44b3834b2eed595af07021b1c64e6f9bc396398b ]
Cortex-A57 and Cortex-A72 have an erratum where an interrupt that occurs between a pair of AES instructions in aarch32 mode may corrupt the ELR. The task will subsequently produce the wrong AES result.
The AES instructions are part of the cryptographic extensions, which are optional. User-space software will detect the support for these instructions from the hwcaps. If the platform doesn't support these instructions a software implementation should be used.
Remove the hwcap bits on affected parts to indicate user-space should not use the AES instructions.
--- Documentation/arm64/silicon-errata.rst | 4 ++++ arch/arm64/Kconfig | 16 ++++++++++++++++ arch/arm64/kernel/cpu_errata.c | 16 ++++++++++++++++ arch/arm64/kernel/cpufeature.c | 14 +++++++++++++- arch/arm64/tools/cpucaps | 1 + 5 files changed, 50 insertions(+), 1 deletion(-)
Documentation/arm64/silicon-errata.rst +4 -0
@@ -82,10 +82,14 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A57 | #1319537 | ARM64_ERRATUM_1319367 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A57 | #1742098 | ARM64_ERRATUM_1742098 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A72 | #853709 | N/A | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A72 | #1319367 | ARM64_ERRATUM_1319367 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A72 | #1655431 | ARM64_ERRATUM_1742098 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A76 | #1188873,1418040| ARM64_ERRATUM_1418040 |
arch/arm64/Kconfig +16 -0
@@ -503,6 +503,22 @@ config ARM64_ERRATUM_834220 If unsure, say Y. +config ARM64_ERRATUM_1742098 + bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence" + depends on COMPAT + default y + help + This option removes the AES hwcap for aarch32 user-space to + workaround erratum 1742098 on Cortex-A57 and Cortex-A72. + + Affected parts may corrupt the AES state if an interrupt is + taken between a pair of AES instructions. These instructions + are only present if the cryptography extensions are present. + All software should have a fallback implementation for CPUs + that don't implement the cryptography extensions. + + If unsure, say Y. + config ARM64_ERRATUM_845719 bool "Cortex-A53: 845719: a load might read incorrect data" depends on COMPAT
arch/arm64/kernel/cpu_errata.c +16 -0
@@ -395,6 +395,14 @@ static struct midr_range trbe_write_out_of_range_cpus[] = { };#endif /* CONFIG_ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE */ +#ifdef CONFIG_ARM64_ERRATUM_1742098 +static struct midr_range broken_aarch32_aes[] = { +MIDR_RANGE (MIDR_CORTEX_A57 ,0 ,1 ,0xf ,0xf ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_A72 ), + {}, +}; +#endif /* CONFIG_ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE */ + const struct arm64_cpu_capabilities arm64_errata[] = {#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE {
@@ -657,6 +665,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = {/* Cortex-A510 r0p0 - r0p1 */ ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 1) }, +#endif +#ifdef CONFIG_ARM64_ERRATUM_1742098 + { + .desc = "ARM erratum 1742098", + .capability = ARM64_WORKAROUND_1742098, + CAP_MIDR_RANGE_LIST(broken_aarch32_aes), + .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, + }, #endif { }
arch/arm64/kernel/cpufeature.c +13 -1
@@ -79,6 +79,7 @@#include <asm/cpufeature.h> #include <asm/cpu_ops.h> #include <asm/fpsimd.h> +#include <asm/hwcap.h> #include <asm/insn.h> #include <asm/kvm_host.h> #include <asm/mmu_context.h>
@@ -1971,6 +1972,14 @@ static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap) }#endif /* CONFIG_ARM64_MTE */ +static void elf_hwcap_fixup (void ) +{ +#ifdef CONFIG_ARM64_ERRATUM_1742098 +if (cpus_have_const_cap (ARM64_WORKAROUND_1742098 )) + compat_elf_hwcap2 &= ~COMPAT_HWCAP2_AES ; +#endif /* ARM64_ERRATUM_1742098 */ +} +#ifdef CONFIG_KVM static bool is_kvm_protected_mode (const struct arm64_cpu_capabilities *entry,int __unused) {
@@ -3143,8 +3152,10 @@ void __init setup_cpu_features(void)setup_system_capabilities ();setup_elf_hwcaps (arm64_elf_hwcaps); -if (system_supports_32bit_el0 ()) +if (system_supports_32bit_el0 ()) {setup_elf_hwcaps (compat_elf_hwcaps); +elf_hwcap_fixup (); + }if (system_uses_ttbr0_pan ())pr_info ("emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching\n" );
@@ -3197,6 +3208,7 @@ static int enable_mismatched_32bit_el0(unsigned int cpu) cpu_active_mask);get_cpu_device (lucky_winner)->offline_disabled = true;setup_elf_hwcaps (compat_elf_hwcaps); +elf_hwcap_fixup ();pr_info ("Asymmetric 32-bit EL0 support detected on CPU %u; CPU hot-unplug disabled on CPU %u\n" , cpu, lucky_winner);return 0 ;
arch/arm64/tools/cpucaps +1 -0
@@ -61,6 +61,7 @@ WORKAROUND_1418040 WORKAROUND_1463225 WORKAROUND_1508412 WORKAROUND_1542419 +WORKAROUND_1742098 WORKAROUND_1902691 WORKAROUND_2038923 WORKAROUND_2064142
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 155/1157 ext2: Add more validity checks for inode counts
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
[ Upstream commit fa78f336937240d1bc598db817d638086060e7e9 ]
Add checks verifying number of inodes stored in the superblock matches the number computed from number of inodes per group. Also verify we have at least one block worth of inodes per group. This prevents crashes on corrupted filesystems.
--- fs/ext2/super.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
fs/ext2/super.c +10 -2
@@ -1059,9 +1059,10 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) sbi->s_frags_per_group); goto failed_mount; } -if (sbi->s_inodes_per_group > sb->s_blocksize *8 ) { +if (sbi->s_inodes_per_group < sbi->s_inodes_per_block || + sbi->s_inodes_per_group > sb->s_blocksize *8 ) {ext2_msg (sb,KERN_ERR , -"error: #inodes per group too big: %lu" , +"error: invalid #inodes per group: %lu" , sbi->s_inodes_per_group); goto failed_mount; }
@@ -1071,6 +1072,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) sbi->s_groups_count = ((le32_to_cpu (es->s_blocks_count) -le32_to_cpu (es->s_first_data_block) -1 ) /EXT2_BLOCKS_PER_GROUP (sb)) +1 ; +if ((u64 )sbi->s_groups_count * sbi->s_inodes_per_group != +le32_to_cpu (es->s_inodes_count)) { +ext2_msg (sb,KERN_ERR ,"error: invalid #inodes: %u vs computed %llu" , +le32_to_cpu (es->s_inodes_count), + (u64 )sbi->s_groups_count * sbi->s_inodes_per_group); + goto failed_mount; + } db_count = (sbi->s_groups_count +EXT2_DESC_PER_BLOCK (sb) -1 ) /EXT2_DESC_PER_BLOCK (sb); sbi->s_group_desc = kmalloc_array(db_count,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 156/1157 sched/fair: Introduce SIS_UTIL to search idle CPU based on sum of util_avg
In reply to Greg Kroah-HartmanFrom: Chen Yu <[email protected]>
[ Upstream commit 70fb5ccf2ebb09a0c8ebba775041567812d45f86 ]
[Problem Statement]select_idle_cpu() might spend too much time searching for an idle CPU, when the system is overloaded.
The following histogram is the time spent in select_idle_cpu(), when running 224 instances of netperf on a system with 112 CPUs per LLC domain:
@usecs:
[0] 533 | | [1] 5495 | | [2, 4) 12008 | | [4, 8) 239252 | | [8, 16) 4041924 |@@@@@@@@@@@@@@ | [16, 32) 12357398 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | [32, 64) 14820255 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [64, 128) 13047682 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | [128, 256) 8235013 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | [256, 512) 4507667 |@@@@@@@@@@@@@@@ | [512, 1K) 2600472 |@@@@@@@@@ | [1K, 2K) 927912 |@@@ | [2K, 4K) 218720 | | [4K, 8K) 98161 | | [8K, 16K) 37722 | | [16K, 32K) 6715 | | [32K, 64K) 477 | | [64K, 128K) 7 | |
netperf latency usecs:
=======
case load Lat_99th std%TCP_RR thread-224 257.39 ( 0.21)
The time spent in select_idle_cpu() is visible to netperf and might have a negative impact.
[Symptom analysis]
The patch [1] from Mel Gorman has been applied to track the efficiency of select_idle_sibling. Copy the indicators here:
SIS Search Efficiency(se_eff%):
A ratio expressed as a percentage of runqueues scanned versus idle CPUs found. A 100% efficiency indicates that the target, prev or recent CPU of a task was idle at wakeup. The lower the efficiency, the more runqueues were scanned before an idle CPU was found.
SIS Domain Search Efficiency(dom_eff%):
Similar, except only for the slower SIS
patch.
SIS Fast Success Rate(fast_rate%):
Percentage of SIS that used target, prev or recent CPUs.
SIS Success rate(success_rate%):
Percentage of scans that found an idle CPU.
The test is based on Aubrey's schedtests tool, including netperf, hackbench, schbench and tbench.
Test on vanilla kernel:schedstat_parse.py -f netperf_vanilla.log
case load se_eff% dom_eff% fast_rate% success_rate%
TCP_RR 28 threads 99.978 18.535 99.995 100.000 TCP_RR 56 threads 99.397 5.671 99.964 100.000 TCP_RR 84 threads 21.721 6.818 73.632 100.000 TCP_RR 112 threads 12.500 5.533 59.000 100.000 TCP_RR 140 threads 8.524 4.535 49.020 100.000 TCP_RR 168 threads 6.438 3.945 40.309 99.999 TCP_RR 196 threads 5.397 3.718 32.320 99.982 TCP_RR 224 threads 4.874 3.661 25.775 99.767 UDP_RR 28 threads 99.988 17.704 99.997 100.000 UDP_RR 56 threads 99.528 5.977 99.970 100.000 UDP_RR 84 threads 24.219 6.992 76.479 100.000 UDP_RR 112 threads 13.907 5.706 62.538 100.000 UDP_RR 140 threads 9.408 4.699 52.519 100.000 UDP_RR 168 threads 7.095 4.077 44.352 100.000 UDP_RR 196 threads 5.757 3.775 35.764 99.991 UDP_RR 224 threads 5.124 3.704 28.748 99.860
schedstat_parse.py -f schbench_vanilla.log
(each group has 28 tasks)
case load se_eff% dom_eff% fast_rate% success_rate%
normal 1 mthread 99.152 6.400 99.941 100.000 normal 2 mthreads 97.844 4.003 99.908 100.000 normal 3 mthreads 96.395 2.118 99.917 99.998 normal 4 mthreads 55.288 1.451 98.615 99.804 normal 5 mthreads 7.004 1.870 45.597 61.036 normal 6 mthreads 3.354 1.346 20.777 34.230 normal 7 mthreads 2.183 1.028 11.257 21.055 normal 8 mthreads 1.653 0.825 7.849 15.549
schedstat_parse.py -f hackbench_vanilla.log
(each group has 28 tasks)
case load se_eff% dom_eff% fast_rate% success_rate%
process-pipe 1 group 99.991 7.692 99.999 100.000 process-pipe 2 groups 99.934 4.615 99.997 100.000 process-pipe 3 groups 99.597 3.198 99.987 100.000 process-pipe 4 groups 98.378 2.464 99.958 100.000 process-pipe 5 groups 27.474 3.653 89.811 99.800 process-pipe 6 groups 20.201 4.098 82.763 99.570 process-pipe 7 groups 16.423 4.156 77.398 99.316 process-pipe 8 groups 13.165 3.920 72.232 98.828 process-sockets 1 group 99.977 5.882 99.999 100.000 process-sockets 2 groups 99.927 5.505 99.996 100.000 process-sockets 3 groups 99.397 3.250 99.980 100.000 process-sockets 4 groups 79.680 4.258 98.864 99.998 process-sockets 5 groups 7.673 2.503 63.659 92.115 process-sockets 6 groups 4.642 1.584 58.946 88.048 process-sockets 7 groups 3.493 1.379 49.816 81.164 process-sockets 8 groups 3.015 1.407 40.845 75.500 threads-pipe 1 group 99.997 0.000 100.000 100.000 threads-pipe 2 groups 99.894 2.932 99.997 100.000 threads-pipe 3 groups 99.611 4.117 99.983 100.000 threads-pipe 4 groups 97.703 2.624 99.937 100.000 threads-pipe 5 groups 22.919 3.623 87.150 99.764 threads-pipe 6 groups 18.016 4.038 80.491 99.557 threads-pipe 7 groups 14.663 3.991 75.239 99.247 threads-pipe 8 groups 12.242 3.808 70.651 98.644 threads-sockets 1 group 99.990 6.667 99.999 100.000 threads-sockets 2 groups 99.940 5.114 99.997 100.000 threads-sockets 3 groups 99.469 4.115 99.977 100.000 threads-sockets 4 groups 87.528 4.038 99.400 100.000 threads-sockets 5 groups 6.942 2.398 59.244 88.337 threads-sockets 6 groups 4.359 1.954 49.448 87.860 threads-sockets 7 groups 2.845 1.345 41.198 77.102 threads-sockets 8 groups 2.871 1.404 38.512 74.312
schedstat_parse.py -f tbench_vanilla.log
case load se_eff% dom_eff% fast_rate% success_rate%
loopback 28 threads 99.976 18.369 99.995 100.000 loopback 56 threads 99.222 7.799 99.934 100.000 loopback 84 threads 19.723 6.819 70.215 100.000 loopback 112 threads 11.283 5.371 55.371 99.999 loopback 140 threads 0.000 0.000 0.000 0.000 loopback 168 threads 0.000 0.000 0.000 0.000 loopback 196 threads 0.000 0.000 0.000 0.000 loopback 224 threads 0.000 0.000 0.000 0.000
According to the test above, if the system becomes busy, the SIS Search Efficiency(se_eff%) drops significantly. Although some benchmarks would finally find an idle CPU(success_rate% = 100%), it is doubtful whether it is worth it to search the whole LLC domain.
[Proposal]
It would be ideal to have a crystal ball to answer this question:
How many CPUs must a wakeup path walk down, before it can find an idle CPU? Many potential metrics could be used to predict the number. One candidate is the sum of util_avg in this LLC domain. The benefit of choosing util_avg is that it is a metric of accumulated historic activity, which seems to be smoother than instantaneous metrics (such as rq->nr_running). Besides, choosing the sum of util_avg would help predict the load of the LLC domain more precisely, because SIS_PROP uses one CPU's idle time to estimate the total LLC domain idle time.
In summary, the lower the util_avg is, the more select_idle_cpu() should scan for idle CPU, and vice versa. When the sum of util_avg in this LLC domain hits 85% or above, the scan stops. The reason to choose 85% as the threshold is that this is the imbalance_pct(117) when a LLC sched group is overloaded.
Introduce the quadratic function:
y = SCHED_CAPACITY_SCALE - p * x^2
and y'= y / SCHED_CAPACITY_SCALE
x is the ratio of sum_util compared to the CPU capacity:
x = sum_util / (llc_weight * SCHED_CAPACITY_SCALE) y' is the ratio of CPUs to be scanned in the LLC domain, and the number of CPUs to scan is calculated by:
nr_scan = llc_weight * y'
Choosing quadratic function is because:
[1] Compared to the linear function, it scans more aggressively when the sum_util is low.
[2] Compared to the exponential function, it is easier to calculate.
[3] It seems that there is no accurate mapping between the sum of util_avg and the number of CPUs to be scanned. Use heuristic scan for now.
For a platform with 112 CPUs per LLC, the number of CPUs to scan is:
sum_util% 0 5 15 25 35 45 55 65 75 85 86 ... scan_nr 112 111 108 102 93 81 65 47 25 1 0 ...
For a platform with 16 CPUs per LLC, the number of CPUs to scan is:
sum_util% 0 5 15 25 35 45 55 65 75 85 86 ... scan_nr 16 15 15 14 13 11 9 6 3 0 0 ...
Furthermore, to minimize the overhead of calculating the metrics in select_idle_cpu(), borrow the statistics from periodic load balance. As mentioned by Abel, on a platform with 112 CPUs per LLC, the sum_util calculated by periodic load balance after 112 ms would decay to about 0.5 * 0.5 * 0.5 * 0.7 = 8.75%, thus bringing a delay in reflecting the latest utilization. But it is a trade-off. Checking the util_avg in newidle load balance would be more frequent, but it brings overhead - multiple CPUs write/read the per-LLC shared variable and introduces cache contention. Tim also mentioned that, it is allowed to be non-optimal in terms of scheduling for the short-term variations, but if there is a long-term trend in the load behavior, the scheduler can adjust for that.
When SIS_UTIL is enabled, the select_idle_cpu() uses the nr_scan calculated by SIS_UTIL instead of the one from SIS_PROP. As Peter and Mel suggested, SIS_UTIL should be enabled by default.
This patch is based on the util_avg, which is very sensitive to the CPU frequency invariance. There is an issue that, when the max frequency has been clamp, the util_avg would decay insanely fast when
the CPU is idle. Commit addca285120b ("cpufreq: intel_pstate: Handle no_turbo in frequency invariance") could be used to mitigate this symptom, by adjusting the arch_max_freq_ratio when turbo is disabled. But this issue is still not thoroughly fixed, because the current code is unaware of the user-specified max CPU frequency.
[Test result]
netperf and tbench were launched with 25% 50% 75% 100% 125% 150% 175% 200% of CPU number respectively. Hackbench and schbench were launched by 1, 2 ,4, 8 groups. Each test lasts for 100 seconds and repeats 3 times.
The following is the benchmark result comparison between baseline:vanilla v5.19-rc1 and compare:patched kernel. Positive compare% indicates better performance.
Each netperf test is a:
netperf -4 -H 127.0.1 -t TCP/UDP_RR -c -C -l 100
netperf.throughput
=======
case load baseline(std%) compare%( std%) TCP_RR 28 threads 1.00 ( 0.34) -0.16 ( 0.40) TCP_RR 56 threads 1.00 ( 0.19) -0.02 ( 0.20) TCP_RR 84 threads 1.00 ( 0.39) -0.47 ( 0.40) TCP_RR 112 threads 1.00 ( 0.21) -0.66 ( 0.22) TCP_RR 140 threads 1.00 ( 0.19) -0.69 ( 0.19) TCP_RR 168 threads 1.00 ( 0.18) -0.48 ( 0.18) TCP_RR 196 threads 1.00 ( 0.16) +194.70 ( 16.43) TCP_RR 224 threads 1.00 ( 0.16) +197.30 ( 7.85) UDP_RR 28 threads 1.00 ( 0.37) +0.35 ( 0.33) UDP_RR 56 threads 1.00 ( 11.18) -0.32 ( 0.21) UDP_RR 84 threads 1.00 ( 1.46) -0.98 ( 0.32) UDP_RR 112 threads 1.00 ( 28.85) -2.48 ( 19.61) UDP_RR 140 threads 1.00 ( 0.70) -0.71 ( 14.04) UDP_RR 168 threads 1.00 ( 14.33) -0.26 ( 11.16) UDP_RR 196 threads 1.00 ( 12.92) +186.92 ( 20.93) UDP_RR 224 threads 1.00 ( 11.74) +196.79 ( 18.62)
Take the 224 threads as an example, the SIS search metrics changes are illustrated below:
vanilla patched
4544492 +237.5% 15338634 sched_debug.cpu.sis_domain_search.avg
38539 +39686.8% 15333634 sched_debug.cpu.sis_failed.avg
128300000 -87.9% 15551326 sched_debug.cpu.sis_scanned.avg
5842896 +162.7% 15347978 sched_debug.cpu.sis_search.avgThere is -87.9% less CPU scans after patched, which indicates lower overhead. Besides, with this patch applied, there is -13% less rq lock contention in perf-profile.calltrace.cycles-pp._raw_spin_lock.raw_spin_rq_lock_nested .try_to_wake_up.default_wake_function.woken_wake_function.
This might help explain the performance improvement - Because this patch allows the waking task to remain on the previous CPU, rather than grabbing other CPUs' lock.
Each hackbench test is a:
hackbench -g $job --process/threads --pipe/sockets -l 1000000 -s 100 hackbench.throughput
=========
case load baseline(std%) compare%( std%) process-pipe 1 group 1.00 ( 1.29) +0.57 ( 0.47) process-pipe 2 groups 1.00 ( 0.27) +0.77 ( 0.81) process-pipe 4 groups 1.00 ( 0.26) +1.17 ( 0.02) process-pipe 8 groups 1.00 ( 0.15) -4.79 ( 0.02) process-sockets 1 group 1.00 ( 0.63) -0.92 ( 0.13) process-sockets 2 groups 1.00 ( 0.03) -0.83 ( 0.14) process-sockets 4 groups 1.00 ( 0.40) +5.20 ( 0.26) process-sockets 8 groups 1.00 ( 0.04) +3.52 ( 0.03) threads-pipe 1 group 1.00 ( 1.28) +0.07 ( 0.14) threads-pipe 2 groups 1.00 ( 0.22) -0.49 ( 0.74) threads-pipe 4 groups 1.00 ( 0.05) +1.88 ( 0.13) threads-pipe 8 groups 1.00 ( 0.09) -4.90 ( 0.06) threads-sockets 1 group 1.00 ( 0.25) -0.70 ( 0.53) threads-sockets 2 groups 1.00 ( 0.10) -0.63 ( 0.26) threads-sockets 4 groups 1.00 ( 0.19) +11.92 ( 0.24) threads-sockets 8 groups 1.00 ( 0.08) +4.31 ( 0.11)
Each tbench test is a:
tbench -t 100 $job 127.0.0.1
tbench.throughput
======
case load baseline(std%) compare%( std%) loopback 28 threads 1.00 ( 0.06) -0.14 ( 0.09) loopback 56 threads 1.00 ( 0.03) -0.04 ( 0.17) loopback 84 threads 1.00 ( 0.05) +0.36 ( 0.13) loopback 112 threads 1.00 ( 0.03) +0.51 ( 0.03) loopback 140 threads 1.00 ( 0.02) -1.67 ( 0.19) loopback 168 threads 1.00 ( 0.38) +1.27 ( 0.27) loopback 196 threads 1.00 ( 0.11) +1.34 ( 0.17) loopback 224 threads 1.00 ( 0.11) +1.67 ( 0.22)
Each schbench test is a:
schbench -m $job -t 28 -r 100 -s 30000 -c 30000
schbench.latency_90%_us
========
case load baseline(std%) compare%( std%) normal 1 mthread 1.00 ( 31.22) -7.36 ( 20.25)* normal 2 mthreads 1.00 ( 2.45) -0.48 ( 1.79) normal 4 mthreads 1.00 ( 1.69) +0.45 ( 0.64) normal 8 mthreads 1.00 ( 5.47) +9.81 ( 14.28)
*Consider the Standard Deviation, this -7.36% regression might not be valid.
Also, a OLTP workload with a commercial RDBMS has been tested, and there is no significant change.
There were concerns that unbalanced tasks among CPUs would cause problems. For example, suppose the LLC domain is composed of 8 CPUs, and 7 tasks are bound to CPU0~CPU6, while CPU7 is idle:
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 util_avg 1024 1024 1024 1024 1024 1024 1024 0
Since the util_avg ratio is 87.5%( = 7/8 ), which is higher than 85%, select_idle_cpu() will not scan, thus CPU7 is undetected during scan. But according to Mel, it is unlikely the CPU7 will be idle all the time because CPU7 could pull some tasks via CPU_NEWLY_IDLE.
lkp(kernel test robot) has reported a regression on stress-ng.sock on a very busy system. According to the sched_debug statistics, it might be caused by SIS_UTIL terminates the scan and chooses a previous CPU earlier, and this might introduce more context switch, especially involuntary preemption, which impacts a busy stress-ng. This regression has shown that, not all benchmarks in every scenario benefit from idle CPU scan limit, and it needs further investigation.
Besides, there is slight regression in hackbench's 16 groups case when the LLC domain has 16 CPUs. Prateek mentioned that we should scan aggressively in an LLC domain with 16 CPUs. Because the cost to search for an idle one among 16 CPUs is negligible. The current patch aims to propose a generic solution and only considers the util_avg. Something like the below could be applied on top of the current patch to fulfill the requirement:
if (llc_weight <= 16) nr_scan = nr_scan * 32 / llc_weight;
For LLC domain with 16 CPUs, the nr_scan will be expanded to 2 times large. The smaller the CPU number this LLC domain has, the larger nr_scan will be expanded. This needs further investigation.
There is also ongoing work[2] from Abel to filter out the busy CPUs during wakeup, to further speed up the idle CPU scan. And it could be a following-up optimization on top of this change.
--- include/linux/sched/topology.h | 1 + kernel/sched/fair.c | 87 ++++++++++++++++++++++++++++++++++ kernel/sched/features.h | 3 +- 3 files changed, 90 insertions(+), 1 deletion(-)
include/linux/sched/topology.h +1 -0
@@ -81,6 +81,7 @@ struct sched_domain_shared {atomic_t ref;atomic_t nr_busy_cpus;int has_idle_cores; +int nr_idle_scan; };struct sched_domain {
kernel/sched/fair.c +87 -0
123 lines not on this page · raw message
kernel/sched/features.h +2 -1
@@ -60,7 +60,8 @@ SCHED_FEAT(TTWU_QUEUE, true)/* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. */ -SCHED_FEAT (SIS_PROP , true) +SCHED_FEAT(SIS_PROP, false) +SCHED_FEAT (SIS_UTIL , true)/* * Issue a WARN when we do multiple update_rq_clock() calls
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 157/1157 genirq: Dont return error on missing optional irq_request_resources()
In reply to Greg Kroah-HartmanFrom: Antonio Borneo <[email protected]>
[ Upstream commit 95001b756467ecc9f5973eb5e74e97699d9bbdf1 ]
Function irq_chip::irq_request_resources() is reported as optional in the declaration of struct irq_chip.
If the parent irq_chip does not implement it, we should ignore it and return.
Don't return error if the functions is missing.
--- kernel/irq/chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/chip.c +2 -1
@@ -1516,7 +1516,8 @@ int irq_chip_request_resources_parent(struct irq_data *data)if (data->chip->irq_request_resources)return data->chip->irq_request_resources (data); -return -ENOSYS ; +/* no error on missing optional irq_chip::irq_request_resources */ +return 0 ; }EXPORT_SYMBOL_GPL (irq_chip_request_resources_parent);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 158/1157 irqchip/mips-gic: Only register IPI domain when SMP is enabled
In reply to Greg Kroah-HartmanFrom: Samuel Holland <[email protected]>
[ Upstream commit 8190cc572981f2f13b6ffc26c7cfa7899e5d3ccc ]
The MIPS GIC irqchip driver may be selected in a uniprocessor configuration, but it unconditionally registers an IPI domain.
Limit the part of the driver dealing with IPIs to only be compiled when GENERIC_IRQ_IPI is enabled, which corresponds to an SMP configuration.
--- drivers/irqchip/Kconfig | 3 +- drivers/irqchip/irq-mips-gic.c | 80 +++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 27 deletions(-)
drivers/irqchip/Kconfig +2 -1
@@ -322,7 +322,8 @@ config KEYSTONE_IRQ config MIPS_GIC bool - select GENERIC_IRQ_IPI + select GENERIC_IRQ_IPI if SMP + select IRQ_DOMAIN_HIERARCHY select MIPS_CM config INGENIC_IRQ
drivers/irqchip/irq-mips-gic.c +54 -26
129 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 159/1157 genirq: GENERIC_IRQ_IPI depends on SMP
In reply to Greg Kroah-HartmanFrom: Samuel Holland <[email protected]>
[ Upstream commit 0f5209fee90b4544c58b4278d944425292789967 ]
The generic IPI code depends on the IRQ affinity mask being allocated and initialized. This will not be the case if SMP is disabled. Fix up the remaining driver that selected GENERIC_IRQ_IPI in a non-SMP config.
--- drivers/irqchip/Kconfig | 2 +- kernel/irq/Kconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/irqchip/Kconfig +1 -1
@@ -177,7 +177,7 @@ config MADERA_IRQ config IRQ_MIPS_CPU bool select GENERIC_IRQ_CHIP - select GENERIC_IRQ_IPI if SYS_SUPPORTS_MULTITHREADING + select GENERIC_IRQ_IPI if SMP && SYS_SUPPORTS_MULTITHREADING select IRQ_DOMAIN select GENERIC_IRQ_EFFECTIVE_AFF_MASK
kernel/irq/Kconfig +1 -0
@@ -82,6 +82,7 @@ config IRQ_FASTEOI_HIERARCHY_HANDLERS # Generic IRQ IPI support config GENERIC_IRQ_IPI bool + depends on SMP select IRQ_DOMAIN_HIERARCHY # Generic MSI interrupt support
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 160/1157 sched/fair: fix case with reduced capacity CPU
In reply to Greg Kroah-HartmanFrom: Vincent Guittot <[email protected]>
[ Upstream commit c82a69629c53eda5233f13fc11c3c01585ef48a2 ]
The capacity of the CPU available for CFS tasks can be reduced because of other activities running on the latter. In such case, it's worth trying to move CFS tasks on a CPU with more available capacity.
The rework of the load balance has filtered the case when the CPU is classified to be fully busy but its capacity is reduced.
Check if CPU's capacity is reduced while gathering load balance statistic and classify it group_misfit_task instead of group_fully_busy so we can try to move the load on another CPU.
--- kernel/sched/fair.c | 54 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 12 deletions(-)
kernel/sched/fair.c +42 -12
@@ -7597,8 +7597,8 @@ enum group_type {*/ group_fully_busy,/* -* SD_ASYM_CPUCAPACITY only: One task doesn't fit with CPU's capacity -* and must be migrated to a more powerful CPU. +* One task doesn't fit with CPU's capacity and must be migrated to a +* more powerful CPU. */ group_misfit_task,/*
@@ -8681,6 +8681,19 @@ sched_asym(struct lb_env *env, struct sd_lb_stats *sds, struct sg_lb_stats *sgsreturn sched_asym_prefer (env->dst_cpu, group->asym_prefer_cpu); } +static inline bool +sched_reduced_capacity (struct rq *rq,struct sched_domain *sd) +{ +/* +* When there is more than 1 task, the group_overloaded case already +* takes care of cpu with reduced capacity +*/ +if (rq->cfs.h_nr_running !=1 ) +return false; + +return check_cpu_capacity (rq, sd); +} +/** * update_sg_lb_stats - Update sched_group's statistics for load balancing. * @env: The load balancing environment.
@@ -8703,8 +8716,9 @@ static inline void update_sg_lb_stats(struct lb_env *env,for_each_cpu_and (i,sched_group_span (group), env->cpus) {struct rq *rq =cpu_rq (i); +unsigned long load =cpu_load (rq); - sgs->group_load +=cpu_load (rq); + sgs->group_load += load; sgs->group_util +=cpu_util_cfs (i); sgs->group_runnable +=cpu_runnable (rq); sgs->sum_h_nr_running += rq->cfs.h_nr_running;
@@ -8734,11 +8748,17 @@ static inline void update_sg_lb_stats(struct lb_env *env,if (local_group)continue ; -/* Check for a misfit task on the cpu */ -if (env->sd->flags &SD_ASYM_CPUCAPACITY && - sgs->group_misfit_task_load < rq->misfit_task_load) { - sgs->group_misfit_task_load = rq->misfit_task_load; - *sg_status |=SG_OVERLOAD ; +if (env->sd->flags &SD_ASYM_CPUCAPACITY ) { +/* Check for a misfit task on the cpu */ +if (sgs->group_misfit_task_load < rq->misfit_task_load) { + sgs->group_misfit_task_load = rq->misfit_task_load; + *sg_status |=SG_OVERLOAD ; + } + }else if ((env->idle !=CPU_NOT_IDLE ) && +sched_reduced_capacity (rq, env->sd)) { +/* Check for a task running on a CPU with reduced capacity */ +if (sgs->group_misfit_task_load < load) + sgs->group_misfit_task_load = load; } }
@@ -8791,7 +8811,8 @@ static bool update_sd_pick_busiest(struct lb_env *env,* CPUs in the group should either be possible to resolve * internally or be covered by avg_load imbalance (eventually). */ -if (sgs->group_type == group_misfit_task && +if ((env->sd->flags &SD_ASYM_CPUCAPACITY ) && + (sgs->group_type == group_misfit_task) && (!capacity_greater (capacity_of (env->dst_cpu), sg->sgc->max_capacity) || sds->local_stat.group_type != group_has_spare))return false;
@@ -9412,9 +9433,18 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s busiest = &sds->busiest_stat;if (busiest->group_type == group_misfit_task) { -/* Set imbalance to allow misfit tasks to be balanced. */ - env->migration_type = migrate_misfit; - env->imbalance =1 ; +if (env->sd->flags &SD_ASYM_CPUCAPACITY ) { +/* Set imbalance to allow misfit tasks to be balanced. */ + env->migration_type = migrate_misfit; + env->imbalance =1 ; + }else { +/* +* Set load imbalance to allow moving task from cpu +* with reduced capacity. +*/ + env->migration_type = migrate_load; + env->imbalance = busiest->group_misfit_task_load; + }return ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 161/1157 sched/core: Always flush pending blk_plug
In reply to Greg Kroah-HartmanFrom: John Keeping <[email protected]>
[ Upstream commit 401e4963bf45c800e3e9ea0d3a0289d738005fd4 ]
With CONFIG_PREEMPT_RT, it is possible to hit a deadlock between two normal priority tasks (SCHED_OTHER, nice level zero):
INFO: task kworker/u8:0:8 blocked for more than 491 seconds. Not tainted 5.15.49-rt46 #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/u8:0 state:D stack: 0 pid: 8 ppid: 2 flags:0x00000000 Workqueue: writeback wb_workfn (flush-7:0) [<c08a3a10>] (__schedule) from [<c08a3d84>] (schedule+0xdc/0x134) [<c08a3d84>] (schedule) from [<c08a65a0>] (rt_mutex_slowlock_block.constprop.0+0xb8/0x174) [<c08a65a0>] (rt_mutex_slowlock_block.constprop.0) from [<c08a6708>] +(rt_mutex_slowlock.constprop.0+0xac/0x174) [<c08a6708>] (rt_mutex_slowlock.constprop.0) from [<c0374d60>] (fat_write_inode+0x34/0x54) [<c0374d60>] (fat_write_inode) from [<c0297304>] (__writeback_single_inode+0x354/0x3ec) [<c0297304>] (__writeback_single_inode) from [<c0297998>] (writeback_sb_inodes+0x250/0x45c) [<c0297998>] (writeback_sb_inodes) from [<c0297c20>] (__writeback_inodes_wb+0x7c/0xb8) [<c0297c20>] (__writeback_inodes_wb) from [<c0297f24>] (wb_writeback+0x2c8/0x2e4) [<c0297f24>] (wb_writeback) from [<c0298c40>] (wb_workfn+0x1a4/0x3e4) [<c0298c40>] (wb_workfn) from [<c0138ab8>] (process_one_work+0x1fc/0x32c) [<c0138ab8>] (process_one_work) from [<c0139120>] (worker_thread+0x22c/0x2d8) [<c0139120>] (worker_thread) from [<c013e6e0>] (kthread+0x16c/0x178) [<c013e6e0>] (kthread) from [<c01000fc>] (ret_from_fork+0x14/0x38) Exception stack(0xc10e3fb0 to 0xc10e3ff8) 3fa0: 00000000 00000000 00000000 00000000 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 INFO: task tar:2083 blocked for more than 491 seconds. Not tainted 5.15.49-rt46 #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:tar state:D stack: 0 pid: 2083 ppid: 2082 flags:0x00000000 [<c08a3a10>] (__schedule) from [<c08a3d84>] (schedule+0xdc/0x134) [<c08a3d84>] (schedule) from [<c08a41b0>] (io_schedule+0x14/0x24) [<c08a41b0>] (io_schedule) from [<c08a455c>] (bit_wait_io+0xc/0x30) [<c08a455c>] (bit_wait_io) from [<c08a441c>] (__wait_on_bit_lock+0x54/0xa8) [<c08a441c>] (__wait_on_bit_lock) from [<c08a44f4>] (out_of_line_wait_on_bit_lock+0x84/0xb0) [<c08a44f4>] (out_of_line_wait_on_bit_lock) from [<c0371fb0>] (fat_mirror_bhs+0xa0/0x144) [<c0371fb0>] (fat_mirror_bhs) from [<c0372a68>] (fat_alloc_clusters+0x138/0x2a4) [<c0372a68>] (fat_alloc_clusters) from [<c0370b14>] (fat_alloc_new_dir+0x34/0x250) [<c0370b14>] (fat_alloc_new_dir) from [<c03787c0>] (vfat_mkdir+0x58/0x148) [<c03787c0>] (vfat_mkdir) from [<c0277b60>] (vfs_mkdir+0x68/0x98) [<c0277b60>] (vfs_mkdir) from [<c027b484>] (do_mkdirat+0xb0/0xec) [<c027b484>] (do_mkdirat) from [<c0100060>] (ret_fast_syscall+0x0/0x1c) Exception stack(0xc2e1bfa8 to 0xc2e1bff0) bfa0: 01ee42f0 01ee4208 01ee42f0 000041ed 00000000 00004000 bfc0: 01ee42f0 01ee4208 00000000 00000027 01ee4302 00000004 000dcb00 01ee4190 bfe0: 000dc368 bed11924 0006d4b0 b6ebddfc
Here the kworker is waiting on msdos_sb_info::s_lock which is held by tar which is in turn waiting for a buffer which is locked waiting to be flushed, but this operation is plugged in the kworker.
The lock is a normal struct mutex, so tsk_is_pi_blocked() will always return false on !RT and thus the behaviour changes for RT.
It seems that the intent here is to skip blk_flush_plug() in the case where a non-preemptible lock (such as a spinlock) has been converted to a rtmutex on RT, which is the case covered by the SM_RTLOCK_WAIT schedule flag. But sched_submit_work() is only called from schedule() which is never called in this scenario, so the check can simply be deleted.
Looking at the history of the -rt patchset, in fact this change was present from v5.9.1-rt20 until being dropped in v5.13-rt1 as it was part of a larger patch [1] most of which was replaced by commit b4bfa3fcfe3b ("sched/core: Rework the __schedule() preempt argument").
As described in [1]:
The schedule process must distinguish between blocking on a regular sleeping lock (rwsem and mutex) and a RT-only sleeping lock (spinlock and rwlock):
- rwsem and mutex must flush block requests (blk_schedule_flush_plug()) even if blocked on a lock. This can not deadlock because this also happens for non-RT.
There should be a warning if the scheduling point is within a RCU read section.
- spinlock and rwlock must not flush block requests. This will deadlock if the callback attempts to acquire a lock which is already acquired. Similarly to being preempted, there should be no warning if the scheduling point is within a RCU read section.
and with the tsk_is_pi_blocked() in the scheduler path, we hit the first issue.
--- include/linux/sched/rt.h | 8 -------- kernel/sched/core.c | 8 ++++++-- 2 files changed, 6 insertions(+), 10 deletions(-)
include/linux/sched/rt.h +0 -8
@@ -39,20 +39,12 @@ static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *p) }extern void rt_mutex_setprio (struct task_struct *p,struct task_struct *pi_task);extern void rt_mutex_adjust_pi (struct task_struct *p); -static inline bool tsk_is_pi_blocked (struct task_struct *tsk) -{ -return tsk->pi_blocked_on !=NULL ; -}#else static inline struct task_struct *rt_mutex_get_top_task (struct task_struct *task) {return NULL ; }# define rt_mutex_adjust_pi (p) do { } while (0) -static inline bool tsk_is_pi_blocked (struct task_struct *tsk) -{ -return false; -}#endif extern void normalize_rt_tasks (void );
kernel/sched/core.c +6 -2
@@ -6500,8 +6500,12 @@ static inline void sched_submit_work(struct task_struct *tsk)io_wq_worker_sleeping (tsk); } -if (tsk_is_pi_blocked (tsk)) -return ; +/* +* spinlock and rwlock must not flush block requests. This will +* deadlock if the callback attempts to acquire a lock which is +* already acquired. +*/ +SCHED_WARN_ON (current->__state &TASK_RTLOCK_WAIT );/* * If we are going to sleep and we have plugged IO queued,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 162/1157 irqchip/mips-gic: Check the return value of ioremap() in gic_of_init()
In reply to Greg Kroah-HartmanFrom: William Dean <[email protected]>
[ Upstream commit 71349cc85e5930dce78ed87084dee098eba24b59 ]
The function ioremap() in gic_of_init() can fail, so its return value should be checked.
--- drivers/irqchip/irq-mips-gic.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/irqchip/irq-mips-gic.c +4 -0
@@ -783,6 +783,10 @@ static int __init gic_of_init(struct device_node *node, } mips_gic_base =ioremap (gic_base, gic_len); +if (!mips_gic_base) { +pr_err ("Failed to ioremap gic_base\n" ); +return -ENOMEM ; + } gicconfig =read_gic_config (); gic_shared_intrs =FIELD_GET (GIC_CONFIG_NUMINTERRUPTS , gicconfig);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 163/1157 ARM: dts: imx6ul: add missing properties for sram
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 5655699cf5cff9f4c4ee703792156bdd05d1addf ]
All 3 properties are required by sram.yaml. Fixes the dtbs_check warning:
sram@900000: '#address-cells' is a required property sram@900000: '#size-cells' is a required property sram@900000: 'ranges' is a required property
--- arch/arm/boot/dts/imx6ul.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/imx6ul.dtsi +3 -0
@@ -149,6 +149,9 @@ soc { ocram: sram@900000 { compatible = "mmio-sram"; reg = <0x00900000 0x20000>; + ranges = <0 0x00900000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; }; intc: interrupt-controller@a01000 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 164/1157 ARM: dts: imx6ul: change operating-points to uint32-matrix
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit edb67843983bbdf61b4c8c3c50618003d38bb4ae ]
operating-points is a uint32-matrix as per opp-v1.yaml. Change it accordingly. While at it, change fsl,soc-operating-points as well, although there is no bindings file (yet). But they should have the same format. Fixes the dt_binding_check warning:
cpu@0: operating-points:0: [696000, 1275000, 528000, 1175000, 396000, 1025000, 198000, 950000] is too long
cpu@0: operating-points:0: Additional items are not allowed (528000, 1175000, 396000, 1025000, 198000, 950000 were unexpected)
--- arch/arm/boot/dts/imx6ul.dtsi | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
arch/arm/boot/dts/imx6ul.dtsi +10 -12
@@ -64,20 +64,18 @@ cpu0: cpu@0 { clock-frequency = <696000000>; clock-latency = <61036>; /* two CLK32 periods */ #cooling-cells = <2>; - operating-points = < + operating-points = /* kHz uV */ - 696000 1275000 - 528000 1175000 - 396000 1025000 - 198000 950000 - >; - fsl,soc-operating-points = < + <696000 1275000>, + <528000 1175000>, + <396000 1025000>, + <198000 950000>; + fsl,soc-operating-points = /* KHz uV */ - 696000 1275000 - 528000 1175000 - 396000 1175000 - 198000 1175000 - >; + <696000 1275000>, + <528000 1175000>, + <396000 1175000>, + <198000 1175000>; clocks = <&clks IMX6UL_CLK_ARM>, <&clks IMX6UL_CLK_PLL2_BUS>, <&clks IMX6UL_CLK_PLL2_PFD2>,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 165/1157 ARM: dts: imx6ul: fix keypad compatible
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 7d15e0c9a515494af2e3199741cdac7002928a0e ]
According to binding, the compatible shall only contain imx6ul and imx21 compatibles. Fixes the dt_binding_check warning:
keypad@20b8000: compatible: 'oneOf' conditional failed, one must be fixed:
['fsl,imx6ul-kpp', 'fsl,imx6q-kpp', 'fsl,imx21-kpp'] is too long Additional items are not allowed ('fsl,imx6q-kpp', 'fsl,imx21-kpp' were unexpected)
Additional items are not allowed ('fsl,imx21-kpp' was unexpected) 'fsl,imx21-kpp' was expected
--- arch/arm/boot/dts/imx6ul.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6ul.dtsi +1 -1
@@ -544,7 +544,7 @@ fec2: ethernet@20b4000 { }; kpp: keypad@20b8000 { - compatible = "fsl,imx6ul-kpp", "fsl,imx6q-kpp", "fsl,imx21-kpp"; + compatible = "fsl,imx6ul-kpp", "fsl,imx21-kpp"; reg = <0x020b8000 0x4000>; interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6UL_CLK_KPP>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 166/1157 ARM: dts: imx6ul: fix csi node compatible
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit e0aca931a2c7c29c88ebf37f9c3cd045e083483d ]
"fsl,imx6ul-csi" was never listed as compatible to "fsl,imx7-csi", neither in yaml bindings, nor previous txt binding. Remove the imx7 part. Fixes the dt schema check warning:
csi@21c4000: compatible: 'oneOf' conditional failed, one must be fixed:
['fsl,imx6ul-csi', 'fsl,imx7-csi'] is too long
Additional items are not allowed ('fsl,imx7-csi' was unexpected) 'fsl,imx8mm-csi' was expected
--- arch/arm/boot/dts/imx6ul.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6ul.dtsi +1 -1
@@ -999,7 +999,7 @@ cpu_speed_grade: speed-grade@10 { }; csi: csi@21c4000 { - compatible = "fsl,imx6ul-csi", "fsl,imx7-csi"; + compatible = "fsl,imx6ul-csi"; reg = <0x021c4000 0x4000>; interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6UL_CLK_CSI>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 167/1157 ARM: dts: imx6ul: fix lcdif node compatible
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 1a884d17ca324531634cce82e9f64c0302bdf7de ]
In yaml binding "fsl,imx6ul-lcdif" is listed as compatible to imx6sx-lcdif, but not imx28-lcdif. Change the list accordingly. Fixes the dt_binding_check warning:
lcdif@21c8000: compatible: 'oneOf' conditional failed, one must be fixed:
['fsl,imx6ul-lcdif', 'fsl,imx28-lcdif'] is too long
Additional items are not allowed ('fsl,imx28-lcdif' was unexpected) 'fsl,imx6ul-lcdif' is not one of ['fsl,imx23-lcdif', 'fsl,imx28-lcdif', 'fsl,imx6sx-lcdif']
'fsl,imx6sx-lcdif' was expected
--- arch/arm/boot/dts/imx6ul.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6ul.dtsi +1 -1
@@ -1008,7 +1008,7 @@ csi: csi@21c4000 { }; lcdif: lcdif@21c8000 { - compatible = "fsl,imx6ul-lcdif", "fsl,imx28-lcdif"; + compatible = "fsl,imx6ul-lcdif", "fsl,imx6sx-lcdif"; reg = <0x021c8000 0x4000>; interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6UL_CLK_LCDIF_PIX>,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 168/1157 ARM: dts: imx6ul: fix qspi node compatible
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 0c6cf86e1ab433b2d421880fdd9c6e954f404948 ]
imx6ul is not compatible to imx6sx, both have different erratas. Fixes the dt_binding_check warning:
spi@21e0000: compatible: 'oneOf' conditional failed, one must be fixed:
['fsl,imx6ul-qspi', 'fsl,imx6sx-qspi'] is too long Additional items are not allowed ('fsl,imx6sx-qspi' was unexpected) 'fsl,imx6ul-qspi' is not one of ['fsl,ls1043a-qspi'] 'fsl,imx6ul-qspi' is not one of ['fsl,imx8mq-qspi'] 'fsl,ls1021a-qspi' was expected
'fsl,imx7d-qspi' was expected
--- arch/arm/boot/dts/imx6ul.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6ul.dtsi +1 -1
@@ -1029,7 +1029,7 @@ pxp: pxp@21cc000 { qspi: spi@21e0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "fsl,imx6ul-qspi", "fsl,imx6sx-qspi"; + compatible = "fsl,imx6ul-qspi"; reg = <0x021e0000 0x4000>, <0x60000000 0x10000000>; reg-names = "QuadSPI", "QuadSPI-memory"; interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 169/1157 ARM: dts: BCM5301X: Add DT for Meraki MR26
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
[ Upstream commit 935327a73553001f8d81375c76985d05f604507f ]
Meraki MR26 is an EOL wireless access point featuring a PoE ethernet port and two dual-band 3x3 MIMO 802.11n radios and 1x1 dual-band WIFI dedicated to scanning.
Thank you Amir for the unit and PSU.
Hardware info:
SOC : Broadcom BCM53015A1KFEBG (dual-core Cortex-A9 CPU at 800 MHz)
RAM : SK Hynix Inc. H5TQ1G63EFR, 1 GBit DDR3 SDRAM = 128 MiB
NAND : Spansion S34ML01G100TF100, 1 GBit SLC NAND Flash = 128 MiB
ETH : 1 GBit Ethernet Port - PoE (TPS23754 PoE Interface)
WIFI0 : Broadcom BCM43431KMLG, BCM43431 802.11 abgn (3x3:3) WIFI1 : Broadcom BCM43431KMLG, BCM43431 802.11 abgn (3x3:3) WIFI2 : Broadcom BCM43428 "Air Marshal" 802.11 abgn (1x1:1)
BUTTON: One reset key behind a small hole next to the Ethernet Port LEDS : One amber (fault), one white (indicator) LED, separate RGB-LED MISC : Atmel AT24C64 8KiB EEPROM i2c
: Ti INA219 26V, 12-bit, i2c output current/voltage/power monitor
SERIAL:
WARNING: The serial port needs a TTL/RS-232 3V3 level converter! The Serial setting is 115200-8-N-1. The board has a populated right angle 1x4 0.1" pinheader.
The pinout is: VCC (next to J3, has the pin 1 indicator), RX, TX, GND.
Odd stuff:
- uboot does not support lzma compression, but gzip'd uImage/DTB work.
- uboot claims to support FIT, but fails to pass the DTB to the kernel. Appending the dtb after the kernel image works.
- RGB-controller is supported through an external userspace program.
- The ubi partition contains a "board-config" volume. It stores the MAC Address (0x66 in binary) and Serial No. (0x7c alpha-numerical).
- SoC's temperature sensor always reports that it is on fire. This causes the system to immediately shutdown! Looking at reported "418 degree Celsius" suggests that this sensor is not working.
WIFI:
b43 is able to initialize all three WIFIs @ 802.11bg.
| b43-phy0: Broadcom 43431 WLAN found (core revision 29) | bcma-pci-bridge 0000:01:00.0: bus1: Switched to core: 0x812 | b43-phy0: Found PHY: Analog 9, Type 7 (HT), Revision 1 | b43-phy0: Found Radio: Manuf 0x17F, ID 0x2059, Revision 0, Version 1 | b43-phy0 warning: 5 GHz band is unsupported on this PHY | b43-phy1: Broadcom 43431 WLAN found (core revision 29) | bcma-pci-bridge 0001:01:00.0: bus2: Switched to core: 0x812 | b43-phy1: Found PHY: Analog 9, Type 7 (HT), Revision 1 | b43-phy1: Found Radio: Manuf 0x17F, ID 0x2059, Revision 0, Version 1 | b43-phy1 warning: 5 GHz band is unsupported on this PHY | b43-phy2: Broadcom 43228 WLAN found (core revision 30) | bcma-pci-bridge 0002:01:00.0: bus3: Switched to core: 0x812 | b43-phy2: Found PHY: Analog 9, Type 4 (N), Revision 16 | b43-phy2: Found Radio: Manuf 0x17F, ID 0x2057, Revision 9, Version 1 | Broadcom 43xx driver loaded [ Features: NL ]
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm53015-meraki-mr26.dts | 166 +++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 arch/arm/boot/dts/bcm53015-meraki-mr26.dts
arch/arm/boot/dts/Makefile +1 -0
@@ -135,6 +135,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ bcm47094-luxul-xwr-3150-v1.dtb \ bcm47094-netgear-r8500.dtb \ bcm47094-phicomm-k3.dtb \ + bcm53015-meraki-mr26.dtb \ bcm53016-meraki-mr32.dtb \ bcm94708.dtb \ bcm94709.dtb \
arch/arm/boot/dts/bcm53015-meraki-mr26.dts new file +166 -0
166 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 170/1157 ARM: dts: ux500: Fix Janice accelerometer mounting matrix
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
[ Upstream commit 013fda41c03e6bcb3dc416669187b609e9e5fdbc ]
This was fixed wrong so fix it again. Now verified by using iio-sensor-proxy monitor-sensor test program.
--- arch/arm/boot/dts/ste-ux500-samsung-janice.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/ste-ux500-samsung-janice.dts +2 -2
@@ -633,8 +633,8 @@ i2c-gate { accelerometer@8 { compatible = "bosch,bma222"; reg = <0x08>; - mount-matrix = "0", "1", "0", - "-1", "0", "0", + mount-matrix = "0", "-1", "0", + "1", "0", "0", "0", "0", "1"; vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 171/1157 ARM: dts: ux500: Fix Codina accelerometer mounting matrix
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
[ Upstream commit 0b2152e428ab91533a02888ff24e52e788dc4637 ]
This was fixed wrong so fix it again. Now verified by using iio-sensor-proxy monitor-sensor test program.
--- arch/arm/boot/dts/ste-ux500-samsung-codina.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/ste-ux500-samsung-codina.dts +2 -2
@@ -598,8 +598,8 @@ lisd3dh@19 { reg = <0x19>; vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V - mount-matrix = "0", "-1", "0", - "1", "0", "0", + mount-matrix = "0", "1", "0", + "-1", "0", "0", "0", "0", "1"; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 172/1157 ARM: dts: ux500: Fix Gavini accelerometer mounting matrix
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
[ Upstream commit e24c75f02a81d6ddac0072cbd7a03e799c19d558 ]
This was fixed wrong so fix it. Now verified by using iio-sensor-proxy monitor-sensor test program.
--- arch/arm/boot/dts/ste-ux500-samsung-gavini.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/ste-ux500-samsung-gavini.dts +2 -2
@@ -527,8 +527,8 @@ i2c-gate { accelerometer@18 { compatible = "bosch,bma222e"; reg = <0x18>; - mount-matrix = "0", "1", "0", - "-1", "0", "0", + mount-matrix = "0", "-1", "0", + "1", "0", "0", "0", "0", "1"; vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 173/1157 arm64: dts: qcom: timer should use only 32-bit size
In reply to Greg Kroah-HartmanFrom: David Heidelberg <[email protected]>
[ Upstream commit 458ebdbb8e5d596a462d8125cec74142ff5dfa97 ]
There's no reason the timer needs > 32-bits of address or size. Since we using 32-bit size, we need to define ranges properly.
Fixes warnings as:
```
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: timer@17c90000: #size-cells:0:0: 1 was expected
From schema: Documentation/devicetree/bindings/timer/arm,arch_timer_mmio.yaml
```--- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sc7180.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sc7280.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sdm845.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sm6350.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sm8150.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sm8250.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sm8350.dtsi | 22 +++++++++++----------- arch/arm64/boot/dts/qcom/sm8450.dtsi | 22 +++++++++++----------- 9 files changed, 99 insertions(+), 99 deletions(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +11 -11
@@ -525,9 +525,9 @@ timer { }; timer@b120000 { - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x10000000>; compatible = "arm,armv7-timer-mem"; reg = <0x0 0x0b120000 0x0 0x1000>;
@@ -535,49 +535,49 @@ frame@b120000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x0b121000 0x0 0x1000>, - <0x0 0x0b122000 0x0 0x1000>; + reg = <0x0b121000 0x1000>, + <0x0b122000 0x1000>; }; frame@b123000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0xb123000 0x0 0x1000>; + reg = <0x0b123000 0x1000>; status = "disabled"; }; frame@b124000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x0b124000 0x0 0x1000>; + reg = <0x0b124000 0x1000>; status = "disabled"; }; frame@b125000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x0b125000 0x0 0x1000>; + reg = <0x0b125000 0x1000>; status = "disabled"; }; frame@b126000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x0b126000 0x0 0x1000>; + reg = <0x0b126000 0x1000>; status = "disabled"; }; frame@b127000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x0b127000 0x0 0x1000>; + reg = <0x0b127000 0x1000>; status = "disabled"; }; frame@b128000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x0b128000 0x0 0x1000>; + reg = <0x0b128000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sc7180.dtsi +11 -11
@@ -3384,9 +3384,9 @@ watchdog@17c10000 { }; timer@17c20000{ - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; compatible = "arm,armv7-timer-mem"; reg = <0 0x17c20000 0 0x1000>;
@@ -3394,49 +3394,49 @@ frame@17c21000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c21000 0 0x1000>, - <0 0x17c22000 0 0x1000>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; }; frame@17c23000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c23000 0 0x1000>; + reg = <0x17c23000 0x1000>; status = "disabled"; }; frame@17c25000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c25000 0 0x1000>; + reg = <0x17c25000 0x1000>; status = "disabled"; }; frame@17c27000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c27000 0 0x1000>; + reg = <0x17c27000 0x1000>; status = "disabled"; }; frame@17c29000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c29000 0 0x1000>; + reg = <0x17c29000 0x1000>; status = "disabled"; }; frame@17c2b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c2b000 0 0x1000>; + reg = <0x17c2b000 0x1000>; status = "disabled"; }; frame@17c2d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c2d000 0 0x1000>; + reg = <0x17c2d000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sc7280.dtsi +11 -11
@@ -4771,9 +4771,9 @@ watchdog@17c10000 { }; timer@17c20000 { - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; compatible = "arm,armv7-timer-mem"; reg = <0 0x17c20000 0 0x1000>;
@@ -4781,49 +4781,49 @@ frame@17c21000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c21000 0 0x1000>, - <0 0x17c22000 0 0x1000>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; }; frame@17c23000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c23000 0 0x1000>; + reg = <0x17c23000 0x1000>; status = "disabled"; }; frame@17c25000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c25000 0 0x1000>; + reg = <0x17c25000 0x1000>; status = "disabled"; }; frame@17c27000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c27000 0 0x1000>; + reg = <0x17c27000 0x1000>; status = "disabled"; }; frame@17c29000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c29000 0 0x1000>; + reg = <0x17c29000 0x1000>; status = "disabled"; }; frame@17c2b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c2b000 0 0x1000>; + reg = <0x17c2b000 0x1000>; status = "disabled"; }; frame@17c2d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17c2d000 0 0x1000>; + reg = <0x17c2d000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sdm845.dtsi +11 -11
@@ -4948,9 +4948,9 @@ slimbam: dma-controller@17184000 { }; timer@17c90000 { - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; compatible = "arm,armv7-timer-mem"; reg = <0 0x17c90000 0 0x1000>;
@@ -4958,49 +4958,49 @@ frame@17ca0000 { frame-number = <0>; interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17ca0000 0 0x1000>, - <0 0x17cb0000 0 0x1000>; + reg = <0x17ca0000 0x1000>, + <0x17cb0000 0x1000>; }; frame@17cc0000 { frame-number = <1>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17cc0000 0 0x1000>; + reg = <0x17cc0000 0x1000>; status = "disabled"; }; frame@17cd0000 { frame-number = <2>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17cd0000 0 0x1000>; + reg = <0x17cd0000 0x1000>; status = "disabled"; }; frame@17ce0000 { frame-number = <3>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17ce0000 0 0x1000>; + reg = <0x17ce0000 0x1000>; status = "disabled"; }; frame@17cf0000 { frame-number = <4>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17cf0000 0 0x1000>; + reg = <0x17cf0000 0x1000>; status = "disabled"; }; frame@17d00000 { frame-number = <5>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17d00000 0 0x1000>; + reg = <0x17d00000 0x1000>; status = "disabled"; }; frame@17d10000 { frame-number = <6>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0 0x17d10000 0 0x1000>; + reg = <0x17d10000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sm6350.dtsi +11 -11
@@ -1304,57 +1304,57 @@ timer@17c20000 { compatible = "arm,armv7-timer-mem"; reg = <0x0 0x17c20000 0x0 0x1000>; clock-frequency = <19200000>; - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; frame@17c21000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c21000 0x0 0x1000>, - <0x0 0x17c22000 0x0 0x1000>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; }; frame@17c23000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c23000 0x0 0x1000>; + reg = <0x17c23000 0x1000>; status = "disabled"; }; frame@17c25000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c25000 0x0 0x1000>; + reg = <0x17c25000 0x1000>; status = "disabled"; }; frame@17c27000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c27000 0x0 0x1000>; + reg = <0x17c27000 0x1000>; status = "disabled"; }; frame@17c29000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c29000 0x0 0x1000>; + reg = <0x17c29000 0x1000>; status = "disabled"; }; frame@17c2b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2b000 0x0 0x1000>; + reg = <0x17c2b000 0x1000>; status = "disabled"; }; frame@17c2d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2d000 0x0 0x1000>; + reg = <0x17c2d000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sm8150.dtsi +11 -11
@@ -3944,9 +3944,9 @@ watchdog@17c10000 { }; timer@17c20000 { - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; compatible = "arm,armv7-timer-mem"; reg = <0x0 0x17c20000 0x0 0x1000>; clock-frequency = <19200000>;
@@ -3955,49 +3955,49 @@ frame@17c21000{ frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c21000 0x0 0x1000>, - <0x0 0x17c22000 0x0 0x1000>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; }; frame@17c23000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c23000 0x0 0x1000>; + reg = <0x17c23000 0x1000>; status = "disabled"; }; frame@17c25000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c25000 0x0 0x1000>; + reg = <0x17c25000 0x1000>; status = "disabled"; }; frame@17c27000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c26000 0x0 0x1000>; + reg = <0x17c26000 0x1000>; status = "disabled"; }; frame@17c29000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c29000 0x0 0x1000>; + reg = <0x17c29000 0x1000>; status = "disabled"; }; frame@17c2b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2b000 0x0 0x1000>; + reg = <0x17c2b000 0x1000>; status = "disabled"; }; frame@17c2d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2d000 0x0 0x1000>; + reg = <0x17c2d000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sm8250.dtsi +11 -11
@@ -4867,9 +4867,9 @@ watchdog@17c10000 { }; timer@17c20000 { - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; compatible = "arm,armv7-timer-mem"; reg = <0x0 0x17c20000 0x0 0x1000>; clock-frequency = <19200000>;
@@ -4878,49 +4878,49 @@ frame@17c21000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c21000 0x0 0x1000>, - <0x0 0x17c22000 0x0 0x1000>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; }; frame@17c23000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c23000 0x0 0x1000>; + reg = <0x17c23000 0x1000>; status = "disabled"; }; frame@17c25000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c25000 0x0 0x1000>; + reg = <0x17c25000 0x1000>; status = "disabled"; }; frame@17c27000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c27000 0x0 0x1000>; + reg = <0x17c27000 0x1000>; status = "disabled"; }; frame@17c29000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c29000 0x0 0x1000>; + reg = <0x17c29000 0x1000>; status = "disabled"; }; frame@17c2b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2b000 0x0 0x1000>; + reg = <0x17c2b000 0x1000>; status = "disabled"; }; frame@17c2d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2d000 0x0 0x1000>; + reg = <0x17c2d000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sm8350.dtsi +11 -11
@@ -1933,9 +1933,9 @@ intc: interrupt-controller@17a00000 { timer@17c20000 { compatible = "arm,armv7-timer-mem"; - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; reg = <0x0 0x17c20000 0x0 0x1000>; clock-frequency = <19200000>;
@@ -1943,49 +1943,49 @@ frame@17c21000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c21000 0x0 0x1000>, - <0x0 0x17c22000 0x0 0x1000>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; }; frame@17c23000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c23000 0x0 0x1000>; + reg = <0x17c23000 0x1000>; status = "disabled"; }; frame@17c25000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c25000 0x0 0x1000>; + reg = <0x17c25000 0x1000>; status = "disabled"; }; frame@17c27000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c27000 0x0 0x1000>; + reg = <0x17c27000 0x1000>; status = "disabled"; }; frame@17c29000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c29000 0x0 0x1000>; + reg = <0x17c29000 0x1000>; status = "disabled"; }; frame@17c2b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2b000 0x0 0x1000>; + reg = <0x17c2b000 0x1000>; status = "disabled"; }; frame@17c2d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17c2d000 0x0 0x1000>; + reg = <0x17c2d000 0x1000>; status = "disabled"; }; };
arch/arm64/boot/dts/qcom/sm8450.dtsi +11 -11
@@ -2867,9 +2867,9 @@ gic_its: msi-controller@17140000 { timer@17420000 { compatible = "arm,armv7-timer-mem"; - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; reg = <0x0 0x17420000 0x0 0x1000>; clock-frequency = <19200000>;
@@ -2877,49 +2877,49 @@ frame@17421000 { frame-number = <0>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17421000 0x0 0x1000>, - <0x0 0x17422000 0x0 0x1000>; + reg = <0x17421000 0x1000>, + <0x17422000 0x1000>; }; frame@17423000 { frame-number = <1>; interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17423000 0x0 0x1000>; + reg = <0x17423000 0x1000>; status = "disabled"; }; frame@17425000 { frame-number = <2>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17425000 0x0 0x1000>; + reg = <0x17425000 0x1000>; status = "disabled"; }; frame@17427000 { frame-number = <3>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17427000 0x0 0x1000>; + reg = <0x17427000 0x1000>; status = "disabled"; }; frame@17429000 { frame-number = <4>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x17429000 0x0 0x1000>; + reg = <0x17429000 0x1000>; status = "disabled"; }; frame@1742b000 { frame-number = <5>; interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x1742b000 0x0 0x1000>; + reg = <0x1742b000 0x1000>; status = "disabled"; }; frame@1742d000 { frame-number = <6>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - reg = <0x0 0x1742d000 0x0 0x1000>; + reg = <0x1742d000 0x1000>; status = "disabled"; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 174/1157 spi: synquacer: Add missing clk_disable_unprepare()
In reply to Greg Kroah-HartmanFrom: Guo Mengqi <[email protected]>
[ Upstream commit 917e43de2a56d9b82576f1cc94748261f1988458 ]
Add missing clk_disable_unprepare() in synquacer_spi_resume().
--- drivers/spi/spi-synquacer.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-synquacer.c +1 -0
@@ -783,6 +783,7 @@ static int __maybe_unused synquacer_spi_resume(struct device *dev) ret =synquacer_spi_enable (master);if (ret) { +clk_disable_unprepare (sspi->clk);dev_err (dev,"failed to enable spi (%d)\n" , ret);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 175/1157 ARM: OMAP2+: display: Fix refcount leak bug
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 50b87a32a79bca6e275918a711fb8cc55e16d739 ]
In omapdss_init_fbdev(), of_find_node_by_name() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.
Message-Id: <[email protected]>
--- arch/arm/mach-omap2/display.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/display.c +1 -0
@@ -211,6 +211,7 @@ static int __init omapdss_init_fbdev(void) node =of_find_node_by_name (NULL ,"omap4_padconf_global" );if (node) omap4_dsi_mux_syscon =syscon_node_to_regmap (node); +of_node_put (node);return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 176/1157 ARM: OMAP2+: pdata-quirks: Fix refcount leak bug
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 5cdbab96bab314c6f2f5e4e8b8a019181328bf5f ]
In pdata_quirks_init_clocks(), the loop contains of_find_node_by_name() but without corresponding of_node_put().
Message-Id: <[email protected]>
--- arch/arm/mach-omap2/pdata-quirks.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +2 -0
@@ -540,6 +540,8 @@ pdata_quirks_init_clocks(const struct of_device_id *omap_dt_match_table)of_platform_populate (np, omap_dt_match_table, omap_auxdata_lookup,NULL ); + +of_node_put (np); } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 177/1157 ACPI: EC: Remove duplicate ThinkPad X1 Carbon 6th entry from DMI quirks
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 0dd6db359e5f206cbf1dd1fd40dd211588cd2725 ]
Somehow the "ThinkPad X1 Carbon 6th" entry ended up twice in the struct dmi_system_id acpi_ec_no_wakeup[] array. Remove one of the entries.
--- drivers/acpi/ec.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/acpi/ec.c +0 -7
@@ -2207,13 +2207,6 @@ static const struct dmi_system_id acpi_ec_no_wakeup[] = { DMI_MATCH(DMI_PRODUCT_FAMILY, "Thinkpad X1 Carbon 6th"), }, }, - { - .ident = "ThinkPad X1 Carbon 6th", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Carbon 6th"), - }, - }, { .ident = "ThinkPad X1 Yoga 3rd", .matches = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 178/1157 ACPI: EC: Drop the EC_FLAGS_IGNORE_DSDT_GPE quirk
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit f7090e0ef360d674f08a22fab90e4e209fb1f658 ]
It seems that these quirks are no longer necessary since commit 69b957c26b32 ("ACPI: EC: Fix possible issues related to EC initialization order"), which has fixed this in a generic manner.
There are 3 commits adding DMI entries with this quirk (adding multiple DMI entries per commit). 2/3 commits are from before the generic fix.
Which leaves commit 6306f0431914 ("ACPI: EC: Make more Asus laptops use ECDT _GPE"), which was committed way after the generic fix. But this was just due to slow upstreaming of it. This commit stems from Endless from 15 Aug 2017 (committed upstream 20 May 2021):
https://github.com/endlessm/linux/pull/288
The current code should work fine without this:
1. The EC_FLAGS_IGNORE_DSDT_GPE flag is only checked in ec_parse_device(),
like this:
if (boot_ec && boot_ec_is_ecdt && EC_FLAGS_IGNORE_DSDT_GPE) {
ec->gpe = boot_ec->gpe;
} else {
/* parse GPE */
} 2. ec_parse_device() is only called from acpi_ec_add() and acpi_ec_dsdt_probe()
3. acpi_ec_dsdt_probe() starts with:
if (boot_ec)
return;
so it only calls ec_parse_device() when boot_ec == NULL, meaning that
the quirk never triggers for this call. So only the call in
acpi_ec_add() matters. 4. acpi_ec_add() does the following after the ec_parse_device() call:
if (boot_ec && ec->command_addr == boot_ec->command_addr &&
ec->data_addr == boot_ec->data_addr &&
!EC_FLAGS_TRUST_DSDT_GPE) {
/*
* Trust PNP0C09 namespace location rather than
* ECDT ID. But trust ECDT GPE rather than _GPE
* because of ASUS quirks, so do not change
* boot_ec->gpe to ec->gpe.
*/
boot_ec->handle = ec->handle;
acpi_handle_debug(ec->handle, "duplicated.\n");
acpi_ec_free(ec);
ec = boot_ec;
}The quirk only matters if boot_ec != NULL and EC_FLAGS_TRUST_DSDT_GPE is never set at the same time as EC_FLAGS_IGNORE_DSDT_GPE.
That means that if the addresses match we always enter this if block and then only the ec->handle part of the data stored in ec by ec_parse_device() is used and the rest is thrown away, after which ec is made to point to boot_ec, at which point ec->gpe == boot_ec->gpe, so the same result as with the quirk set, independent of the value of the quirk.
Also note the comment in this block which indicates that the gpe result from ec_parse_device() is deliberately not taken to deal with buggy Asus laptops and all DMI quirks setting EC_FLAGS_IGNORE_DSDT_GPE are for Asus laptops.
Based on the above I believe that unless on some quirked laptops the ECDT and DSDT EC addresses do not match we can drop the quirk.
I've checked dmesg output to ensure the ECDT and DSDT EC addresses match for quirked models using https://linux-hardware.org hw-probe reports.
I've been able to confirm that the addresses match for the following models this way: GL702VMK, X505BA, X505BP, X550VXK, X580VD. Whereas for the following models I could find any dmesg output:
FX502VD, FX502VE, X542BA, X542BP.
Note the models without dmesg all were submitted in patches with a batch of models and other models from the same batch checkout ok.
This, combined with that all the code adding the quirks was written before the generic fix makes me believe that it is safe to remove this quirk now.
--- drivers/acpi/ec.c | 75 ++++++----------------------------------------- 1 file changed, 9 insertions(+), 66 deletions(-)
drivers/acpi/ec.c +9 -66
@@ -180,7 +180,6 @@ static struct workqueue_struct *ec_wq;static struct workqueue_struct *ec_query_wq;static int EC_FLAGS_CORRECT_ECDT ;/* Needs ECDT port address correction */ -static int EC_FLAGS_IGNORE_DSDT_GPE ;/* Needs ECDT GPE as correction setting */ static int EC_FLAGS_TRUST_DSDT_GPE ;/* Needs DSDT GPE as correction setting */ static int EC_FLAGS_CLEAR_ON_RESUME ;/* Needs acpi_ec_clear() on boot/resume */
@@ -1407,24 +1406,16 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)if (ec->data_addr ==0 || ec->command_addr ==0 )return AE_OK ; -if (boot_ec && boot_ec_is_ecdt &&EC_FLAGS_IGNORE_DSDT_GPE ) { -/* -* Always inherit the GPE number setting from the ECDT -* EC. -*/ - ec->gpe = boot_ec->gpe; - }else { -/* Get GPE bit assignment (EC events). */ -/* TODO: Add support for _GPE returning a package */ - status =acpi_evaluate_integer (handle,"_GPE" ,NULL , &tmp); -if (ACPI_SUCCESS (status)) - ec->gpe = tmp; +/* Get GPE bit assignment (EC events). */ +/* TODO: Add support for _GPE returning a package */ + status =acpi_evaluate_integer (handle,"_GPE" ,NULL , &tmp); +if (ACPI_SUCCESS (status)) + ec->gpe = tmp; +/* +* Errors are non-fatal, allowing for ACPI Reduced Hardware +* platforms which use GpioInt instead of GPE. +*/ -/* -* Errors are non-fatal, allowing for ACPI Reduced Hardware -* platforms which use GpioInt instead of GPE. -*/ - }/* Use the global lock for all EC transactions? */ tmp =0 ;acpi_evaluate_integer (handle,"_GLK" ,NULL , &tmp);
@@ -1862,60 +1853,12 @@ static int ec_honor_dsdt_gpe(const struct dmi_system_id *id)return 0 ; } -/* -* Some DSDTs contain wrong GPE setting. -* Asus FX502VD/VE, GL702VMK, X550VXK, X580VD -* https://bugzilla.kernel.org/show_bug.cgi?id=195651 -*/ -static int ec_honor_ecdt_gpe (const struct dmi_system_id *id) -{ -pr_debug ("Detected system needing ignore DSDT GPE setting.\n" ); -EC_FLAGS_IGNORE_DSDT_GPE =1 ; -return 0 ; -} -static const struct dmi_system_id ec_dmi_table[]__initconst = { { ec_correct_ecdt,"MSI MS-171F" , {DMI_MATCH (DMI_SYS_VENDOR ,"Micro-Star" ),DMI_MATCH (DMI_PRODUCT_NAME ,"MS-171F" ),},NULL }, { - ec_honor_ecdt_gpe,"ASUS FX502VD" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"FX502VD" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUS FX502VE" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"FX502VE" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUS GL702VMK" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"GL702VMK" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUSTeK COMPUTER INC. X505BA" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"X505BA" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUSTeK COMPUTER INC. X505BP" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"X505BP" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUSTeK COMPUTER INC. X542BA" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"X542BA" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUSTeK COMPUTER INC. X542BP" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"X542BP" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUS X550VXK" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"X550VXK" ),},NULL }, - { - ec_honor_ecdt_gpe,"ASUS X580VD" , { -DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"X580VD" ),},NULL }, - {/* https://bugzilla.kernel.org/show_bug.cgi?id=209989 */ ec_honor_dsdt_gpe,"HP Pavilion Gaming Laptop 15-cx0xxx" , {DMI_MATCH (DMI_SYS_VENDOR ,"HP" ),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 179/1157 ACPI: PM: save NVS memory for Lenovo G40-45
In reply to Greg Kroah-HartmanFrom: Manyi Li <[email protected]>
[ Upstream commit 4b7ef7b05afcde44142225c184bf43a0cd9e2178 ]
[821d6f0359b0614792ab8e2fb93b503e25a65079] is to make machines produced from 2012 to now not saving NVS region to accelerate S3.
But, Lenovo G40-45, a platform released in 2015, still needs NVS memory saving during S3. A quirk is introduced for this platform.
--- drivers/acpi/sleep.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/acpi/sleep.c +8 -0
@@ -360,6 +360,14 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "80E3"), }, }, + { + .callback = init_nvs_save_s3, + .ident = "Lenovo G40-45", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "80E1"), + }, + },/* * ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using * the Low Power S0 Idle firmware interface (see
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 180/1157 ACPI: LPSS: Fix missing check in register_device_clock()
In reply to Greg Kroah-HartmanFrom: huhai <[email protected]>
[ Upstream commit b4f1f61ed5928b1128e60e38d0dffa16966f06dc ]
register_device_clock() misses a check for platform_device_register_simple(). Add a check to fix it.
--- drivers/acpi/acpi_lpss.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/acpi_lpss.c +3 -0
@@ -422,6 +422,9 @@ static int register_device_clock(struct acpi_device *adev,if (!lpss_clk_dev)lpt_register_clock_device (); +if (IS_ERR (lpss_clk_dev)) +return PTR_ERR (lpss_clk_dev); + clk_data =platform_get_drvdata (lpss_clk_dev);if (!clk_data)return -ENODEV ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 181/1157 ARM: dts: qcom: sdx55: Fix the IRQ trigger type for UART
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit ae500b351ab0006d933d804a2b7507fe1e98cecc ]
The trigger type should be LEVEL_HIGH. So fix it!
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +1 -1
@@ -206,7 +206,7 @@ gcc: clock-controller@100000 { blsp1_uart3: serial@831000 { compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; reg = <0x00831000 0x200>; - interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_LOW>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; clocks = <&gcc 30>, <&gcc 9>; clock-names = "core", "iface";
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 182/1157 arm64: dts: qcom: sc7280: Rename sar sensor labels
In reply to Greg Kroah-HartmanFrom: Gwendal Grignou <[email protected]>
[ Upstream commit 9c54f1711fc2516faf1f8d31217462184157b429 ]
To ease matching configuration of sysfs attributes for particular sensor, match label reported by iio 'label' attribute with the location label generated by ChromeOS config tool.
--- arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi +2 -2
@@ -388,7 +388,7 @@ ap_sar_sensor0: proximity@28 { vdd-supply = <&pp1800_prox>; - label = "proximity-wifi-lte0"; + label = "proximity-wifi_cellular-0"; status = "disabled"; };
@@ -404,7 +404,7 @@ ap_sar_sensor1: proximity@2c { vdd-supply = <&pp1800_prox>; - label = "proximity-wifi-lte1"; + label = "proximity-wifi_cellular-1"; status = "disabled"; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 183/1157 arm64: dts: qcom: add missing AOSS QMP compatible fallback
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 6ba93ba9f63fbc44c3a6af7fe6f2536d009cfd5a ]
The AOSS QMP bindings expect all compatibles to be followed by fallback "qcom,aoss-qmp" because all of these are actually compatible with each other. This fixes dtbs_check warnings like:
sm8250-hdk.dtb: power-controller@c300000: compatible: ['qcom,sm8250-aoss-qmp'] is too short
--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/qcom/sc7180.dtsi +1 -1
@@ -3215,7 +3215,7 @@ aoss_reset: reset-controller@c2a0000 { }; aoss_qmp: power-controller@c300000 { - compatible = "qcom,sc7180-aoss-qmp"; + compatible = "qcom,sc7180-aoss-qmp", "qcom,aoss-qmp"; reg = <0 0x0c300000 0 0x400>; interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>; mboxes = <&apss_shared 0>;
arch/arm64/boot/dts/qcom/sc7280.dtsi +1 -1
@@ -3843,7 +3843,7 @@ aoss_reset: reset-controller@c2a0000 { }; aoss_qmp: power-controller@c300000 { - compatible = "qcom,sc7280-aoss-qmp"; + compatible = "qcom,sc7280-aoss-qmp", "qcom,aoss-qmp"; reg = <0 0x0c300000 0 0x400>; interrupts-extended = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_GLINK_QMP
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
@@ -3718,7 +3718,7 @@ pdc: interrupt-controller@b220000 { }; aoss_qmp: power-controller@c300000 { - compatible = "qcom,sm8150-aoss-qmp"; + compatible = "qcom,sm8150-aoss-qmp", "qcom,aoss-qmp"; reg = <0x0 0x0c300000 0x0 0x400>; interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>; mboxes = <&apss_shared 0>;
arch/arm64/boot/dts/qcom/sm8250.dtsi +1 -1
@@ -3734,7 +3734,7 @@ tsens1: thermal-sensor@c265000 { }; aoss_qmp: power-controller@c300000 { - compatible = "qcom,sm8250-aoss-qmp"; + compatible = "qcom,sm8250-aoss-qmp", "qcom,aoss-qmp"; reg = <0 0x0c300000 0 0x400>; interrupts-extended = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_GLINK_QMP
arch/arm64/boot/dts/qcom/sm8350.dtsi +1 -1
@@ -1718,7 +1718,7 @@ tsens1: thermal-sensor@c265000 { }; aoss_qmp: power-controller@c300000 { - compatible = "qcom,sm8350-aoss-qmp"; + compatible = "qcom,sm8350-aoss-qmp", "qcom,aoss-qmp"; reg = <0 0x0c300000 0 0x400>; interrupts-extended = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_GLINK_QMP IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 184/1157 arm64: dts: qcom: ipq8074: fix NAND node name
In reply to Greg Kroah-HartmanFrom: Robert Marko <[email protected]>
[ Upstream commit b39961659ffc3c3a9e3d0d43b0476547b5f35d49 ]
Per schema it should be nand-controller@79b0000 instead of nand@79b0000. Fix it to match nand-controller.yaml requirements.
--- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq8074.dtsi +1 -1
@@ -534,7 +534,7 @@ qpic_bam: dma-controller@7984000 { status = "disabled"; }; - qpic_nand: nand@79b0000 { + qpic_nand: nand-controller@79b0000 { compatible = "qcom,ipq8074-nand"; reg = <0x079b0000 0x10000>; #address-cells = <1>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 185/1157 arm64: dts: allwinner: a64: orangepi-win: Fix LED node name
In reply to Greg Kroah-HartmanFrom: Samuel Holland <[email protected]>
[ Upstream commit b8eb2df19fbf97aa1e950cf491232c2e3bef8357 ]
"status" does not match any pattern in the gpio-leds binding. Rename the node to the preferred pattern. This fixes a make dtbs_check error.
--- arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +1 -1
@@ -40,7 +40,7 @@ hdmi_con_in: endpoint { leds { compatible = "gpio-leds"; - status { + led-0 { label = "orangepi:green:status"; gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 186/1157 ARM: shmobile: rcar-gen2: Increase refcount for new reference
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 75a185fb92e58ccd3670258d8d3b826bd2fa6d29 ]
In rcar_gen2_regulator_quirk(), for_each_matching_node_and_match() will automatically increase and decrease the refcount. However, we should call of_node_get() for the new reference created in 'quirk->np'. Besides, we also should call of_node_put() before the 'quirk' being freed.
--- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +4 -1
@@ -125,6 +125,7 @@ static int regulator_quirk_notify(struct notifier_block *nb,list_for_each_entry_safe (pos, tmp, &quirk_list, list) {list_del (&pos->list); +of_node_put (pos->np);kfree (pos); }
@@ -174,11 +175,12 @@ static int __init rcar_gen2_regulator_quirk(void)memcpy (&quirk->i2c_msg, id->data,sizeof (quirk->i2c_msg)); quirk->id = id; - quirk->np = np; + quirk->np =of_node_get (np); quirk->i2c_msg.addr = addr; ret =of_irq_parse_one (np,0 , argsa);if (ret) {/* Skip invalid entry and continue */ +of_node_put (np);kfree (quirk);continue ; }
@@ -225,6 +227,7 @@ static int __init rcar_gen2_regulator_quirk(void) err_mem:list_for_each_entry_safe (pos, tmp, &quirk_list, list) {list_del (&pos->list); +of_node_put (pos->np);kfree (pos); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 187/1157 firmware: tegra: Fix error check return value of debugfs_create_file()
In reply to Greg Kroah-HartmanFrom: Lv Ruyi <[email protected]>
[ Upstream commit afcdb8e55c91c6ff0700ab272fd0f74e899ab884 ]
If an error occurs, debugfs_create_file() will return ERR_PTR(-ERROR), so use IS_ERR() to check it.
--- drivers/firmware/tegra/bpmp-debugfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/firmware/tegra/bpmp-debugfs.c +5 -5
@@ -474,7 +474,7 @@ static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp, mode |= attrs &DEBUGFS_S_IWUSR ?0200 :0 ; dentry =debugfs_create_file (name, mode, parent, bpmp, &bpmp_debug_fops); -if (!dentry) { +if (IS_ERR (dentry)) { err = -ENOMEM ; goto out; }
@@ -725,7 +725,7 @@ static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf,if (t &DEBUGFS_S_ISDIR ) { dentry =debugfs_create_dir (name, parent); -if (!dentry) +if (IS_ERR (dentry))return -ENOMEM ; err =bpmp_populate_dir (bpmp, seqbuf, dentry, depth+1 );if (err <0 )
@@ -738,7 +738,7 @@ static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf, dentry =debugfs_create_file (name, mode, parent, bpmp, &debugfs_fops); -if (!dentry) +if (IS_ERR (dentry))return -ENOMEM ; } }
@@ -788,11 +788,11 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)return 0 ; root =debugfs_create_dir ("bpmp" ,NULL ); -if (!root) +if (IS_ERR (root))return -ENOMEM ; bpmp->debugfs_mirror =debugfs_create_dir ("debug" , root); -if (!bpmp->debugfs_mirror) { +if (IS_ERR (bpmp->debugfs_mirror)) { err = -ENOMEM ; goto out; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 188/1157 hwmon: (dell-smm) Add Dell XPS 13 7390 to fan control whitelist
In reply to Greg Kroah-HartmanFrom: Armin Wolf <[email protected]>
[ Upstream commit 385e5f57053ff293282fea84c1c27186d53f66e1 ]
A user reported that the program dell-bios-fan-control worked on his Dell XPS 13 7390 to switch off automatic fan control.
Since it uses the same mechanism as the dell_smm_hwmon module, add this model to the fan control whitelist.
Compile-tested only.
--- drivers/hwmon/dell-smm-hwmon.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/hwmon/dell-smm-hwmon.c +8 -0
@@ -1365,6 +1365,14 @@ static const struct dmi_system_id i8k_whitelist_fan_control[] __initconst = { }, .driver_data = (void *)&i8k_fan_control_data[I8K_FAN_34A3_35A3], }, + { + .ident = "Dell XPS 13 7390", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 7390"), + }, + .driver_data = (void *)&i8k_fan_control_data[I8K_FAN_34A3_35A3], + }, { } };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 189/1157 PM: EM: convert power field to micro-Watts precision and align drivers
In reply to Greg Kroah-HartmanFrom: Lukasz Luba <[email protected]>
[ Upstream commit ae6ccaa650380d243cf43d31c864c5ced2fd4612 ]
The milli-Watts precision causes rounding errors while calculating efficiency cost for each OPP. This is especially visible in the 'simple' Energy Model (EM), where the power for each OPP is provided from OPP framework. This can cause some OPPs to be marked inefficient, while using micro-Watts precision that might not happen.
Update all EM users which access 'power' field and assume the value is in milli-Watts.
Solve also an issue with potential overflow in calculation of energy estimation on 32bit machine. It's needed now since the power value (thus the 'cost' as well) are higher.
Example calculation which shows the rounding error and impact:
power = 'dyn-power-coeff' * volt_mV * volt_mV * freq_MHz
power_a_uW = (100 * 600mW * 600mW * 500MHz) / 10^6 = 18000 power_a_mW = (100 * 600mW * 600mW * 500MHz) / 10^9 = 18
power_b_uW = (100 * 605mW * 605mW * 600MHz) / 10^6 = 21961 power_b_mW = (100 * 605mW * 605mW * 600MHz) / 10^9 = 21
max_freq = 2000MHz
cost_a_mW = 18 * 2000MHz/500MHz = 72cost_a_uW = 18000 * 2000MHz/500MHz = 72000
cost_b_mW = 21 * 2000MHz/600MHz = 70 // <- artificially better cost_b_uW = 21961 * 2000MHz/600MHz = 73203
The 'cost_b_mW' (which is based on old milli-Watts) is misleadingly better that the 'cost_b_uW' (this patch uses micro-Watts) and such would have impact on the 'inefficient OPPs' information in the Cpufreq framework. This patch set removes the rounding issue.
--- drivers/cpufreq/mediatek-cpufreq-hw.c | 7 ++-- drivers/cpufreq/scmi-cpufreq.c | 6 +++ drivers/opp/of.c | 15 ++++---- drivers/powercap/dtpm_cpu.c | 5 +-- drivers/thermal/cpufreq_cooling.c | 13 ++++++- drivers/thermal/devfreq_cooling.c | 19 ++++++++-- include/linux/energy_model.h | 54 +++++++++++++++++++-------- kernel/power/energy_model.c | 24 ++++++++---- 8 files changed, 100 insertions(+), 43 deletions(-)
drivers/cpufreq/mediatek-cpufreq-hw.c +4 -3
@@ -51,7 +51,7 @@ static const u16 cpufreq_mtk_offsets[REG_ARRAY_SIZE] = { };static int __maybe_unused -mtk_cpufreq_get_cpu_power (struct device *cpu_dev,unsigned long *mW, +mtk_cpufreq_get_cpu_power (struct device *cpu_dev,unsigned long *uW,unsigned long *KHz) {struct mtk_cpufreq_data *data;
@@ -71,8 +71,9 @@ mtk_cpufreq_get_cpu_power(struct device *cpu_dev, unsigned long *mW, i--; *KHz = data->table[i].frequency; - *mW =readl_relaxed (data->reg_bases[REG_EM_POWER_TBL ] + - i *LUT_ROW_SIZE ) /1000 ; +/* Provide micro-Watts value to the Energy Model */ + *uW =readl_relaxed (data->reg_bases[REG_EM_POWER_TBL ] + + i *LUT_ROW_SIZE );return 0 ; }
drivers/cpufreq/scmi-cpufreq.c +6 -0
@@ -19,6 +19,7 @@#include <linux/slab.h> #include <linux/scmi_protocol.h> #include <linux/types.h> +#include <linux/units.h> struct scmi_data {int domain_id;
@@ -99,6 +100,7 @@ static int __maybe_unused scmi_get_cpu_power(struct device *cpu_dev, unsigned long *power, unsigned long *KHz) { + bool power_scale_mw = perf_ops->power_scale_mw_get(ph);unsigned long Hz;int ret, domain;
@@ -112,6 +114,10 @@ scmi_get_cpu_power(struct device *cpu_dev, unsigned long *power,if (ret)return ret; +/* Provide bigger resolution power to the Energy Model */ +if (power_scale_mw) + *power *=MICROWATT_PER_MILLIWATT ; +/* The EM framework specifies the frequency in KHz. */ *KHz = Hz /1000 ;
drivers/opp/of.c +8 -7
@@ -1443,12 +1443,12 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node);* It provides the power used by @dev at @kHz if it is the frequency of an * existing OPP, or at the frequency of the first OPP above @kHz otherwise * (see dev_pm_opp_find_freq_ceil()). This function updates @kHz to the ceiled -* frequency and @mW to the associated power. +* frequency and @uW to the associated power. * * Returns 0 on success or a proper -EINVAL value in case of error. */ static int __maybe_unused -_get_dt_power (struct device *dev,unsigned long *mW,unsigned long *kHz) +_get_dt_power (struct device *dev,unsigned long *uW,unsigned long *kHz) {struct dev_pm_opp *opp;unsigned long opp_freq, opp_power;
@@ -1465,7 +1465,7 @@ _get_dt_power(struct device *dev, unsigned long *mW, unsigned long *kHz)return -EINVAL ; *kHz = opp_freq /1000 ; - *mW = opp_power /1000 ; + *uW = opp_power;return 0 ; }
@@ -1475,14 +1475,14 @@ _get_dt_power(struct device *dev, unsigned long *mW, unsigned long *kHz)* This computes the power estimated by @dev at @kHz if it is the frequency * of an existing OPP, or at the frequency of the first OPP above @kHz otherwise * (see dev_pm_opp_find_freq_ceil()). This function updates @kHz to the ceiled -* frequency and @mW to the associated power. The power is estimated as +* frequency and @uW to the associated power. The power is estimated as * P = C * V^2 * f with C being the device's capacitance and V and f * respectively the voltage and frequency of the OPP. * * Returns -EINVAL if the power calculation failed because of missing * parameters, 0 otherwise. */ -static int __maybe_unused _get_power (struct device *dev,unsigned long *mW, +static int __maybe_unused _get_power (struct device *dev,unsigned long *uW,unsigned long *kHz) {struct dev_pm_opp *opp;
@@ -1512,9 +1512,10 @@ static int __maybe_unused _get_power(struct device *dev, unsigned long *mW,return -EINVAL ; tmp = (u64 )cap * mV * mV * (Hz /1000000 ); -do_div (tmp,1000000000 ); +/* Provide power in micro-Watts */ +do_div (tmp,1000000 ); - *mW = (unsigned long )tmp; + *uW = (unsigned long )tmp; *kHz = Hz /1000 ;return 0 ;
drivers/powercap/dtpm_cpu.c +2 -3
@@ -53,7 +53,7 @@ static u64 set_pd_power_limit(struct dtpm *dtpm, u64 power_limit)for (i =0 ; i < pd->nr_perf_states; i++) { - power = pd->table[i].power *MICROWATT_PER_MILLIWATT * nr_cpus; + power = pd->table[i].power * nr_cpus;if (power > power_limit)break ;
@@ -63,8 +63,7 @@ static u64 set_pd_power_limit(struct dtpm *dtpm, u64 power_limit)freq_qos_update_request (&dtpm_cpu->qos_req, freq); - power_limit = pd->table[i -1 ].power * -MICROWATT_PER_MILLIWATT * nr_cpus; + power_limit = pd->table[i -1 ].power * nr_cpus;return power_limit; }
drivers/thermal/cpufreq_cooling.c +11 -2
@@ -21,6 +21,7 @@#include <linux/pm_qos.h> #include <linux/slab.h> #include <linux/thermal.h> +#include <linux/units.h> #include <trace/events/thermal.h>
@@ -101,6 +102,7 @@ static unsigned long get_level(struct cpufreq_cooling_device *cpufreq_cdev,static u32 cpu_freq_to_power (struct cpufreq_cooling_device *cpufreq_cdev,u32 freq) { +unsigned long power_mw;int i;for (i = cpufreq_cdev->max_level -1 ; i >=0 ; i--) {
@@ -108,16 +110,23 @@ static u32 cpu_freq_to_power(struct cpufreq_cooling_device *cpufreq_cdev,break ; } -return cpufreq_cdev->em->table[i +1 ].power; + power_mw = cpufreq_cdev->em->table[i +1 ].power; + power_mw /=MICROWATT_PER_MILLIWATT ; + +return power_mw; }static u32 cpu_power_to_freq (struct cpufreq_cooling_device *cpufreq_cdev,u32 power) { +unsigned long em_power_mw;int i;for (i = cpufreq_cdev->max_level; i >0 ; i--) { -if (power >= cpufreq_cdev->em->table[i].power) +/* Convert EM power to milli-Watts to make safe comparison */ + em_power_mw = cpufreq_cdev->em->table[i].power; + em_power_mw /=MICROWATT_PER_MILLIWATT ; +if (power >= em_power_mw)break ; }
drivers/thermal/devfreq_cooling.c +15 -4
@@ -200,7 +200,11 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd res = dfc->power_ops->get_real_power (df, power, freq, voltage);if (!res) { state = dfc->capped_state; + +/* Convert EM power into milli-Watts first */ dfc->res_util = dfc->em_pd->table[state].power; + dfc->res_util /=MICROWATT_PER_MILLIWATT ; + dfc->res_util *=SCALE_ERROR_MITIGATION ;if (*power >1 )
@@ -218,8 +222,10 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd_normalize_load (&status); -/* Scale power for utilization */ +/* Convert EM power into milli-Watts first */ *power = dfc->em_pd->table[perf_idx].power; + *power /=MICROWATT_PER_MILLIWATT ; +/* Scale power for utilization */ *power *= status.busy_time; *power >>=10 ; }
@@ -244,6 +250,7 @@ static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev, perf_idx = dfc->max_state - state; *power = dfc->em_pd->table[perf_idx].power; + *power /=MICROWATT_PER_MILLIWATT ;return 0 ; }
@@ -254,7 +261,7 @@ static int devfreq_cooling_power2state(struct thermal_cooling_device *cdev,struct devfreq_cooling_device *dfc = cdev->devdata;struct devfreq *df = dfc->devfreq;struct devfreq_dev_status status; -unsigned long freq; +unsigned long freq, em_power_mw;s32 est_power;int i;
@@ -279,9 +286,13 @@ static int devfreq_cooling_power2state(struct thermal_cooling_device *cdev,* Find the first cooling state that is within the power * budget. The EM power table is sorted ascending. */ -for (i = dfc->max_state; i >0 ; i--) -if (est_power >= dfc->em_pd->table[i].power) +for (i = dfc->max_state; i >0 ; i--) { +/* Convert EM power to milli-Watts to make safe comparison */ + em_power_mw = dfc->em_pd->table[i].power; + em_power_mw /=MICROWATT_PER_MILLIWATT ; +if (est_power >= em_power_mw)break ; + } *state = dfc->max_state - i; dfc->capped_state = *state;
include/linux/energy_model.h +38 -16
102 lines not on this page · raw message
kernel/power/energy_model.c +16 -8
@@ -145,7 +145,7 @@ static int em_create_perf_table(struct device *dev, struct em_perf_domain *pd,/* * The power returned by active_state() is expected to be -* positive and to fit into 16 bits. +* positive and be in range. */ if (!power || power >EM_MAX_POWER ) { dev_err(dev, "EM: invalid power: %lu\n",
@@ -170,7 +170,7 @@ static int em_create_perf_table(struct device *dev, struct em_perf_domain *pd, goto free_ps_table; } }else { - power_res =em_scale_power (table[i].power); + power_res = table[i].power; cost =div64_u64 (fmax * power_res, table[i].frequency); }
@@ -201,9 +201,17 @@ static int em_create_pd(struct device *dev, int nr_states, {struct em_perf_domain *pd;struct device *cpu_dev; -int cpu, ret; +int cpu, ret, num_cpus;if (_is_cpu_device (dev)) { + num_cpus =cpumask_weight (cpus); + +/* Prevent max possible energy calculation to not overflow */ +if (num_cpus >EM_MAX_NUM_CPUS ) { +dev_err (dev,"EM: too many CPUs, overflow possible\n" ); +return -EINVAL ; + } + pd =kzalloc (sizeof (*pd) +cpumask_size (),GFP_KERNEL );if (!pd)return -ENOMEM ;
@@ -314,13 +322,13 @@ EXPORT_SYMBOL_GPL(em_cpu_get);* @cpus : Pointer to cpumask_t, which in case of a CPU device is * obligatory. It can be taken from i.e. 'policy->cpus'. For other * type of devices this should be set to NULL. -* @milliwatts : Flag indicating that the power values are in milliWatts or +* @microwatts : Flag indicating that the power values are in micro-Watts or * in some other scale. It must be set properly. * * Create Energy Model tables for a performance domain using the callbacks * defined in cb. * -* The @milliwatts is important to set with correct value. Some kernel +* The @microwatts is important to set with correct value. Some kernel * sub-systems might rely on this flag and check if all devices in the EM are * using the same scale. *
@@ -331,7 +339,7 @@ EXPORT_SYMBOL_GPL(em_cpu_get);*/ int em_dev_register_perf_domain (struct device *dev,unsigned int nr_states,struct em_data_callback *cb,cpumask_t *cpus, -bool milliwatts) +bool microwatts) {unsigned long cap, prev_cap =0 ;unsigned long flags =0 ;
@@ -381,8 +389,8 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, } } -if (milliwatts) - flags |=EM_PERF_DOMAIN_MILLIWATTS ; +if (microwatts) + flags |=EM_PERF_DOMAIN_MICROWATTS ;else if (cb->get_cost) flags |=EM_PERF_DOMAIN_ARTIFICIAL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 190/1157 ACPI: video: Use native backlight on Dell Inspiron N4010
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 03c440a26cba6cfa540d65924e9db86fcea362b2 ]
The Dell Inspiron N4010 does not have ACPI backlight control, so acpi_video_get_backlight_type()'s heuristics return vendor as the type to use.
But the vendor interface is broken, where as the native (intel_backlight) works well, add a quirk to use native.
--- drivers/acpi/video_detect.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/acpi/video_detect.c +8 -0
@@ -347,6 +347,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro12,1"), }, }, + { + .callback = video_detect_force_native, +/* Dell Inspiron N4010 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron N4010"), + }, + }, { .callback = video_detect_force_native,/* Dell Vostro V131 */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 191/1157 hwmon: (sht15) Fix wrong assumptions in device remove callback
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 7d4edccc9bbfe1dcdff641343f7b0c6763fbe774 ]
Taking a lock at the beginning of .remove() doesn't prevent new readers. With the existing approach it can happen, that a read occurs just when the lock was taken blocking the reader until the lock is released at the end of the remove callback which then accessed *data that is already freed then.
To actually fix this problem the hwmon core needs some adaption. Until this is implemented take the optimistic approach of assuming that all readers are gone after hwmon_device_unregister() and sysfs_remove_group() as most other drivers do. (And once the core implements that, taking the lock would deadlock.)
So drop the lock, move the reset to after device unregistration to keep the device in a workable state until it's deregistered. Also add a error message in case the reset fails and return 0 anyhow. (Returning an error code, doesn't stop the platform device unregistration and only results in a little helpful error message before the devm cleanup handlers are called.)
--- drivers/hwmon/sht15.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/hwmon/sht15.c +6 -11
@@ -1020,25 +1020,20 @@ static int sht15_probe(struct platform_device *pdev)static int sht15_remove (struct platform_device *pdev) {struct sht15_data *data =platform_get_drvdata (pdev); +int ret; -/* -* Make sure any reads from the device are done and -* prevent new ones beginning -*/ -mutex_lock (&data->read_lock); -if (sht15_soft_reset (data)) { -mutex_unlock (&data->read_lock); -return -EFAULT ; - }hwmon_device_unregister (data->hwmon_dev);sysfs_remove_group (&pdev->dev.kobj, &sht15_attr_group); + + ret =sht15_soft_reset (data); +if (ret) +dev_err (&pdev->dev,"Failed to reset device (%pe)\n" ,ERR_PTR (ret)); +if (!IS_ERR (data->reg)) {regulator_unregister_notifier (data->reg, &data->nb);regulator_disable (data->reg); } -mutex_unlock (&data->read_lock); -return 0 ; }
Signature · 1 line
2.35.1
Re: [PATCH 5.19 0191/1157] hwmon: (sht15) Fix wrong assumptions in device remove callback
Hello,
Quoted 23 lines · Greg Kroah-Hartman
From: Uwe Kleine-König <[email protected]>
[ Upstream commit
7d4edccc9bbfe1dcdff641343f7b0c6763fbe774]Taking a lock at the beginning of .remove() doesn't prevent new readers. With the existing approach it can happen, that a read occurs just when the lock was taken blocking the reader until the lock is released at the end of the remove callback which then accessed *data that is already freed then.
To actually fix this problem the hwmon core needs some adaption. Until this is implemented take the optimistic approach of assuming that all readers are gone after
hwmon_device_unregister()andsysfs_remove_group()as most other drivers do. (And once the core implements that, taking the lock would deadlock.)So drop the lock, move the reset to after device unregistration to keep the device in a workable state until it's deregistered. Also add a error message in case the reset fails and return 0 anyhow. (Returning an error code, doesn't stop the platform device unregistration and only results in a little helpful error message before the devm cleanup handlers are called.)
Quoted 4 lines
Signed-off-by Uwe Kleine-König <[email protected]>Signed-off-by Guenter Roeck <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Does this mean my concerns I expressed in the mail with Message-Id:
[email protected] were not taken into consideration?
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Greg Kroah-Hartman
maintainerRe: [PATCH 5.19 0191/1157] hwmon: (sht15) Fix wrong assumptions in device remove callback
Quoted 26 lines · Uwe Kleine-König
Hello,
Quoted 23 lines · Greg Kroah-Hartman
From: Uwe Kleine-König <[email protected]>
[ Upstream commit
7d4edccc9bbfe1dcdff641343f7b0c6763fbe774]Taking a lock at the beginning of .remove() doesn't prevent new readers. With the existing approach it can happen, that a read occurs just when the lock was taken blocking the reader until the lock is released at the end of the remove callback which then accessed *data that is already freed then.
To actually fix this problem the hwmon core needs some adaption. Until this is implemented take the optimistic approach of assuming that all readers are gone after
hwmon_device_unregister()andsysfs_remove_group()as most other drivers do. (And once the core implements that, taking the lock would deadlock.)So drop the lock, move the reset to after device unregistration to keep the device in a workable state until it's deregistered. Also add a error message in case the reset fails and return 0 anyhow. (Returning an error code, doesn't stop the platform device unregistration and only results in a little helpful error message before the devm cleanup handlers are called.)
Quoted 8 lines
Quoted 4 lines
Signed-off-by Uwe Kleine-König <[email protected]>Signed-off-by Guenter Roeck <[email protected]>Signed-off-by Sasha Levin <[email protected]>Does this mean my concerns I expressed in the mail with Message-Id:
[email protected] were not taken into consideration?
I can't find that message-id on lore.kernel.org, do you have a link?
thanks,
greg k-h
Re: [PATCH 5.19 0191/1157] hwmon: (sht15) Fix wrong assumptions in device remove callback
Hello Greg,
Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · Uwe Kleine-König
Quoted 27 lines · Greg Kroah-Hartman
From: Uwe Kleine-König <[email protected]>
[ Upstream commit
7d4edccc9bbfe1dcdff641343f7b0c6763fbe774]Taking a lock at the beginning of .remove() doesn't prevent new readers. With the existing approach it can happen, that a read occurs just when the lock was taken blocking the reader until the lock is released at the end of the remove callback which then accessed *data that is already freed then.
To actually fix this problem the hwmon core needs some adaption. Until this is implemented take the optimistic approach of assuming that all readers are gone after
hwmon_device_unregister()andsysfs_remove_group()as most other drivers do. (And once the core implements that, taking the lock would deadlock.)So drop the lock, move the reset to after device unregistration to keep the device in a workable state until it's deregistered. Also add a error message in case the reset fails and return 0 anyhow. (Returning an error code, doesn't stop the platform device unregistration and only results in a little helpful error message before the devm cleanup handlers are called.)
Signed-off-by Uwe Kleine-König <[email protected]>Signed-off-by Guenter Roeck <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 5 lines
Quoted 3 lines
Does this mean my concerns I expressed in the mail with Message-Id:
[email protected] were not taken into consideration?I can't find that message-id on lore.kernel.org, do you have a link?
Oh, I missed your request earlier. No I don't have a link, the mail was sent to Sasha Levin, Jean Delvare, Guenter Roeck and stable-commits as I just replied to the "note to let you know that I've just added the patch titled [...] to the 5.19-stable tree".
Quoted 5 lines · I wrote:
I'd say adding this patch to stable isn't right. The problem existed since v3.0 (commit
cc15c7ebb424e45ba2c5ceecbe52d025219ee970) and was never reported to be hit in practise. And given that the problem doesn't go away completely but (AFAICT) just opens the possibility for a hwmon core fix, I'd say it's not worth a backport.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Greg Kroah-Hartman
maintainerRe: [PATCH 5.19 0191/1157] hwmon: (sht15) Fix wrong assumptions in device remove callback
Quoted 37 lines · Uwe Kleine-König
Hello Greg,
Quoted 34 lines · Greg Kroah-Hartman
Quoted 32 lines · Uwe Kleine-König
Quoted 23 lines · Greg Kroah-Hartman
From: Uwe Kleine-König <[email protected]>
[ Upstream commit
7d4edccc9bbfe1dcdff641343f7b0c6763fbe774]Taking a lock at the beginning of .remove() doesn't prevent new readers. With the existing approach it can happen, that a read occurs just when the lock was taken blocking the reader until the lock is released at the end of the remove callback which then accessed *data that is already freed then.
To actually fix this problem the hwmon core needs some adaption. Until this is implemented take the optimistic approach of assuming that all readers are gone after
hwmon_device_unregister()andsysfs_remove_group()as most other drivers do. (And once the core implements that, taking the lock would deadlock.)So drop the lock, move the reset to after device unregistration to keep the device in a workable state until it's deregistered. Also add a error message in case the reset fails and return 0 anyhow. (Returning an error code, doesn't stop the platform device unregistration and only results in a little helpful error message before the devm cleanup handlers are called.)
Quoted 4 lines
Signed-off-by Uwe Kleine-König <[email protected]>Signed-off-by Guenter Roeck <[email protected]>Signed-off-by Sasha Levin <[email protected]>Does this mean my concerns I expressed in the mail with Message-Id:
[email protected] were not taken into consideration?
Quoted 6 lines
Quoted 1 line
I can't find that message-id on lore.kernel.org, do you have a link?
Oh, I missed your request earlier. No I don't have a link, the mail was sent to Sasha Levin, Jean Delvare, Guenter Roeck and stable-commits as I just replied to the "note to let you know that I've just added the patch titled [...] to the 5.19-stable tree".
Ok, I've dropped it now from all pending queues (5.10 and older), I can also revert it from the newer ones if you want me to.
thanks,
greg k-h
Re: [PATCH 5.19 0191/1157] hwmon: (sht15) Fix wrong assumptions in device remove callback
Quoted 40 lines · Greg Kroah-Hartman
Quoted 39 lines · Uwe Kleine-König
Hello Greg,
Quoted 35 lines · Greg Kroah-Hartman
Quoted 24 lines · Uwe Kleine-König
Quoted 23 lines · Greg Kroah-Hartman
From: Uwe Kleine-König <[email protected]>
[ Upstream commit
7d4edccc9bbfe1dcdff641343f7b0c6763fbe774]Taking a lock at the beginning of .remove() doesn't prevent new readers. With the existing approach it can happen, that a read occurs just when the lock was taken blocking the reader until the lock is released at the end of the remove callback which then accessed *data that is already freed then.
To actually fix this problem the hwmon core needs some adaption. Until this is implemented take the optimistic approach of assuming that all readers are gone after
hwmon_device_unregister()andsysfs_remove_group()as most other drivers do. (And once the core implements that, taking the lock would deadlock.)So drop the lock, move the reset to after device unregistration to keep the device in a workable state until it's deregistered. Also add a error message in case the reset fails and return 0 anyhow. (Returning an error code, doesn't stop the platform device unregistration and only results in a little helpful error message before the devm cleanup handlers are called.)
Quoted 8 lines
Quoted 4 lines
Signed-off-by Uwe Kleine-König <[email protected]>Signed-off-by Guenter Roeck <[email protected]>Signed-off-by Sasha Levin <[email protected]>Does this mean my concerns I expressed in the mail with Message-Id:
[email protected] were not taken into consideration?I can't find that message-id on lore.kernel.org, do you have a link?
Quoted 7 lines
Quoted 4 lines
Oh, I missed your request earlier. No I don't have a link, the mail was sent to Sasha Levin, Jean Delvare, Guenter Roeck and stable-commits as I just replied to the "note to let you know that I've just added the patch titled [...] to the 5.19-stable tree".
Ok, I've dropped it now from all pending queues (5.10 and older), I can also revert it from the newer ones if you want me to.
Actually I don't care much. It touches a path that is not usually hit, because platform devices are not removed very often. So I expect even if the problem with this driver is a different one now, we won't get any regressions here.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Greg Kroah-Hartman
maintainerPATCH 192/1157 PM: hibernate: defer device probing when resuming from hibernation
In reply to Greg Kroah-HartmanFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 8386c414e27caba8501119948e9551e52b527f59 ]
syzbot is reporting hung task at misc_open() [1], for there is a race window of AB-BA deadlock which involves probe_count variable. Currently wait_for_device_probe() from snapshot_open() from misc_open() can sleep forever with misc_mtx held if probe_count cannot become 0.
When a device is probed by hub_event() work function, probe_count is incremented before the probe function starts, and probe_count is decremented after the probe function completed.
There are three cases that can prevent probe_count from dropping to 0.
(a) A device being probed stopped responding (i.e. broken/malicious hardware).
(b) A process emulating a USB device using /dev/raw-gadget interface stopped responding for some reason.
(c) New device probe requests keeps coming in before existing device probe requests complete.
The phenomenon syzbot is reporting is (b). A process which is holding system_transition_mutex and misc_mtx is waiting for probe_count to become 0 inside wait_for_device_probe(), but the probe function which is called
from hub_event() work function is waiting for the processes which are
blocked at mutex_lock(&misc_mtx) to respond via /dev/raw-gadget interface.
This patch mitigates (b) by deferring wait_for_device_probe() from snapshot_open() to snapshot_write() and snapshot_ioctl(). Please note that the possibility of (b) remains as long as any thread which is emulating a USB device via /dev/raw-gadget interface can be blocked by uninterruptible blocking operations (e.g. mutex_lock()).
Please also note that (a) and (c) are not addressed. Regarding (c), we should change the code to wait for only one device which contains the image for resuming from hibernation. I don't know how to address (a), for use of timeout for wait_for_device_probe() might result in loss of user data in the image. Maybe we should require the userland to wait for the image device before opening /dev/snapshot interface.
--- kernel/power/user.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
kernel/power/user.c +12 -1
@@ -26,6 +26,7 @@#include "power.h" +static bool need_wait; static struct snapshot_data { struct snapshot_handle handle;
@@ -78,7 +79,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)* Resuming. We may need to wait for the image device to * appear. */ -wait_for_device_probe (); + need_wait = true; data->swap =-1 ; data->mode =O_WRONLY ;
@@ -168,6 +169,11 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,ssize_t res;loff_t pg_offp = *offp & ~PAGE_MASK ; +if (need_wait) { +wait_for_device_probe (); + need_wait = false; + } +lock_system_sleep (); data = filp->private_data;
@@ -244,6 +250,11 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,loff_t size;sector_t offset; +if (need_wait) { +wait_for_device_probe (); + need_wait = false; + } +if (_IOC_TYPE (cmd) !=SNAPSHOT_IOC_MAGIC )return -ENOTTY ;if (_IOC_NR (cmd) >SNAPSHOT_IOC_MAXNR )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 193/1157 selinux: fix memleak in security_read_state_kernel()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 73de1befcc53a7c68b0c5e76b9b5ac41c517760f ]
In this function, it directly returns the result of __security_read_policy without freeing the allocated memory in *data, cause memory leak issue, so free the memory if __security_read_policy failed.
--- security/selinux/ss/services.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
security/selinux/ss/services.c +8 -1
@@ -4048,6 +4048,7 @@ int security_read_policy(struct selinux_state *state,int security_read_state_kernel (struct selinux_state *state,void **data,size_t *len) { +int err;struct selinux_policy *policy; policy = rcu_dereference_protected(
@@ -4060,5 +4061,11 @@ int security_read_state_kernel(struct selinux_state *state,if (!*data)return -ENOMEM ; -return __security_read_policy (policy, *data, len); + err =__security_read_policy (policy, *data, len); +if (err) { +vfree (*data); + *data =NULL ; + *len =0 ; + } +return err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 194/1157 selinux: Add boundary check in put_entry()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 15ec76fb29be31df2bccb30fc09875274cba2776 ]
Just like next_entry(), boundary check is necessary to prevent memory out-of-bound access.
--- security/selinux/ss/policydb.h | 2 ++ 1 file changed, 2 insertions(+)
security/selinux/ss/policydb.h +2 -0
@@ -370,6 +370,8 @@ static inline int put_entry(const void *buf, size_t bytes, int num, struct polic {size_t len = bytes * num; +if (len > fp->len) +return -EINVAL ;memcpy (fp->data, buf, len); fp->data += len; fp->len -= len;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 195/1157 io_uring: fix io_uring_cqe_overflow trace format
In reply to Greg Kroah-HartmanFrom: Dylan Yudaken <[email protected]>
[ Upstream commit 9b26e811e934eebda59362c9a03d082852552574 ]
Make the trace format consistent with io_uring_complete for cflags
--- include/trace/events/io_uring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/trace/events/io_uring.h +1 -1
@@ -622,7 +622,7 @@ TRACE_EVENT(io_uring_cqe_overflow, __entry->ocqe = ocqe; ), -TP_printk ("ring %p, user_data 0x%llx, res %d, flags %x, " +TP_printk ("ring %p, user_data 0x%llx, res %d, cflags 0x%x, " "overflow_cqe %p" , __entry->ctx, __entry->user_data, __entry->res, __entry->cflags, __entry->ocqe)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 196/1157 kasan: test: Silence GCC 12 warnings
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit aaf50b1969d7933a51ea421b11432a7fb90974e3 ]
GCC 12 continues to get smarter about array accesses. The KASAN tests are expecting to explicitly test out-of-bounds conditions at run-time, so hide the variable from GCC, to avoid warnings like:
../lib/test_kasan.c: In function 'ksize_uaf':../lib/test_kasan.c:790:61: warning: array subscript 120 is outside array bounds of 'void[120]' [-Warray-bounds]
790 | KUNIT_EXPECT_KASAN_FAIL(test, ((volatile char *)ptr)[size]);
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../lib/test_kasan.c:97:9: note: in definition of macro 'KUNIT_EXPECT_KASAN_FAIL'
97 | expression; \
| ^~~~~~~~~~--- lib/test_kasan.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
lib/test_kasan.c +10 -0
@@ -131,6 +131,7 @@ static void kmalloc_oob_right(struct kunit *test) ptr =kmalloc (size,GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr); +OPTIMIZER_HIDE_VAR (ptr);/* * An unaligned access past the requested kmalloc size. * Only generic KASAN can precisely detect these.
@@ -159,6 +160,7 @@ static void kmalloc_oob_left(struct kunit *test) ptr =kmalloc (size,GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr); +OPTIMIZER_HIDE_VAR (ptr);KUNIT_EXPECT_KASAN_FAIL (test, *ptr = *(ptr -1 ));kfree (ptr); }
@@ -171,6 +173,7 @@ static void kmalloc_node_oob_right(struct kunit *test) ptr =kmalloc_node (size,GFP_KERNEL ,0 );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr); +OPTIMIZER_HIDE_VAR (ptr);KUNIT_EXPECT_KASAN_FAIL (test, ptr[0 ] = ptr[size]);kfree (ptr); }
@@ -191,6 +194,7 @@ static void kmalloc_pagealloc_oob_right(struct kunit *test) ptr =kmalloc (size,GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr); +OPTIMIZER_HIDE_VAR (ptr);KUNIT_EXPECT_KASAN_FAIL (test, ptr[size +OOB_TAG_OFF ] =0 );kfree (ptr);
@@ -271,6 +275,7 @@ static void kmalloc_large_oob_right(struct kunit *test) ptr =kmalloc (size,GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr); +OPTIMIZER_HIDE_VAR (ptr);KUNIT_EXPECT_KASAN_FAIL (test, ptr[size] =0 );kfree (ptr); }
@@ -410,6 +415,8 @@ static void kmalloc_oob_16(struct kunit *test) ptr2 =kmalloc (sizeof (*ptr2),GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr2); +OPTIMIZER_HIDE_VAR (ptr1); +OPTIMIZER_HIDE_VAR (ptr2);KUNIT_EXPECT_KASAN_FAIL (test, *ptr1 = *ptr2);kfree (ptr1);kfree (ptr2);
@@ -756,6 +763,8 @@ static void ksize_unpoisons_memory(struct kunit *test)KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr); real_size =ksize (ptr); +OPTIMIZER_HIDE_VAR (ptr); +/* This access shouldn't trigger a KASAN report. */ ptr[size] ='x' ;
@@ -778,6 +787,7 @@ static void ksize_uaf(struct kunit *test)KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr);kfree (ptr); +OPTIMIZER_HIDE_VAR (ptr);KUNIT_EXPECT_KASAN_FAIL (test,ksize (ptr));KUNIT_EXPECT_KASAN_FAIL (test, ((volatile char *)ptr)[0 ]);KUNIT_EXPECT_KASAN_FAIL (test, ((volatile char *)ptr)[size]);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 197/1157 wait: Fix __wait_event_hrtimeout for RT/DL tasks
In reply to Greg Kroah-HartmanFrom: Juri Lelli <[email protected]>
[ Upstream commit cceeeb6a6d02e7b9a74ddd27a3225013b34174aa ]
Changes to hrtimer mode (potentially made by __hrtimer_init_sleeper on PREEMPT_RT) are not visible to hrtimer_start_range_ns, thus not accounted for by hrtimer_start_expires call paths. In particular, __wait_event_hrtimeout suffers from this problem as we have, for example:
fs/aio.c::read_events
wait_event_interruptible_hrtimeout
__wait_event_hrtimeout
hrtimer_init_sleeper_on_stack <- this might "mode |= HRTIMER_MODE_HARD"
on RT if task runs at RT/DL priority
hrtimer_start_range_ns
WARN_ON_ONCE(!(mode & HRTIMER_MODE_HARD) ^ !timer->is_hard) fires since the latter doesn't see the change of mode done by init_sleeper
Fix it by making __wait_event_hrtimeout call hrtimer_sleeper_start_expires, which is aware of the special RT/DL case, instead of hrtimer_start_range_ns.
--- include/linux/wait.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
include/linux/wait.h +5 -4
@@ -544,10 +544,11 @@ do { \ \hrtimer_init_sleeper_on_stack (&__t,CLOCK_MONOTONIC , \HRTIMER_MODE_REL ); \ -if ((timeout) !=KTIME_MAX ) \ -hrtimer_start_range_ns (&__t.timer, timeout, \ - current->timer_slack_ns, \ -HRTIMER_MODE_REL ); \ +if ((timeout) !=KTIME_MAX ) { \ +hrtimer_set_expires_range_ns (&__t.timer, timeout, \ + current->timer_slack_ns); \ +hrtimer_sleeper_start_expires (&__t,HRTIMER_MODE_REL ); \ + } \ \ __ret = ___wait_event(wq_head, condition, state, 0, 0, \ if (!__t.task) { \
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 198/1157 meson-mx-socinfo: Fix refcount leak in meson_mx_socinfo_init
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit a2106f38077e78afcb4bf98fdda3e162118cfb3d ]
of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
--- drivers/soc/amlogic/meson-mx-socinfo.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/amlogic/meson-mx-socinfo.c +1 -0
@@ -126,6 +126,7 @@ static int __init meson_mx_socinfo_init(void) np =of_find_matching_node (NULL , meson_mx_socinfo_analog_top_ids);if (np) { analog_top_regmap =syscon_node_to_regmap (np); +of_node_put (np);if (IS_ERR (analog_top_regmap))return PTR_ERR (analog_top_regmap);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 199/1157 arm64: dts: renesas: beacon: Fix regulator node names
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7512af9f78dedea7e04225f665dad6750df7d095 ]
Currently there are two nodes named "regulator_camera". This causes the former to be overwritten by the latter.
Fix this by renaming them to unique names, using the preferred hyphen instead of an underscore.
While at it, update the name of the audio regulator (which was added in the same commit) to use a hyphen.
--- arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi +3 -3
@@ -146,7 +146,7 @@ rgb_panel: endpoint { }; }; - reg_audio: regulator_audio { + reg_audio: regulator-audio { compatible = "regulator-fixed"; regulator-name = "audio-1.8V"; regulator-min-microvolt = <1800000>;
@@ -174,7 +174,7 @@ reg_lcd_reset: regulator-lcd-reset { vin-supply = <®_lcd>; }; - reg_cam0: regulator_camera { + reg_cam0: regulator-cam0 { compatible = "regulator-fixed"; regulator-name = "reg_cam0"; regulator-min-microvolt = <1800000>;
@@ -183,7 +183,7 @@ reg_cam0: regulator_camera { enable-active-high; }; - reg_cam1: regulator_camera { + reg_cam1: regulator-cam1 { compatible = "regulator-fixed"; regulator-name = "reg_cam1"; regulator-min-microvolt = <1800000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 200/1157 spi: spi-altera-dfl: Fix an error handling path
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 8e3ca32f46994e74b7f43c57731150b2aedb2630 ]
The spi_alloc_master() call is not undone in all error handling paths. Moreover, there is no .remove function to release the allocated memory.
In order to fix both this issues, switch to devm_spi_alloc_master().
This allows further simplification of the probe.
--- drivers/spi/spi-altera-dfl.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/spi/spi-altera-dfl.c +5 -9
@@ -128,9 +128,9 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)struct spi_master *master;struct altera_spi *hw;void __iomem *base; -int err = -ENODEV ; +int err; - master =spi_alloc_master (dev,sizeof (struct altera_spi )); + master =devm_spi_alloc_master (dev,sizeof (struct altera_spi ));if (!master)return -ENOMEM ;
@@ -159,10 +159,9 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)altera_spi_init_master (master); err =devm_spi_register_master (dev, master); -if (err) { -dev_err (dev,"%s failed to register spi master %d\n" , __func__, err); - goto exit; - } +if (err) +return dev_err_probe (dev, err,"%s failed to register spi master\n" , + __func__);if (dfl_dev->revision ==FME_FEATURE_REV_MAX10_SPI_N5010 )strscpy (board_info.modalias,"m10-n5010" ,SPI_NAME_SIZE );
@@ -179,9 +178,6 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev) }return 0 ; -exit: -spi_master_put (master); -return err; }static const struct dfl_device_id dfl_spi_altera_ids[] = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 201/1157 ARM: bcm: Fix refcount leak in bcm_kona_smc_init
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit cb23389a2458c2e4bfd6c86a513cbbe1c4d35e76 ]
of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
--- arch/arm/mach-bcm/bcm_kona_smc.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-bcm/bcm_kona_smc.c +1 -0
@@ -52,6 +52,7 @@ int __init bcm_kona_smc_init(void)return -ENODEV ; prop_val =of_get_address (node,0 , &prop_size,NULL ); +of_node_put (node);if (!prop_val)return -EINVAL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 202/1157 ACPI: processor/idle: Annotate more functions to live in cpuidle section
In reply to Greg Kroah-HartmanFrom: Guilherme G. Piccoli <[email protected]>
[ Upstream commit 409dfdcaffb266acfc1f33529a26b1443c9332d4 ]
Commit 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus") introduced a new text section called cpuidle; with that, we have a mechanism to add idling functions in such section and skip them from nmi_backtrace output, since they're useless and potentially flooding for such report.
Happens that inlining might cause some real idle functions to end-up outside of such section; this is currently the case of ACPI processor_idle driver; the functions acpi_idle_enter_* do inline acpi_idle_do_entry(), hence they stay out of the cpuidle section.
Fix that by marking such functions to also live in the cpuidle section.
--- drivers/acpi/processor_idle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/processor_idle.c +3 -3
@@ -607,7 +607,7 @@ static DEFINE_RAW_SPINLOCK(c3_lock);* @cx: Target state context * @index: index of target state */ -static int acpi_idle_enter_bm (struct cpuidle_driver *drv, +static int __cpuidle acpi_idle_enter_bm(struct cpuidle_driver *drv,struct acpi_processor *pr,struct acpi_processor_cx *cx,int index)
@@ -664,7 +664,7 @@ static int acpi_idle_enter_bm(struct cpuidle_driver *drv,return index; } -static int acpi_idle_enter (struct cpuidle_device *dev, +static int __cpuidle acpi_idle_enter(struct cpuidle_device *dev,struct cpuidle_driver *drv,int index) {struct acpi_processor_cx *cx =per_cpu (acpi_cstate[index], dev->cpu);
@@ -693,7 +693,7 @@ static int acpi_idle_enter(struct cpuidle_device *dev,return index; } -static int acpi_idle_enter_s2idle (struct cpuidle_device *dev, +static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,struct cpuidle_driver *drv,int index) {struct acpi_processor_cx *cx =per_cpu (acpi_cstate[index], dev->cpu);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 203/1157 ARM: dts: imx7d-colibri-emmc: add cpu1 supply
In reply to Greg Kroah-HartmanFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit ba28db60d34271e8a3cf4d7158d71607e8b1e57f ]
Each cpu-core is supposed to list its supply separately, add supply for cpu1.
--- arch/arm/boot/dts/imx7d-colibri-emmc.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/imx7d-colibri-emmc.dtsi +4 -0
@@ -13,6 +13,10 @@ memory@80000000 { }; }; +&cpu1 { + cpu-supply = <®_DCDC2>; +}; + &gpio6 { gpio-line-names = "", "",
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 204/1157 ARM: dts: imx7-colibri: overhaul display/touch functionality
In reply to Greg Kroah-HartmanFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit dbeb8e72cc51536a70313e6d523dcb1429b40477 ]
Rename display interface to match other modules to make it easier to use device tree overlays.
The parallel RGB interface (lcdif) and all related stuff turn on in a device tree overlay. Keep them disabled in the main devicetree. As these subsystems are provided by module and not a part of boards, move their definitions into the module-level devicetree.
Disable ad7879 touchscreen which turns on in a devic tree overlay. Remains it disabled in the main devicetree.
Move Atmel MXT capacitive touch controller device tree nodes from carrier board to module level and add iomux pinctl groups for both the Capacitive Touch Adapter (using SODIMM 28/30) and the capacitive touch connector as found on later carrier boards (using SODIMM 106/107).
Keep touchscreen and display nodes enabled for NAND based i.MX 7 modules, since device tree overlays are not yet supported. For the Colibri Evaluation Board keep the Capacitive Touch Adapter node disabled and PWM2, PWM3 enabled instead.
For eMMC based modules keep nodes disabled to work in conjunction with device tree overlays.
Add the iomuxc pinctrl group for the LVDS transceiver related signals to use it in a device tree overlay.
While at it also alphabetically re=order them properties.
--- arch/arm/boot/dts/imx7-colibri-aster.dtsi | 53 ------------ arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi | 66 +++----------- arch/arm/boot/dts/imx7-colibri.dtsi | 95 ++++++++++++++++++--- arch/arm/boot/dts/imx7d-colibri-aster.dts | 20 +++++ arch/arm/boot/dts/imx7d-colibri-eval-v3.dts | 32 +++++++ arch/arm/boot/dts/imx7s-colibri-aster.dts | 20 +++++ arch/arm/boot/dts/imx7s-colibri-eval-v3.dts | 32 +++++++ 7 files changed, 197 insertions(+), 121 deletions(-)
arch/arm/boot/dts/imx7-colibri-aster.dtsi +0 -53
@@ -4,10 +4,6 @@ * */ - -#include <dt-bindings/input/input.h> -#include <dt-bindings/pwm/pwm.h> - / { chosen { stdout-path = "serial0:115200n8";
@@ -27,18 +23,6 @@ power { }; }; - panel: panel { - compatible = "edt,et057090dhu"; - backlight = <&bl>; - power-supply = <®_3v3>; - - port { - panel_in: endpoint { - remote-endpoint = <&lcdif_out>; - }; - }; - }; - reg_3v3: regulator-3v3 { compatible = "regulator-fixed"; regulator-name = "3.3V";
@@ -77,13 +61,6 @@ &adc2 { status = "disabled"; }; -&bl { - brightness-levels = <0 4 8 16 32 64 128 255>; - default-brightness-level = <6>; - power-supply = <®_3v3>; - status = "okay"; -}; - &fec1 { status = "okay"; };
@@ -91,17 +68,6 @@ &fec1 { &i2c4 { status = "okay"; - /* Microchip/Atmel maxtouch controller */ - touchscreen@4a { - compatible = "atmel,maxtouch"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gpiotouch>; - reg = <0x4a>; - interrupt-parent = <&gpio2>; - interrupts = <15 IRQ_TYPE_EDGE_FALLING>; /* SODIMM 107 */ - reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; /* SODIMM 106 */ - }; - /* M41T0M6 real time clock on carrier board */ rtc: rtc@68 { compatible = "st,m41t0";
@@ -109,25 +75,6 @@ rtc: rtc@68 { }; }; -&iomuxc { - pinctrl_gpiotouch: touchgpios { - fsl,pins = < - MX7D_PAD_EPDC_DATA15__GPIO2_IO15 0x74 - MX7D_PAD_EPDC_BDR0__GPIO2_IO28 0x14 - >; - }; -}; - -&lcdif { - status = "okay"; - - port { - lcdif_out: endpoint { - remote-endpoint = <&panel_in>; - }; - }; -}; - &pwm1 { status = "okay"; };
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi +12 -54
99 lines not on this page · raw message
arch/arm/boot/dts/imx7-colibri.dtsi +81 -14
145 lines not on this page · raw message
arch/arm/boot/dts/imx7d-colibri-aster.dts +20 -0
@@ -14,6 +14,26 @@ / { "fsl,imx7d"; }; +&ad7879_ts { + status = "okay"; +}; + +&atmel_mxt_ts { + status = "okay"; +}; + +&backlight { + status = "okay"; +}; + +&lcdif { + status = "okay"; +}; + +&panel_dpi { + status = "okay"; +}; + &usbotg2 { vbus-supply = <®_usbh_vbus>; status = "okay";
arch/arm/boot/dts/imx7d-colibri-eval-v3.dts +32 -0
@@ -13,6 +13,38 @@ / { "fsl,imx7d"; }; +&ad7879_ts { + status = "okay"; +}; + +/* + * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3. + * So if you enable following capacitive touch controller, disable pwm2/pwm3 first. + */ +&atmel_mxt_ts { + status = "disabled"; +}; + +&backlight { + status = "okay"; +}; + +&lcdif { + status = "okay"; +}; + +&panel_dpi { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&pwm3 { + status = "okay"; +}; + &usbotg2 { vbus-supply = <®_usbh_vbus>; status = "okay";
arch/arm/boot/dts/imx7s-colibri-aster.dts +20 -0
@@ -13,3 +13,23 @@ / { compatible = "toradex,colibri-imx7s-aster", "toradex,colibri-imx7s", "fsl,imx7s"; }; + +&ad7879_ts { + status = "okay"; +}; + +&atmel_mxt_ts { + status = "okay"; +}; + +&backlight { + status = "okay"; +}; + +&lcdif { + status = "okay"; +}; + +&panel_dpi { + status = "okay"; +};
arch/arm/boot/dts/imx7s-colibri-eval-v3.dts +32 -0
@@ -12,3 +12,35 @@ / { compatible = "toradex,colibri-imx7s-eval-v3", "toradex,colibri-imx7s", "fsl,imx7s"; }; + +&ad7879_ts { + status = "okay"; +}; + +/* + * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3. + * So if you enable following capacitive touch controller, disable pwm2/pwm3 first. + */ +&atmel_mxt_ts { + status = "disabled"; +}; + +&backlight { + status = "okay"; +}; + +&lcdif { + status = "okay"; +}; + +&panel_dpi { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&pwm3 { + status = "okay"; +};
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 205/1157 ARM: dts: imx7-colibri: add usb dual-role switching using extcon
In reply to Greg Kroah-HartmanFrom: Philippe Schenker <[email protected]>
[ Upstream commit 136f88458d829987548b3321e7122e05acd78dd9 ]
Add USB dual-role switching using extcon.
--- arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi | 8 ++++++++ arch/arm/boot/dts/imx7-colibri.dtsi | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi +8 -0
@@ -20,6 +20,13 @@ clk16m: clk16m { clock-frequency = <16000000>; }; + extcon_usbc_det: usbc-det { + compatible = "linux,extcon-usb-gpio"; + id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbc_det>; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default";
@@ -141,6 +148,7 @@ &uart3 { }; &usbotg1 { + extcon = <0>, <&extcon_usbc_det>; status = "okay"; };
arch/arm/boot/dts/imx7-colibri.dtsi +2 -3
@@ -497,7 +497,7 @@ &uart3 { }; &usbotg1 { - dr_mode = "host"; + dr_mode = "otg"; }; &usdhc1 {
@@ -525,8 +525,7 @@ &usdhc3 { &iomuxc { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4 - &pinctrl_usbc_det>; + pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4>; /* * Atmel MXT touchsceen + Capacitive Touch Adapter
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 206/1157 ARM: dts: imx7-colibri: improve wake-up with gpio key
In reply to Greg Kroah-HartmanFrom: Oleksandr Suvorov <[email protected]>
[ Upstream commit fd5d2974652c96935d94301af6eaf6b3585ab330 ]
The pin GPIO1_IO01 externally pulls down, it is required to sequentially connect this pin (signal WAKE_MICO#) to +3v3 and then disconnect it to trigger a wakeup interrupt.
Adding the flag GPIO_PULL_DOWN allows the system to be woken up just connecting the pin GPIO1_IO01 to +3v3.
--- arch/arm/boot/dts/imx7-colibri-aster.dtsi | 2 +- arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx7-colibri-aster.dtsi +1 -1
@@ -16,7 +16,7 @@ gpio-keys { power { label = "Wake-Up"; - gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; linux,code = <KEY_WAKEUP>; debounce-interval = <10>; wakeup-source;
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi +1 -1
@@ -34,7 +34,7 @@ gpio-keys { power { label = "Wake-Up"; - gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; linux,code = <KEY_WAKEUP>; debounce-interval = <10>; wakeup-source;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 207/1157 ARM: dts: imx7-colibri: move aliases, chosen, extcon and gpio-keys
In reply to Greg Kroah-HartmanFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit 0ef1969ea5699b00394e1a8c8c7f927b2d0bc5bb ]
Move aliases, chosen, extcon and gpio-keys to module-level device tree given they are standard Colibri functionalities.
--- arch/arm/boot/dts/imx7-colibri-aster.dtsi | 18 ------------ arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi | 31 -------------------- arch/arm/boot/dts/imx7-colibri.dtsi | 32 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 49 deletions(-)
arch/arm/boot/dts/imx7-colibri-aster.dtsi +0 -18
@@ -5,24 +5,6 @@ */ / { - chosen { - stdout-path = "serial0:115200n8"; - }; - - gpio-keys { - compatible = "gpio-keys"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gpiokeys>; - - power { - label = "Wake-Up"; - gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; - linux,code = <KEY_WAKEUP>; - debounce-interval = <10>; - wakeup-source; - }; - }; - reg_3v3: regulator-3v3 { compatible = "regulator-fixed"; regulator-name = "3.3V";
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi +0 -31
@@ -4,15 +4,6 @@ */ / { - aliases { - rtc0 = &rtc; - rtc1 = &snvs_rtc; - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - /* fixed crystal dedicated to mpc258x */ clk16m: clk16m { compatible = "fixed-clock";
@@ -20,27 +11,6 @@ clk16m: clk16m { clock-frequency = <16000000>; }; - extcon_usbc_det: usbc-det { - compatible = "linux,extcon-usb-gpio"; - id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usbc_det>; - }; - - gpio-keys { - compatible = "gpio-keys"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gpiokeys>; - - power { - label = "Wake-Up"; - gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; - linux,code = <KEY_WAKEUP>; - debounce-interval = <10>; - wakeup-source; - }; - }; - reg_3v3: regulator-3v3 { compatible = "regulator-fixed"; regulator-name = "3.3V";
@@ -148,7 +118,6 @@ &uart3 { }; &usbotg1 { - extcon = <0>, <&extcon_usbc_det>; status = "okay"; };
arch/arm/boot/dts/imx7-colibri.dtsi +32 -0
@@ -6,6 +6,11 @@ #include <dt-bindings/pwm/pwm.h> / { + aliases { + rtc0 = &rtc; + rtc1 = &snvs_rtc; + }; + backlight: backlight { brightness-levels = <0 45 63 88 119 158 203 255>; compatible = "pwm-backlight";
@@ -18,6 +23,32 @@ backlight: backlight { status = "disabled"; }; + chosen { + stdout-path = "serial0:115200n8"; + }; + + extcon_usbc_det: usbc-det { + compatible = "linux,extcon-usb-gpio"; + debounce = <25>; + id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbc_det>; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpiokeys>; + + wakeup { + debounce-interval = <10>; + gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* SODIMM 45 */ + label = "Wake-Up"; + linux,code = <KEY_WAKEUP>; + wakeup-source; + }; + }; + panel_dpi: panel-dpi { backlight = <&backlight>; compatible = "edt,et057090dhu";
@@ -498,6 +529,7 @@ &uart3 { &usbotg1 { dr_mode = "otg"; + extcon = <0>, <&extcon_usbc_det>; }; &usdhc1 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 208/1157 ARM: dts: imx7-colibri-eval-v3: correct can controller comment
In reply to Greg Kroah-HartmanFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit 32f054fef145878c5331f9dd343014970a15ebfa ]
Correct CAN controller comment. It is a MCP2515 rather than a mpc258x.
--- arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi +1 -1
@@ -4,7 +4,7 @@ */ / { - /* fixed crystal dedicated to mpc258x */ + /* Fixed crystal dedicated to MCP2515. */ clk16m: clk16m { compatible = "fixed-clock"; #clock-cells = <0>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 209/1157 soc: renesas: r8a779a0-sysc: Fix A2DP1 and A2CV[2357] PDR values
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit bccceabb92ce8eb78bbf2de08308e2cc2761a2e5 ]
The PDR values for the A2DP1 and A2CV[2357] power areas on R-Car V3U are incorrect (copied-and-pasted from A2DP0 and A2CV[0146]).
Fix them.
--- drivers/soc/renesas/r8a779a0-sysc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/soc/renesas/r8a779a0-sysc.c +5 -5
@@ -57,11 +57,11 @@ static struct rcar_gen4_sysc_area r8a779a0_areas[] __initdata = { { "a2cv6", R8A779A0_PD_A2CV6, R8A779A0_PD_A3IR }, { "a2cn2", R8A779A0_PD_A2CN2, R8A779A0_PD_A3IR }, { "a2imp23", R8A779A0_PD_A2IMP23, R8A779A0_PD_A3IR }, - { "a2dp1", R8A779A0_PD_A2DP0, R8A779A0_PD_A3IR }, - { "a2cv2", R8A779A0_PD_A2CV0, R8A779A0_PD_A3IR }, - { "a2cv3", R8A779A0_PD_A2CV1, R8A779A0_PD_A3IR }, - { "a2cv5", R8A779A0_PD_A2CV4, R8A779A0_PD_A3IR }, - { "a2cv7", R8A779A0_PD_A2CV6, R8A779A0_PD_A3IR }, + { "a2dp1", R8A779A0_PD_A2DP1, R8A779A0_PD_A3IR }, + { "a2cv2", R8A779A0_PD_A2CV2, R8A779A0_PD_A3IR }, + { "a2cv3", R8A779A0_PD_A2CV3, R8A779A0_PD_A3IR }, + { "a2cv5", R8A779A0_PD_A2CV5, R8A779A0_PD_A3IR }, + { "a2cv7", R8A779A0_PD_A2CV7, R8A779A0_PD_A3IR }, { "a2cn1", R8A779A0_PD_A2CN1, R8A779A0_PD_A3IR }, { "a1cnn0", R8A779A0_PD_A1CNN0, R8A779A0_PD_A2CN0 }, { "a1cnn2", R8A779A0_PD_A1CNN2, R8A779A0_PD_A2CN2 },
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 210/1157 soc: amlogic: Fix refcount leak in meson-secure-pwrc.c
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit d18529a4c12f66d83daac78045ea54063bd43257 ]
In meson_secure_pwrc_probe(), there is a refcount leak in one fail path.
--- drivers/soc/amlogic/meson-secure-pwrc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/soc/amlogic/meson-secure-pwrc.c +3 -1
@@ -152,8 +152,10 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev) } pwrc =devm_kzalloc (&pdev->dev,sizeof (*pwrc),GFP_KERNEL ); -if (!pwrc) +if (!pwrc) { +of_node_put (sm_np);return -ENOMEM ; + } pwrc->fw =meson_sm_get (sm_np);of_node_put (sm_np);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 211/1157 arm64: dts: renesas: Fix thermal-sensors on single-zone sensors
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 62e8a53431145e06e503b71625a34eaa87b72b2c ]
"make dtbs_check":
arch/arm64/boot/dts/renesas/r8a774c0-cat874.dtb: thermal-zones: cpu-thermal:thermal-sensors: [[74], [0]] is too long
arch/arm64/boot/dts/renesas/r8a774c0-ek874.dtb: thermal-zones: cpu-thermal:thermal-sensors: [[79], [0]] is too long
arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dtb: thermal-zones: cpu-thermal:thermal-sensors: [[82], [0]] is too long
arch/arm64/boot/dts/renesas/r8a774c0-ek874-mipi-2.1.dtb: thermal-zones: cpu-thermal:thermal-sensors: [[87], [0]] is too long
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dtb: thermal-zones: cpu-thermal:thermal-sensors: [[105], [0]] is too long
From schema: Documentation/devicetree/bindings/thermal/thermal-zones.yamlIndeed, the thermal sensors on R-Car E3 and RZ/G2E support only a single zone, hence #thermal-sensor-cells = <0>.
Fix this by dropping the bogus zero cell from the thermal sensor specifiers.
--- arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 2 +- arch/arm64/boot/dts/renesas/r8a77990.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +1 -1
@@ -1952,7 +1952,7 @@ thermal-zones { cpu-thermal { polling-delay-passive = <250>; polling-delay = <0>; - thermal-sensors = <&thermal 0>; + thermal-sensors = <&thermal>; sustainable-power = <717>; cooling-maps {
arch/arm64/boot/dts/renesas/r8a77990.dtsi +1 -1
@@ -2129,7 +2129,7 @@ thermal-zones { cpu-thermal { polling-delay-passive = <250>; polling-delay = <0>; - thermal-sensors = <&thermal 0>; + thermal-sensors = <&thermal>; sustainable-power = <717>; cooling-maps {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 212/1157 Revert "ARM: dts: imx6qdl-apalis: Avoid underscore in node name"
In reply to Greg Kroah-HartmanFrom: Max Krummenacher <[email protected]>
[ Upstream commit 9c0919acb3fa7c1a24e384ff912f2d88f060c373 ]
The STMPE MFD device binding requires the child node to have a fixed name, i.e. with '_', not '-'. Otherwise the stmpe_adc, stmpe_touchscreen drivers will not be probed.
--- arch/arm/boot/dts/imx6qdl-apalis.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx6qdl-apalis.dtsi +2 -2
@@ -315,7 +315,7 @@ stmpe811@41 { /* ADC conversion time: 80 clocks */ st,sample-time = <4>; - stmpe_touchscreen: stmpe-touchscreen { + stmpe_touchscreen: stmpe_touchscreen { compatible = "st,stmpe-ts"; /* 8 sample average control */ st,ave-ctrl = <3>;
@@ -332,7 +332,7 @@ stmpe_touchscreen: stmpe-touchscreen { st,touch-det-delay = <5>; }; - stmpe_adc: stmpe-adc { + stmpe_adc: stmpe_adc { compatible = "st,stmpe-adc"; /* forbid to use ADC channels 3-0 (touch) */ st,norequest-mask = <0x0F>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 213/1157 x86/pmem: Fix platform-device leak in error path
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 229e73d46994f15314f58b2d39bf952111d89193 ]
Make sure to free the platform device in the unlikely event that registration fails.
--- arch/x86/kernel/pmem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kernel/pmem.c +6 -1
@@ -27,6 +27,11 @@ static __init int register_e820_pmem(void)* simply here to trigger the module to load on demand. */ pdev =platform_device_alloc ("e820_pmem" ,-1 ); -return platform_device_add (pdev); + + rc =platform_device_add (pdev); +if (rc) +platform_device_put (pdev); + +return rc; }device_initcall (register_e820_pmem);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 214/1157 ARM: dts: ast2500-evb: fix board compatible
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 30b276fca5c0644f3cb17bceb1bd6a626c670184 ]
The AST2500 EVB board should have dedicated compatible.
--- arch/arm/boot/dts/aspeed-ast2500-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-ast2500-evb.dts +1 -1
@@ -5,7 +5,7 @@ / { model = "AST2500 EVB"; - compatible = "aspeed,ast2500"; + compatible = "aspeed,ast2500-evb", "aspeed,ast2500"; aliases { serial4 = &uart5;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 215/1157 ARM: dts: ast2600-evb: fix board compatible
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit aa5e06208500a0db41473caebdee5a2e81d5a277 ]
The AST2600 EVB board should have dedicated compatible.
--- arch/arm/boot/dts/aspeed-ast2600-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-ast2600-evb.dts +1 -1
@@ -8,7 +8,7 @@ / { model = "AST2600 EVB"; - compatible = "aspeed,ast2600"; + compatible = "aspeed,ast2600-evb-a1", "aspeed,ast2600"; aliases { serial4 = &uart5;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 216/1157 ARM: dts: ast2600-evb-a1: fix board compatible
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 33c39140cc298e0d4e36083cb9a665a837773a60 ]
The AST2600 EVB A1 board should have dedicated compatible.
--- arch/arm/boot/dts/aspeed-ast2600-evb-a1.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/aspeed-ast2600-evb-a1.dts +1 -0
@@ -5,6 +5,7 @@ / { model = "AST2600 A1 EVB"; + compatible = "aspeed,ast2600-evb-a1", "aspeed,ast2600"; /delete-node/regulator-vcc-sdhci0; /delete-node/regulator-vcc-sdhci1;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 217/1157 arm64: dts: mt8192: Fix idle-states nodes naming scheme
In reply to Greg Kroah-HartmanFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 399e23ad51caaf62400a531c9268ad3c453c3d76 ]
Tweak the name of the idle-states subnodes so that they follow the binding pattern, getting rid of dtbs_check warnings.
Only the usage of "-" in the name was necessary, but "off" was also exchanged for "sleep" since that seems to be a more common wording in other dts files.
--- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/mediatek/mt8192.dtsi +12 -12
@@ -43,7 +43,7 @@ cpu0: cpu@0 { reg = <0x000>; enable-method = "psci"; clock-frequency = <1701000000>; - cpu-idle-states = <&cpuoff_l &clusteroff_l>; + cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; capacity-dmips-mhz = <530>; };
@@ -54,7 +54,7 @@ cpu1: cpu@100 { reg = <0x100>; enable-method = "psci"; clock-frequency = <1701000000>; - cpu-idle-states = <&cpuoff_l &clusteroff_l>; + cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; capacity-dmips-mhz = <530>; };
@@ -65,7 +65,7 @@ cpu2: cpu@200 { reg = <0x200>; enable-method = "psci"; clock-frequency = <1701000000>; - cpu-idle-states = <&cpuoff_l &clusteroff_l>; + cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; capacity-dmips-mhz = <530>; };
@@ -76,7 +76,7 @@ cpu3: cpu@300 { reg = <0x300>; enable-method = "psci"; clock-frequency = <1701000000>; - cpu-idle-states = <&cpuoff_l &clusteroff_l>; + cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; capacity-dmips-mhz = <530>; };
@@ -87,7 +87,7 @@ cpu4: cpu@400 { reg = <0x400>; enable-method = "psci"; clock-frequency = <2171000000>; - cpu-idle-states = <&cpuoff_b &clusteroff_b>; + cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; capacity-dmips-mhz = <1024>; };
@@ -98,7 +98,7 @@ cpu5: cpu@500 { reg = <0x500>; enable-method = "psci"; clock-frequency = <2171000000>; - cpu-idle-states = <&cpuoff_b &clusteroff_b>; + cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; capacity-dmips-mhz = <1024>; };
@@ -109,7 +109,7 @@ cpu6: cpu@600 { reg = <0x600>; enable-method = "psci"; clock-frequency = <2171000000>; - cpu-idle-states = <&cpuoff_b &clusteroff_b>; + cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; capacity-dmips-mhz = <1024>; };
@@ -120,7 +120,7 @@ cpu7: cpu@700 { reg = <0x700>; enable-method = "psci"; clock-frequency = <2171000000>; - cpu-idle-states = <&cpuoff_b &clusteroff_b>; + cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; capacity-dmips-mhz = <1024>; };
@@ -173,7 +173,7 @@ l3_0: l3-cache { idle-states { entry-method = "arm,psci"; - cpuoff_l: cpuoff_l { + cpu_sleep_l: cpu-sleep-l { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x00010001>; local-timer-stop;
@@ -181,7 +181,7 @@ cpuoff_l: cpuoff_l { exit-latency-us = <140>; min-residency-us = <780>; }; - cpuoff_b: cpuoff_b { + cpu_sleep_b: cpu-sleep-b { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x00010001>; local-timer-stop;
@@ -189,7 +189,7 @@ cpuoff_b: cpuoff_b { exit-latency-us = <145>; min-residency-us = <720>; }; - clusteroff_l: clusteroff_l { + cluster_sleep_l: cluster-sleep-l { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x01010002>; local-timer-stop;
@@ -197,7 +197,7 @@ clusteroff_l: clusteroff_l { exit-latency-us = <155>; min-residency-us = <860>; }; - clusteroff_b: clusteroff_b { + cluster_sleep_b: cluster-sleep-b { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x01010002>; local-timer-stop;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 218/1157 arm64: dts: mt8192: Fix idle-states entry-method
In reply to Greg Kroah-HartmanFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 2e599740f7e423ee89fb027896cb2635dd43784f ]
The entry-method property of the idle-states node should be "psci" as described in the idle-states binding, since this is already the value of enable-method in the CPU nodes. Fix it to get rid of a dtbs_check warning.
--- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8192.dtsi +1 -1
@@ -172,7 +172,7 @@ l3_0: l3-cache { }; idle-states { - entry-method = "arm,psci"; + entry-method = "psci"; cpu_sleep_l: cpu-sleep-l { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x00010001>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 219/1157 arm64: select TRACE_IRQFLAGS_NMI_SUPPORT
In reply to Greg Kroah-HartmanFrom: Mark Rutland <[email protected]>
[ Upstream commit 3381da254fab37ba08c4b7c4f19b4ee28b1a27ec ]
Due to an oversight, on arm64 lockdep IRQ state tracking doesn't work as intended in NMI context. This demonstrably results in bogus warnings from lockdep, and in theory could mask a variety of issues.
On arm64, we've consistently tracked IRQ flag state for NMIs (and saved/restored the state of the interrupted context) since commit:
f0cd5ac1e4c53cb6 ("arm64: entry: fix NMI {user, kernel}->kernel transitions")
That commit fixed most lockdep issues with NMI by virtue of the save/restore of the lockdep state of the interrupted context. However, for lockdep IRQ state tracking to consistently take effect in NMI context it has been necessary to select TRACE_IRQFLAGS_NMI_SUPPORT since commit:
ed00495333ccc80f ("locking/lockdep: Fix TRACE_IRQFLAGS vs. NMIs")
As arm64 does not select TRACE_IRQFLAGS_NMI_SUPPORT, this means that the lockdep state can be stale in NMI context, and some uses of that state can consume stale data.
When an NMI is taken arm64 entry code will call arm64_enter_nmi(). This will enter NMI context via __nmi_enter() before calling lockdep_hardirqs_off() to inform lockdep that IRQs have been masked. Where TRACE_IRQFLAGS_NMI_SUPPORT is not selected, lockdep_hardirqs_off() will not update lockdep state if called in NMI context. Thus if IRQs were enabled in the original context, lockdep will continue to believe that IRQs are enabled despite the call to lockdep_hardirqs_off().
However, the lockdep_assert_*() checks do take effect in NMI context, and will consume the stale lockdep state. If an NMI is taken from a context which had IRQs enabled, and during the handling of the NMI something calls lockdep_assert_irqs_disabled(), this will result in a spurious warning based upon the stale lockdep state.
This can be seen when using perf with GICv3 pseudo-NMIs. Within the perf NMI handler we may attempt a uaccess to record the userspace callchain, and is this faults the el1_abort() call in the nested context will call exit_to_kernel_mode() when returning, which has a lockdep_assert_irqs_disabled() assertion:
| # ./perf record -a -g sh | ------------[ cut here ]------------ | WARNING: CPU: 0 PID: 164 at arch/arm64/kernel/entry-common.c:73 exit_to_kernel_mode+0x118/0x1ac | Modules linked in: | CPU: 0 PID: 164 Comm: perf Not tainted 5.18.0-rc5 #1 | Hardware name: linux,dummy-virt (DT) | pstate: 004003c5 (nzcv DAIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : exit_to_kernel_mode+0x118/0x1ac | lr : el1_abort+0x80/0xbc | sp : ffff8000080039f0 | pmr_save: 000000f0 | x29: ffff8000080039f0 x28: ffff6831054e4980 x27: ffff683103adb400 | x26: 0000000000000000 x25: 0000000000000001 x24: 0000000000000001 | x23: 00000000804000c5 x22: 00000000000000c0 x21: 0000000000000001 | x20: ffffbd51e635ec44 x19: ffff800008003a60 x18: 0000000000000000 | x17: ffffaadf98d23000 x16: ffff800008004000 x15: 0000ffffd14f25c0 | x14: 0000000000000000 x13: 00000000000018eb x12: 0000000000000040 | x11: 000000000000001e x10: 000000002b820020 x9 : 0000000100110000 | x8 : 000000000045cac0 x7 : 0000ffffd14f25c0 x6 : ffffbd51e639b000 | x5 : 00000000000003e5 x4 : ffffbd51e58543b0 x3 : 0000000000000001 | x2 : ffffaadf98d23000 x1 : ffff6831054e4980 x0 : 0000000100110000 | Call trace: | exit_to_kernel_mode+0x118/0x1ac | el1_abort+0x80/0xbc | el1h_64_sync_handler+0xa4/0xd0 | el1h_64_sync+0x74/0x78 | __arch_copy_from_user+0xa4/0x230 | get_perf_callchain+0x134/0x1e4 | perf_callchain+0x7c/0xa0 | perf_prepare_sample+0x414/0x660 | perf_event_output_forward+0x80/0x180 | __perf_event_overflow+0x70/0x13c | perf_event_overflow+0x1c/0x30 | armv8pmu_handle_irq+0xe8/0x160 | armpmu_dispatch_irq+0x2c/0x70 | handle_percpu_devid_fasteoi_nmi+0x7c/0xbc | generic_handle_domain_nmi+0x3c/0x60 | gic_handle_irq+0x1dc/0x310 | call_on_irq_stack+0x2c/0x54 | do_interrupt_handler+0x80/0x94 | el1_interrupt+0xb0/0xe4 | el1h_64_irq_handler+0x18/0x24 | el1h_64_irq+0x74/0x78 | lockdep_hardirqs_off+0x50/0x120 | trace_hardirqs_off+0x38/0x214 | _raw_spin_lock_irq+0x98/0xa0 | pipe_read+0x1f8/0x404 | new_sync_read+0x140/0x150 | vfs_read+0x190/0x1dc | ksys_read+0xdc/0xfc | __arm64_sys_read+0x20/0x30 | invoke_syscall+0x48/0x114 | el0_svc_common.constprop.0+0x158/0x17c | do_el0_svc+0x28/0x90 | el0_svc+0x60/0x150 | el0t_64_sync_handler+0xa4/0x130 | el0t_64_sync+0x19c/0x1a0 | irq event stamp: 483 | hardirqs last enabled at (483): [<ffffbd51e636aa24>] _raw_spin_unlock_irqrestore+0xa4/0xb0 | hardirqs last disabled at (482): [<ffffbd51e636acd0>] _raw_spin_lock_irqsave+0xb0/0xb4 | softirqs last enabled at (468): [<ffffbd51e5216f58>] put_cpu_fpsimd_context+0x28/0x70 | softirqs last disabled at (466): [<ffffbd51e5216ed4>] get_cpu_fpsimd_context+0x0/0x5c | ---[ end trace 0000000000000000 ]---
Note that as lockdep_assert_irqs_disabled() uses WARN_ON_ONCE(), and this uses a BRK, the warning is logged with the real PSTATE at the time of the warning, which clearly has DAIF.I set, meaning IRQs (and pseudo-NMIs) were definitely masked and the warning is spurious.
Fix this by selecting TRACE_IRQFLAGS_NMI_SUPPORT such that the existing entry tracking takes effect, as we had originally intended when the arm64 entry code was fixed for transitions to/from NMI.
Arguably the lockdep_assert_*() functions should have the same NMI checks as the rest of the code to prevent spurious warnings when TRACE_IRQFLAGS_NMI_SUPPORT is not selected, but the real fix for any architecture is to explicitly handle the transitions to/from NMI in the entry code.
--- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/Kconfig +1 -0
@@ -226,6 +226,7 @@ config ARM64 select THREAD_INFO_IN_TASK select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD select TRACE_IRQFLAGS_SUPPORT + select TRACE_IRQFLAGS_NMI_SUPPORT help ARM 64-bit (AArch64) Linux support.
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 220/1157 arm64: cpufeature: Allow different PMU versions in ID_DFR0_EL1
In reply to Greg Kroah-HartmanFrom: Alexandru Elisei <[email protected]>
[ Upstream commit 506506cad3947b942425b119ffa2b06715d5d804 ]
Commit b20d1ba3cf4b ("arm64: cpufeature: allow for version discrepancy in PMU implementations") made it possible to run Linux on a machine with PMUs with different versions without tainting the kernel. The patch relaxed the restriction only for the ID_AA64DFR0_EL1.PMUVer field, and missed doing the same for ID_DFR0_EL1.PerfMon , which also reports the PMU version, but for the AArch32 state.
For example, with Linux running on two clusters with different PMU versions, the kernel is tainted when bringing up secondaries with the following message:
[ 0.097027] smp: Bringing up secondary CPUs ... [..] [ 0.142805] Detected PIPT I-cache on CPU4 [ 0.142805] CPU features: SANITY CHECK: Unexpected variation in SYS_ID_DFR0_EL1. Boot CPU: 0x00000004011088, CPU4: 0x00000005011088 [ 0.143555] CPU features: Unsupported CPU feature variation detected. [ 0.143702] GICv3: CPU4: found redistributor 10000 region 0:0x000000002f180000 [ 0.143702] GICv3: CPU4: using allocated LPI pending table @0x00000008800d0000 [ 0.144888] CPU4: Booted secondary processor 0x0000010000 [0x410fd0f0]
The boot CPU implements FEAT_PMUv3p1 (ID_DFR0_EL1.PerfMon, bits 27:24, is 0b0100), but CPU4, part of the other cluster, implements FEAT_PMUv3p4 (ID_DFR0_EL1.PerfMon = 0b0101).
Treat the PerfMon field as FTR_NONSTRICT and FTR_EXACT to pass the sanity check and to match how PMUVer is treated for the 64bit ID register.
--- arch/arm64/kernel/cpufeature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/cpufeature.c +1 -1
@@ -562,7 +562,7 @@ static const struct arm64_ftr_bits ftr_id_pfr2[] = {static const struct arm64_ftr_bits ftr_id_dfr0[] = {/* [31:28] TraceFilt */ -S_ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_DFR0_PERFMON_SHIFT ,4 ,0xf ), +S_ARM64_FTR_BITS (FTR_HIDDEN ,FTR_NONSTRICT ,FTR_EXACT ,ID_DFR0_PERFMON_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_DFR0_MPROFDBG_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_DFR0_MMAPTRC_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_DFR0_COPTRC_SHIFT ,4 ,0 ),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 221/1157 locking/lockdep: Fix lockdep_init_map_*() confusion
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
[ Upstream commit eae6d58d67d9739be5f7ae2dbead1d0ef6528243 ]
Commit dfd5e3f5fe27 ("locking/lockdep: Mark local_lock_t") added yet another lockdep_init_map_*() variant, but forgot to update all the existing users of the most complicated version.
This could lead to a loss of lock_type and hence an incorrect report. Given the relative rarity of both local_lock and these annotations, this is unlikely to happen in practise, still, best fix things.
--- include/linux/lockdep.h | 30 +++++++++++++++++------------- kernel/locking/lockdep.c | 7 ++++--- 2 files changed, 21 insertions(+), 16 deletions(-)
include/linux/lockdep.h +17 -13
@@ -188,7 +188,7 @@ static inline void lockdep_init_map_waits(struct lockdep_map *lock, const char *name, struct lock_class_key *key, int subclass, u8 inner, u8 outer) { -lockdep_init_map_type (lock, name, key, subclass, inner, LD_WAIT_INV, LD_LOCK_NORMAL); +lockdep_init_map_type (lock, name, key, subclass, inner, outer, LD_LOCK_NORMAL); } static inline void
@@ -211,24 +211,28 @@ static inline void lockdep_init_map(struct lockdep_map *lock, const char *name,* or they are too narrow (they suffer from a false class-split): */ #define lockdep_set_class (lock, key) \ - lockdep_init_map_waits(&(lock)->dep_map, #key, key, 0, \ - (lock)->dep_map.wait_type_inner, \ - (lock)->dep_map.wait_type_outer) + lockdep_init_map_type(&(lock)->dep_map, #key, key, 0, \ + (lock)->dep_map.wait_type_inner, \ + (lock)->dep_map.wait_type_outer, \ + (lock)->dep_map.lock_type)#define lockdep_set_class_and_name (lock, key, name) \ - lockdep_init_map_waits(&(lock)->dep_map, name, key, 0, \ - (lock)->dep_map.wait_type_inner, \ - (lock)->dep_map.wait_type_outer) + lockdep_init_map_type(&(lock)->dep_map, name, key, 0, \ + (lock)->dep_map.wait_type_inner, \ + (lock)->dep_map.wait_type_outer, \ + (lock)->dep_map.lock_type)#define lockdep_set_class_and_subclass (lock, key, sub) \ - lockdep_init_map_waits(&(lock)->dep_map, #key, key, sub,\ - (lock)->dep_map.wait_type_inner, \ - (lock)->dep_map.wait_type_outer) + lockdep_init_map_type(&(lock)->dep_map, #key, key, sub, \ + (lock)->dep_map.wait_type_inner, \ + (lock)->dep_map.wait_type_outer, \ + (lock)->dep_map.lock_type)#define lockdep_set_subclass (lock, sub) \ - lockdep_init_map_waits(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\ - (lock)->dep_map.wait_type_inner, \ - (lock)->dep_map.wait_type_outer) + lockdep_init_map_type(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\ + (lock)->dep_map.wait_type_inner, \ + (lock)->dep_map.wait_type_outer, \ + (lock)->dep_map.lock_type)#define lockdep_set_novalidate_class (lock) \ lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock)
kernel/locking/lockdep.c +4 -3
@@ -5238,9 +5238,10 @@ __lock_set_class(struct lockdep_map *lock, const char *name,return 0 ; } -lockdep_init_map_waits (lock, name, key,0 , - lock->wait_type_inner, - lock->wait_type_outer); +lockdep_init_map_type (lock, name, key,0 , + lock->wait_type_inner, + lock->wait_type_outer, + lock->lock_type); class =register_lock_class (lock, subclass,0 ); hlock->class_idx = class - lock_classes;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 222/1157 arm64: dts: qcom: sc7180: Remove ipa_fw_mem node on trogdor
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit e60414644cf3a703e10ed4429c15263095945ffe ]
We don't use this carveout on trogdor boards, and having it defined in the sc7180 SoC file causes an overlap message to be printed at boot.
OF: reserved mem: OVERLAP DETECTED!
memory@86000000 (0x0000000086000000--0x000000008ec00000) overlaps with memory@8b700000 (0x000000008b700000--0x000000008b710000)
Delete the node in the trogdor dtsi file to fix the overlap problem and remove the error message.
--- arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +1 -0
@@ -43,6 +43,7 @@ charger-crit { */ /delete-node/ &hyp_mem; +/delete-node/ &ipa_fw_mem; /delete-node/ &xbl_mem; /delete-node/ &aop_mem; /delete-node/ &sec_apps_mem;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 223/1157 soc: fsl: guts: machine variable might be unset
In reply to Greg Kroah-HartmanFrom: Michael Walle <[email protected]>
[ Upstream commit ab3f045774f704c4e7b6a878102f4e9d4ae7bc74 ]
If both the model and the compatible properties are missing, then machine will not be set. Initialize it with NULL.
--- drivers/soc/fsl/guts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/fsl/guts.c +1 -1
@@ -140,7 +140,7 @@ static int fsl_guts_probe(struct platform_device *pdev)struct device_node *root, *np = pdev->dev.of_node;struct device *dev = &pdev->dev;const struct fsl_soc_die_attr *soc_die; -const char *machine; +const char *machine =NULL ;u32 svr;/* Initialize guts */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 224/1157 spi: s3c64xx: constify fsd_spi_port_config
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit a813c47d22b0a0c51567292bc198a39bdcdc3799 ]
All struct s3c64xx_spi_port_config should be const.
--- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-s3c64xx.c +1 -1
@@ -1413,7 +1413,7 @@ static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = { .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, }; -static struct s3c64xx_spi_port_config fsd_spi_port_config = { +static const struct s3c64xx_spi_port_config fsd_spi_port_config = { .fifo_lvl_mask = {0x7f ,0x7f ,0x7f ,0x7f ,0x7f }, .rx_lvl_offset =15 , .tx_st_done =25 ,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 225/1157 block: fix infinite loop for invalid zone append
In reply to Greg Kroah-HartmanFrom: Keith Busch <[email protected]>
[ Upstream commit b82d9fa257cb3725c49d94d2aeafc4677c34448a ]
Returning 0 early from __bio_iov_append_get_pages() for the max_append_sectors warning just creates an infinite loop since 0 means success, and the bio will never fill from the unadvancing iov_iter. We could turn the return into an error value, but it will already be turned into an error value later on, so just remove the warning. Clearly no one ever hit it anyway.
--- block/bio.c | 3 --- 1 file changed, 3 deletions(-)
block/bio.c +0 -3
@@ -1229,9 +1229,6 @@ static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter)size_t offset;int ret =0 ; -if (WARN_ON_ONCE (!max_append_sectors)) -return 0 ; -/* * Move page array up in the allocated memory for the bio vecs as far as * possible so that we can start filling biovecs from the beginning
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 226/1157 arm64: dts: qcom: sdm845-akatsuki: Round down l22a regulator voltage
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 4148a9eeb15152865d60b0913d96beb7ca166f9a ]
2700000 is not a multiple of pmic4_pldo's step size of 8000 (with base voltage 1664000), resulting in pm8998-rpmh-regulators not probing. Just as we did with MSM8998's Sony Yoshino Poplar [1], round the voltages down to err on the cautious side and leave a comment in place to document this discrepancy wrt downstream sources.
[1]: https://lore.kernel.org/linux-arm-msm/[email protected]/
--- .../arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts +3 -2
@@ -19,8 +19,9 @@ &vreg_l14a_1p8 { }; &vreg_l22a_2p8 { - regulator-min-microvolt = <2700000>; - regulator-max-microvolt = <2700000>; + /* Note: Round-down from 2700000 to be a multiple of PLDO step-size 8000 */ + regulator-min-microvolt = <2696000>; + regulator-max-microvolt = <2696000>; }; &vreg_l28a_2p8 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 227/1157 ARM: dts: qcom: mdm9615: add missing PMIC GPIO reg
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit dc590cdc31f636ea15658f1206c3e380a53fb78e ]
'reg' property is required in SSBI children:
qcom-mdm9615-wp8548-mangoh-green.dtb: gpio@150: 'reg' is a required property
--- arch/arm/boot/dts/qcom-mdm9615.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/qcom-mdm9615.dtsi +1 -0
@@ -321,6 +321,7 @@ rtc@11d { pmicgpio: gpio@150 { compatible = "qcom,pm8018-gpio", "qcom,ssbi-gpio"; + reg = <0x150>; interrupt-controller; #interrupt-cells = <2>; gpio-controller;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 228/1157 ARM: OMAP2+: Fix refcount leak in omapdss_init_of
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 9705db1eff38d6b9114121f9e253746199b759c9 ]
omapdss_find_dss_of_node() calls of_find_compatible_node() to get device node. of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() in later error path and normal path.
Message-Id: <[email protected]>
--- arch/arm/mach-omap2/display.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-omap2/display.c +2 -0
@@ -260,11 +260,13 @@ static int __init omapdss_init_of(void)if (!pdev) {pr_err ("Unable to find DSS platform device\n" ); +of_node_put (node);return -ENODEV ; } r =of_platform_populate (node,NULL ,NULL , &pdev->dev);put_device (&pdev->dev); +of_node_put (node);if (r) {pr_err ("Unable to populate DSS submodule devices\n" );return r;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 229/1157 ARM: OMAP2+: Fix refcount leak in omap3xxx_prm_late_init
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 942228fbf5d4901112178b93d41225be7c0dd9de ]
of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
Message-Id: <[email protected]>
--- arch/arm/mach-omap2/prm3xxx.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/prm3xxx.c +1 -0
@@ -708,6 +708,7 @@ static int omap3xxx_prm_late_init(void) } irq_num =of_irq_get (np,0 ); +of_node_put (np);if (irq_num == -EPROBE_DEFER )return irq_num;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 230/1157 arm64: dts: qcom: sdm630: disable GPU by default
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 1c047919763b4548381d1ab3320af1df66ab83df ]
The SoC's device tree file disables gpucc and adreno's SMMU by default. So let's disable the GPU too. Moreover it looks like SMMU might be not usable without additional patches (which means that GPU is unusable too). No board uses GPU at this moment.
--- arch/arm64/boot/dts/qcom/sdm630.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sdm630.dtsi +2 -0
@@ -1050,6 +1050,8 @@ adreno_gpu: gpu@5000000 { operating-points-v2 = <&gpu_sdm630_opp_table>; + status = "disabled"; + gpu_sdm630_opp_table: opp-table { compatible = "operating-points-v2"; opp-775000000 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 231/1157 arm64: dts: qcom: sdm630: fix the qusb2phy ref clock
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 924bbd8dd60e094344711c3526a5b308d71dc008 ]
According to the downstram DT file, the qusb2phy ref clock should be GCC_RX0_USB2_CLKREF_CLK, not GCC_RX1_USB2_CLKREF_CLK.
--- arch/arm64/boot/dts/qcom/sdm630.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm630.dtsi +1 -1
@@ -1266,7 +1266,7 @@ qusb2phy: phy@c012000 { #phy-cells = <0>; clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, - <&gcc GCC_RX1_USB2_CLKREF_CLK>; + <&gcc GCC_RX0_USB2_CLKREF_CLK>; clock-names = "cfg_ahb", "ref"; resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 232/1157 arm64: dts: qcom: sdm630: fix gpus interconnect path
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 3cd1c4f41d64a40ea6bc4575ae28e37542123d77 ]
ICC path for the GPU incorrectly states <&gnoc 1 &bimc 5>, which is a path from SLAVE_GNOC_BIMC to SLAVE_EBI. According to the downstream kernel sources, the GPU uses MASTER_OXILI here, which is equivalent to <&bimc 1 ...>.
While we are at it, use defined names instead of the numbers for this interconnect path.
--- arch/arm64/boot/dts/qcom/sdm630.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm630.dtsi +2 -1
@@ -8,6 +8,7 @@ #include <dt-bindings/clock/qcom,gpucc-sdm660.h> #include <dt-bindings/clock/qcom,mmcc-sdm660.h> #include <dt-bindings/clock/qcom,rpmcc.h> +#include <dt-bindings/interconnect/qcom,sdm660.h> #include <dt-bindings/power/qcom-rpmpd.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -1045,7 +1046,7 @@ adreno_gpu: gpu@5000000 { nvmem-cells = <&gpu_speed_bin>; nvmem-cell-names = "speed_bin"; - interconnects = <&gnoc 1 &bimc 5>; + interconnects = <&bimc MASTER_OXILI &bimc SLAVE_EBI>; interconnect-names = "gfx-mem"; operating-points-v2 = <&gpu_sdm630_opp_table>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 233/1157 arm64: dts: qcom: sdm636-sony-xperia-ganges-mermaid: correct sdc2 pinconf
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 3a04cec9cba393abfe70fc62e523f381c9baec2e ]
Fix the device tree node in the &sdc2_state_on override. The sdm630 uses 'clk' rather than 'pinconf-clk'.
--- arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts +1 -1
@@ -19,7 +19,7 @@ / { }; &sdc2_state_on { - pinconf-clk { + clk { drive-strength = <14>; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 234/1157 cpufreq: zynq: Fix refcount leak in zynq_get_revision
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit d1ff2559cef0f6f8d97fba6337b28adb10689e16 ]
of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak.
--- arch/arm/mach-zynq/common.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-zynq/common.c +1 -0
@@ -77,6 +77,7 @@ static int __init zynq_get_revision(void) } zynq_devcfg_base =of_iomap (np,0 ); +of_node_put (np);if (!zynq_devcfg_base) {pr_err ("%s: Unable to map I/O memory\n" , __func__);return -1 ;
Signature · 1 line
2.35.1