Skip to content

Commit

Permalink
Merge lineage-20.0 from LineageOS/android_kernel_oneplus_sm8250
Browse files Browse the repository at this point in the history
commit: 56fac1a597b2277cb05d7a80ff6b60a73a1d66b6

Signed-off-by: engstk <eng.stk@sapo.pt>
  • Loading branch information
engstk committed Jun 14, 2023
1 parent 41daba5 commit b4c56e7
Show file tree
Hide file tree
Showing 14 changed files with 1,979 additions and 1,763 deletions.
3,454 changes: 1,729 additions & 1,725 deletions android/abi_gki_aarch64.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c
Original file line number Diff line number Diff line change
Expand Up @@ -4965,7 +4965,7 @@ int wma_extscan_hotlist_match_event_handler(void *handle,
return -ENOMEM;

dest_ap = &dest_hotlist->ap[0];
dest_hotlist->numOfAps = event->total_entries;
dest_hotlist->numOfAps = numap;
dest_hotlist->requestId = event->config_request_id;

if (event->first_entry_index +
Expand Down
6 changes: 2 additions & 4 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2530,11 +2530,9 @@ static __le16 ext4_group_desc_csum(struct super_block *sb, __u32 block_group,
crc = crc16(crc, (__u8 *)gdp, offset);
offset += sizeof(gdp->bg_checksum); /* skip checksum */
/* for checksum of struct ext4_group_desc do the rest...*/
if (ext4_has_feature_64bit(sb) &&
offset < le16_to_cpu(sbi->s_es->s_desc_size))
if (ext4_has_feature_64bit(sb) && offset < sbi->s_desc_size)
crc = crc16(crc, (__u8 *)gdp + offset,
le16_to_cpu(sbi->s_es->s_desc_size) -
offset);
sbi->s_desc_size - offset);

out:
return cpu_to_le16(crc);
Expand Down
5 changes: 3 additions & 2 deletions fs/ext4/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,7 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,
.in_inode = !!entry->e_value_inum,
};
struct ext4_xattr_ibody_header *header = IHDR(inode, raw_inode);
int needs_kvfree = 0;
int error;

is = kzalloc(sizeof(struct ext4_xattr_ibody_find), GFP_NOFS);
Expand All @@ -2595,7 +2596,7 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,
error = -ENOMEM;
goto out;
}

needs_kvfree = 1;
error = ext4_xattr_inode_get(inode, entry, buffer, value_size);
if (error)
goto out;
Expand Down Expand Up @@ -2634,7 +2635,7 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,

out:
kfree(b_entry_name);
if (entry->e_value_inum && buffer)
if (needs_kvfree && buffer)
kvfree(buffer);
if (is)
brelse(is->iloc.bh);
Expand Down
10 changes: 10 additions & 0 deletions fs/incfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ static ssize_t corefs_show(struct kobject *kobj,

static struct kobj_attribute corefs_attr = __ATTR_RO(corefs);

static ssize_t bugfix_inode_eviction_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
return snprintf(buff, PAGE_SIZE, "supported\n");
}

static struct kobj_attribute bugfix_inode_eviction_attr =
__ATTR_RO(bugfix_inode_eviction);

static ssize_t mounter_context_for_backing_rw_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
Expand All @@ -41,6 +50,7 @@ static struct kobj_attribute mounter_context_for_backing_rw_attr =

static struct attribute *attributes[] = {
&corefs_attr.attr,
&bugfix_inode_eviction_attr.attr,
&mounter_context_for_backing_rw_attr.attr,
NULL,
};
Expand Down
8 changes: 7 additions & 1 deletion fs/incfs/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,13 @@ void incfs_kill_sb(struct super_block *sb)

pr_debug("incfs: unmount\n");

/*
* We must kill the super before freeing mi, since killing the super
* triggers inode eviction, which triggers the final update of the
* backing file, which uses certain information for mi
*/
kill_anon_super(sb);

if (mi) {
if (mi->mi_backing_dir_path.dentry)
dinode = d_inode(mi->mi_backing_dir_path.dentry);
Expand All @@ -2320,7 +2327,6 @@ void incfs_kill_sb(struct super_block *sb)
incfs_free_mount_info(mi);
sb->s_fs_info = NULL;
}
kill_anon_super(sb);
}

static int show_options(struct seq_file *m, struct dentry *root)
Expand Down
27 changes: 20 additions & 7 deletions include/linux/rmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ struct anon_vma {
*/
atomic_t refcount;

/*
* Count of child anon_vmas and VMAs which points to this anon_vma.
*
* This counter is used for making decision about reusing anon_vma
* instead of forking new one. See comments in function anon_vma_clone.
*/
unsigned degree;
unsigned degree; /* ANDROID: KABI preservation, DO NOT USE! */

struct anon_vma *parent; /* Parent of this anon_vma */

Expand All @@ -71,6 +65,25 @@ struct anon_vma {

/* Interval tree of private "related" vmas */
struct rb_root_cached rb_root;

/*
* ANDROID: KABI preservation, it's safe to put these at the end of this structure as it's
* only passed by a pointer everywhere, the size and internal structures are local to the
* core kernel.
*/
#ifndef __GENKSYMS__
/*
* Count of child anon_vmas. Equals to the count of all anon_vmas that
* have ->parent pointing to this one, including itself.
*
* This counter is used for making decision about reusing anon_vma
* instead of forking new one. See comments in function anon_vma_clone.
*/
unsigned long num_children;
/* Count of VMAs whose ->anon_vma pointer points to this object. */
unsigned long num_active_vmas;
#endif

};

/*
Expand Down
12 changes: 8 additions & 4 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3791,11 +3791,15 @@ static inline bool zone_watermark_fast(struct zone *z, unsigned int order,
* need to be calculated.
*/
if (!order) {
long fast_free;
long usable_free;
long reserved;

fast_free = free_pages;
fast_free -= __zone_watermark_unusable_free(z, 0, alloc_flags);
if (fast_free > mark + z->lowmem_reserve[classzone_idx])
usable_free = free_pages;
reserved = __zone_watermark_unusable_free(z, 0, alloc_flags);

/* reserved may over estimate high-atomic reserves. */
usable_free -= min(usable_free, reserved);
if (usable_free > mark + z->lowmem_reserve[classzone_idx])
return true;
}

Expand Down
32 changes: 18 additions & 14 deletions mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static inline struct anon_vma *anon_vma_alloc(void)
anon_vma = kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL);
if (anon_vma) {
atomic_set(&anon_vma->refcount, 1);
anon_vma->degree = 1; /* Reference for first vma */
anon_vma->num_children = 0;
anon_vma->num_active_vmas = 0;
anon_vma->parent = anon_vma;
/*
* Initialise the anon_vma root to point to itself. If called
Expand Down Expand Up @@ -191,6 +192,7 @@ int __anon_vma_prepare(struct vm_area_struct *vma)
anon_vma = anon_vma_alloc();
if (unlikely(!anon_vma))
goto out_enomem_free_avc;
anon_vma->num_children++; /* self-parent link for new root */
allocated = anon_vma;
}

Expand All @@ -200,8 +202,7 @@ int __anon_vma_prepare(struct vm_area_struct *vma)
if (likely(!vma->anon_vma)) {
vma->anon_vma = anon_vma;
anon_vma_chain_link(vma, avc, anon_vma);
/* vma reference or self-parent link for new root */
anon_vma->degree++;
anon_vma->num_active_vmas++;
allocated = NULL;
avc = NULL;
}
Expand Down Expand Up @@ -280,19 +281,19 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
anon_vma_chain_link(dst, avc, anon_vma);

/*
* Reuse existing anon_vma if its degree lower than two,
* that means it has no vma and only one anon_vma child.
* Reuse existing anon_vma if it has no vma and only one
* anon_vma child.
*
* Do not chose parent anon_vma, otherwise first child
* will always reuse it. Root anon_vma is never reused:
* Root anon_vma is never reused:
* it has self-parent reference and at least one child.
*/
if (!dst->anon_vma && anon_vma != src->anon_vma &&
anon_vma->degree < 2)
if (!dst->anon_vma && src->anon_vma &&
anon_vma->num_children < 2 &&
anon_vma->num_active_vmas == 0)
dst->anon_vma = anon_vma;
}
if (dst->anon_vma)
dst->anon_vma->degree++;
dst->anon_vma->num_active_vmas++;
unlock_anon_vma_root(root);
return 0;

Expand Down Expand Up @@ -419,6 +420,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
anon_vma = anon_vma_alloc();
if (!anon_vma)
goto out_error;
anon_vma->num_active_vmas++;
avc = anon_vma_chain_alloc(GFP_KERNEL);
if (!avc)
goto out_error_free_anon_vma;
Expand All @@ -439,7 +441,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
vma->anon_vma = anon_vma;
anon_vma_lock_write(anon_vma);
anon_vma_chain_link(vma, avc, anon_vma);
anon_vma->parent->degree++;
anon_vma->parent->num_children++;
anon_vma_unlock_write(anon_vma);

return 0;
Expand Down Expand Up @@ -471,15 +473,16 @@ void unlink_anon_vmas(struct vm_area_struct *vma)
* to free them outside the lock.
*/
if (RB_EMPTY_ROOT(&anon_vma->rb_root.rb_root)) {
anon_vma->parent->degree--;
anon_vma->parent->num_children--;
continue;
}

list_del(&avc->same_vma);
anon_vma_chain_free(avc);
}
if (vma->anon_vma)
vma->anon_vma->degree--;
vma->anon_vma->num_active_vmas--;

unlock_anon_vma_root(root);

/*
Expand All @@ -490,7 +493,8 @@ void unlink_anon_vmas(struct vm_area_struct *vma)
list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) {
struct anon_vma *anon_vma = avc->anon_vma;

VM_WARN_ON(anon_vma->degree);
VM_WARN_ON(anon_vma->num_children);
VM_WARN_ON(anon_vma->num_active_vmas);
put_anon_vma(anon_vma);

list_del(&avc->same_vma);
Expand Down
5 changes: 5 additions & 0 deletions techpack/audio/asoc/msm-pcm-routing-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -18022,6 +18022,10 @@ static const struct snd_kcontrol_new mmul8_mixer_controls[] = {
MSM_BACKEND_DAI_SLIMBUS_7_TX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_DOUBLE_EXT("SLIM_8_TX", SND_SOC_NOPM,
MSM_BACKEND_DAI_SLIMBUS_8_TX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_DOUBLE_EXT("USB_AUDIO_TX", SND_SOC_NOPM,
MSM_BACKEND_DAI_USB_TX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
Expand Down Expand Up @@ -26709,6 +26713,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"MultiMedia1 Mixer", "SLIM_9_TX", "SLIMBUS_9_TX"},
{"MultiMedia8 Mixer", "SLIM_6_TX", "SLIMBUS_6_TX"},
{"MultiMedia8 Mixer", "SLIM_7_TX", "SLIMBUS_7_TX"},
{"MultiMedia8 Mixer", "SLIM_8_TX", "SLIMBUS_8_TX"},
{"MultiMedia8 Mixer", "SLIM_9_TX", "SLIMBUS_9_TX"},
{"MultiMedia4 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
{"MultiMedia4 Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
Expand Down
5 changes: 0 additions & 5 deletions techpack/camera/drivers/cam_req_mgr/cam_mem_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ int cam_mem_get_cpu_buf(int32_t buf_handle, uintptr_t *vaddr_ptr, size_t *len)
return -EINVAL;
}

if (!atomic_read(&cam_mem_mgr_state)) {
CAM_ERR(CAM_MEM, "failed. mem_mgr not initialized");
return -EINVAL;
}

if (!buf_handle || !vaddr_ptr || !len)
return -EINVAL;

Expand Down
Loading

0 comments on commit b4c56e7

Please sign in to comment.