From 7a51ef74c8fbc94eb976d5b111cb5439a85e7bb5 Mon Sep 17 00:00:00 2001 From: ElectroPerf Date: Mon, 24 May 2021 16:20:55 +0200 Subject: [PATCH] [SQUASH] Revert Some Unnecessary and Junk Commits. This reverts commit 18a5f0ff73bb6936130962ea56c7364b657d4171. This reverts commit d12c5e56ee42b39a02038f49d1b93d34af9e6831. This reverts commit 389d30c6a3fe0d7175966f13155b1b1716aa6f80. This reverts commit 4b0fd8316655eb950a04683b415a48efa0b5b476. This reverts commit 5df7d630ce5551b6583ad36c2b9b0d4b1846d1b8. This reverts commit 3b8e0d05764e358901a7a14c11a4b9a69fd49dc3. This reverts commit 886fcfb3a16cbad61719b3d975b67ffd430d5442. This reverts commit fc9c562b36fc1573b21911c7bfdc87facd559287. This reverts commit 8f30b4cd071622cb72ececb0ea6358223ee14ea5. This reverts commit 407cf41071a2cc60c991f817c22ad5ac562eb421. This reverts commit 601da398d382102f86a7f25dbb49bc804b48af4f. This reverts commit 5e362f4062cbb2139d2b3b8ca7fe642038ba6598. This reverts commit 76581a428fcaf316f2ab40a57b5024f01eb62530. This reverts commit 8aa5a5546c096633830911c4039c5e7ccc1c57ee. This reverts commit b9dc3aeefde30f52ffeee37f9e1fe961b381f1ac. This reverts commit ad944bbbda64c84387dba979b1817467c6fbf4e7. Signed-off-by: ElectroPerf --- arch/arm/boot/dts/qcom/sdm660.dtsi | 16 +++---- drivers/char/adsprpc.c | 1 - drivers/gpu/msm/adreno.c | 1 - drivers/misc/fastchg.c | 54 ++++++++++++++--------- drivers/power/supply/qcom/smb-lib.c | 18 ++------ drivers/slimbus/slim-msm-ctrl.c | 6 +-- drivers/soc/qcom/icnss.c | 1 - drivers/staging/android/ion/msm/msm_ion.c | 1 - drivers/thermal/lmh_interface.c | 4 +- drivers/video/fbdev/msm/mdss_dp.c | 4 +- fs/proc/cmdline.c | 47 +------------------- include/linux/slimbus/slimbus.h | 11 ----- kernel/sched/fair.c | 6 +-- net/netfilter/xt_qtaguid.c | 19 +++++--- 14 files changed, 67 insertions(+), 122 deletions(-) diff --git a/arch/arm/boot/dts/qcom/sdm660.dtsi b/arch/arm/boot/dts/qcom/sdm660.dtsi index 56895639ea05..4141b283102d 100644 --- a/arch/arm/boot/dts/qcom/sdm660.dtsi +++ b/arch/arm/boot/dts/qcom/sdm660.dtsi @@ -48,7 +48,7 @@ CPU0: cpu@0 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x0>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile0>; @@ -78,7 +78,7 @@ CPU1: cpu@1 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x1>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile0>; @@ -102,7 +102,7 @@ CPU2: cpu@2 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x2>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile0>; @@ -126,7 +126,7 @@ CPU3: cpu@3 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x3>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile0>; @@ -150,7 +150,7 @@ CPU4: cpu@100 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x100>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile1>; @@ -178,7 +178,7 @@ CPU5: cpu@101 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x101>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile2>; @@ -202,7 +202,7 @@ CPU6: cpu@102 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x102>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile3>; @@ -226,7 +226,7 @@ CPU7: cpu@103 { device_type = "cpu"; - compatible = "arm,kryo"; + compatible = "arm,armv8"; reg = <0x0 0x103>; enable-method = "psci"; qcom,limits-info = <&mitigation_profile4>; diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index f2375abc0a1c..f427be48cfdf 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -3653,7 +3653,6 @@ static struct platform_driver fastrpc_driver = { .name = "fastrpc", .owner = THIS_MODULE, .of_match_table = fastrpc_match_table, - .probe_type = PROBE_FORCE_SYNCHRONOUS, }, }; diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c index 1c09d542a113..427e3f15c865 100644 --- a/drivers/gpu/msm/adreno.c +++ b/drivers/gpu/msm/adreno.c @@ -2877,7 +2877,6 @@ static struct platform_driver adreno_platform_driver = { .name = DEVICE_3D_NAME, .pm = &kgsl_pm_ops, .of_match_table = adreno_match_table, - .probe_type = PROBE_PREFER_ASYNCHRONOUS, } }; diff --git a/drivers/misc/fastchg.c b/drivers/misc/fastchg.c index bde79ef07b3d..c69aeb24d5f7 100644 --- a/drivers/misc/fastchg.c +++ b/drivers/misc/fastchg.c @@ -1,8 +1,7 @@ /* * Author: Chad Froebel * - * Ported by: engstk - * Refactored by: Edrick Vince Sinsuan + * Port to cheeseburger: engstk * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -12,6 +11,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. + * */ /* @@ -21,19 +21,23 @@ * 1 - Force faster charge */ -#include - +#include +#include #include +#include +#include int force_fast_charge = 1; static int __init get_fastcharge_opt(char *ffc) { - if (!strcmp(ffc, "1")) + if (strcmp(ffc, "0") == 0) { + force_fast_charge = 0; + } else if (strcmp(ffc, "1") == 0) { force_fast_charge = 1; - else + } else { force_fast_charge = 0; - + } return 1; } @@ -48,43 +52,49 @@ static ssize_t force_fast_charge_show(struct kobject *kobj, struct kobj_attribut static ssize_t force_fast_charge_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { - int temp; - sscanf(buf, "%d ", &temp); - force_fast_charge = (temp != 1) ? 0 : 1; + sscanf(buf, "%d ", &force_fast_charge); + if (force_fast_charge < 0 || force_fast_charge > 1) + force_fast_charge = 0; + return count; } static struct kobj_attribute force_fast_charge_attribute = - __ATTR(force_fast_charge, 0664, force_fast_charge_show, force_fast_charge_store); +__ATTR(force_fast_charge, 0664, force_fast_charge_show, force_fast_charge_store); static struct attribute *force_fast_charge_attrs[] = { - &force_fast_charge_attribute.attr, - NULL +&force_fast_charge_attribute.attr, +NULL, }; static struct attribute_group force_fast_charge_attr_group = { - .attrs = force_fast_charge_attrs +.attrs = force_fast_charge_attrs, }; /* Initialize fast charge sysfs folder */ static struct kobject *force_fast_charge_kobj; -static int force_fast_charge_init(void) +int force_fast_charge_init(void) { - int ret = 0; + int force_fast_charge_retval; force_fast_charge_kobj = kobject_create_and_add("fast_charge", kernel_kobj); - if (!force_fast_charge_kobj) - return -ENOMEM; + if (!force_fast_charge_kobj) { + return -ENOMEM; + } + + force_fast_charge_retval = sysfs_create_group(force_fast_charge_kobj, &force_fast_charge_attr_group); + + if (force_fast_charge_retval) + kobject_put(force_fast_charge_kobj); - ret = sysfs_create_group(force_fast_charge_kobj, &force_fast_charge_attr_group); - if (ret) + if (force_fast_charge_retval) kobject_put(force_fast_charge_kobj); - return ret; + return (force_fast_charge_retval); } -static void force_fast_charge_exit(void) +void force_fast_charge_exit(void) { kobject_put(force_fast_charge_kobj); } diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c index 2b13255cf3f6..9dbc3561b186 100644 --- a/drivers/power/supply/qcom/smb-lib.c +++ b/drivers/power/supply/qcom/smb-lib.c @@ -955,15 +955,9 @@ static int set_sdp_current(struct smb_charger *chg, int icl_ua) const struct apsd_result *apsd_result = smblib_get_apsd_result(chg); #ifdef CONFIG_FORCE_FAST_CHARGE - if (force_fast_charge) { - /* - * Apply properly forced fast charge according to USB version, - * do not set higher than supported mA. - */ - if (icl_ua == USBIN_100MA) - icl_ua = USBIN_500MA; - else if (icl_ua == USBIN_150MA) - icl_ua = USBIN_900MA; + if (force_fast_charge > 0 && icl_ua == USBIN_500MA) + { + icl_ua = USBIN_900MA; } #endif @@ -1027,12 +1021,6 @@ static int get_sdp_current(struct smb_charger *chg, int *icl_ua) return rc; } - #ifdef CONFIG_FORCE_FAST_CHARGE - /* Always set higher mA if force_fast_charge */ - if (force_fast_charge) - icl_options |= USB51_MODE_BIT; - #endif - usb3 = (icl_options & CFG_USB3P0_SEL_BIT); if (icl_options & USB51_MODE_BIT) diff --git a/drivers/slimbus/slim-msm-ctrl.c b/drivers/slimbus/slim-msm-ctrl.c index a446b9fb8a2f..f41756c11edf 100644 --- a/drivers/slimbus/slim-msm-ctrl.c +++ b/drivers/slimbus/slim-msm-ctrl.c @@ -92,8 +92,8 @@ enum mgr_intr { enum frm_cfg { FRM_ACTIVE = 1, - CLK_GEAR = 11, - ROOT_FREQ = 31, + CLK_GEAR = 7, + ROOT_FREQ = 11, REF_CLK_GEAR = 15, INTR_WAKE = 19, }; @@ -207,7 +207,7 @@ static irqreturn_t msm_slim_interrupt(int irq, void *d) * signalling completion/exiting ISR */ mb(); - msm_slim_manage_tx_msgq(dev, false, NULL, 0); + msm_slim_manage_tx_msgq(dev, false, NULL); } if (stat & MGR_INT_RX_MSG_RCVD) { u32 rx_buf[10]; diff --git a/drivers/soc/qcom/icnss.c b/drivers/soc/qcom/icnss.c index a0ec4b13c81f..45da4ad361c5 100644 --- a/drivers/soc/qcom/icnss.c +++ b/drivers/soc/qcom/icnss.c @@ -5022,7 +5022,6 @@ static struct platform_driver icnss_driver = { .pm = &icnss_pm_ops, .owner = THIS_MODULE, .of_match_table = icnss_dt_match, - .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, }; diff --git a/drivers/staging/android/ion/msm/msm_ion.c b/drivers/staging/android/ion/msm/msm_ion.c index 0154a9d94a7d..1a3aca407c9e 100644 --- a/drivers/staging/android/ion/msm/msm_ion.c +++ b/drivers/staging/android/ion/msm/msm_ion.c @@ -1165,7 +1165,6 @@ static struct platform_driver msm_ion_driver = { .driver = { .name = "ion-msm", .of_match_table = msm_ion_match_table, - .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, }; diff --git a/drivers/thermal/lmh_interface.c b/drivers/thermal/lmh_interface.c index 2cc44553d629..a5858ec23d0c 100644 --- a/drivers/thermal/lmh_interface.c +++ b/drivers/thermal/lmh_interface.c @@ -107,7 +107,7 @@ static LIST_HEAD(lmh_device_list); _data, _ops); \ if (IS_ERR(_node)) { \ _ret = PTR_ERR(_node); \ - pr_debug("Error creating debugfs file:%s. err:%d\n", \ + pr_err("Error creating debugfs file:%s. err:%d\n", \ _name, _ret); \ } \ } while (0) @@ -117,7 +117,7 @@ static LIST_HEAD(lmh_device_list); _node = debugfs_create_dir(_name, _parent); \ if (IS_ERR(_node)) { \ _ret = PTR_ERR(_node); \ - pr_debug("Error creating debugfs dir:%s. err:%d\n", \ + pr_err("Error creating debugfs dir:%s. err:%d\n", \ _name, _ret); \ } \ } while (0) diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c index 20e5666e1627..83f26c9c11b1 100644 --- a/drivers/video/fbdev/msm/mdss_dp.c +++ b/drivers/video/fbdev/msm/mdss_dp.c @@ -4342,7 +4342,7 @@ static int __maybe_unused mdss_dp_usbpd_setup(struct mdss_dp_drv_pdata *dp_drv) pd_phandle); if (IS_ERR(dp_drv->pd)) { - pr_debug("get_usbpd phandle failed (%ld)\n", + pr_err("get_usbpd phandle failed (%ld)\n", PTR_ERR(dp_drv->pd)); return PTR_ERR(dp_drv->pd); } @@ -4416,7 +4416,7 @@ static int mdss_dp_probe(struct platform_device *pdev) #ifndef CONFIG_MACH_ASUS_X00T if (mdss_dp_usbpd_setup(dp_drv)) { - pr_debug("Error usbpd setup!\n"); + pr_err("Error usbpd setup!\n"); devm_kfree(&pdev->dev, dp_drv); dp_drv = NULL; return -EPROBE_DEFER; diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c index e6d69dbc729e..cbd82dff7e81 100644 --- a/fs/proc/cmdline.c +++ b/fs/proc/cmdline.c @@ -2,13 +2,10 @@ #include #include #include -#include - -static char new_command_line[COMMAND_LINE_SIZE]; static int cmdline_proc_show(struct seq_file *m, void *v) { - seq_printf(m, "%s\n", new_command_line); + seq_printf(m, "%s\n", saved_command_line); return 0; } @@ -24,50 +21,8 @@ static const struct file_operations cmdline_proc_fops = { .release = single_release, }; -static void patch_flag(char *cmd, const char *flag, const char *val) -{ - size_t flag_len, val_len; - char *start, *end; - - start = strstr(cmd, flag); - if (!start) - return; - - flag_len = strlen(flag); - val_len = strlen(val); - end = start + flag_len + strcspn(start + flag_len, " "); - memmove(start + flag_len + val_len, end, strlen(end) + 1); - memcpy(start + flag_len, val, val_len); -} - -static void patch_safetynet_flags(char *cmd) -{ - patch_flag(cmd, "androidboot.flash.locked=", "1"); - patch_flag(cmd, "androidboot.verifiedbootstate=", "green"); - patch_flag(cmd, "androidboot.veritymode=", "enforcing"); - patch_flag(cmd, "androidboot.vbmeta.device_state=", "locked"); -} - -static bool in_recovery; - -static int __init boot_mode_setup(char *value) -{ - in_recovery = !strcmp(value, "recovery"); - return 1; -} -__setup("androidboot.mode=", boot_mode_setup); - static int __init proc_cmdline_init(void) { - strcpy(new_command_line, saved_command_line); - - /* - * Patch various flags from command line seen by userspace in order to - * pass SafetyNet checks. - */ - if (!in_recovery) - patch_safetynet_flags(new_command_line); - proc_create("cmdline", 0, NULL, &cmdline_proc_fops); return 0; } diff --git a/include/linux/slimbus/slimbus.h b/include/linux/slimbus/slimbus.h index 4ec06be0bd10..05fb62e45b52 100644 --- a/include/linux/slimbus/slimbus.h +++ b/include/linux/slimbus/slimbus.h @@ -335,17 +335,6 @@ enum slim_ch_rate { SLIM_RATE_1HZ, SLIM_RATE_4000HZ, SLIM_RATE_11025HZ, - SLIM_RATE_12000HZ, - SLIM_RATE_16000HZ, - SLIM_RATE_22050HZ, - SLIM_RATE_24000HZ, - SLIM_RATE_32000HZ, - SLIM_RATE_44100HZ, - SLIM_RATE_48000HZ, - SLIM_RATE_64000HZ, - SLIM_RATE_88200HZ, - SLIM_RATE_96000HZ, - SLIM_RATE_128000HZ, }; /* diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 897253eca767..b215223f3404 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2283,8 +2283,7 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags) int local = !!(flags & TNF_FAULT_LOCAL); int priv; - if (!IS_ENABLED(CONFIG_NUMA_BALANCING) || - !static_branch_likely(&sched_numa_balancing)) + if (!static_branch_likely(&sched_numa_balancing)) return; /* for example, ksmd faulting in a user's mm */ @@ -11680,8 +11679,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) entity_tick(cfs_rq, se, queued); } - if (IS_ENABLED(CONFIG_NUMA_BALANCING) && - static_branch_unlikely(&sched_numa_balancing)) + if (static_branch_unlikely(&sched_numa_balancing)) task_tick_numa(rq, curr); #ifdef CONFIG_SMP diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c index 9b7a11a55d4e..604f812c5e25 100644 --- a/net/netfilter/xt_qtaguid.c +++ b/net/netfilter/xt_qtaguid.c @@ -1067,6 +1067,18 @@ static struct sock_tag *get_sock_stat_nl(const struct sock *sk) return sock_tag_tree_search(&sock_tag_tree, sk); } +static struct sock_tag *get_sock_stat(const struct sock *sk) +{ + struct sock_tag *sock_tag_entry; + MT_DEBUG("qtaguid: get_sock_stat(sk=%p)\n", sk); + if (!sk) + return NULL; + spin_lock_bh(&sock_tag_list_lock); + sock_tag_entry = get_sock_stat_nl(sk); + spin_unlock_bh(&sock_tag_list_lock); + return sock_tag_entry; +} + static int ipx_proto(const struct sk_buff *skb, struct xt_action_param *par) { @@ -1298,15 +1310,12 @@ static void if_tag_stat_update(const char *ifname, uid_t uid, * Look for a tagged sock. * It will have an acct_uid. */ - spin_lock_bh(&sock_tag_list_lock); - sock_tag_entry = sk ? get_sock_stat_nl(sk) : NULL; + sock_tag_entry = get_sock_stat(sk); if (sock_tag_entry) { tag = sock_tag_entry->tag; acct_tag = get_atag_from_tag(tag); uid_tag = get_utag_from_tag(tag); - } - spin_unlock_bh(&sock_tag_list_lock); - if (!sock_tag_entry) { + } else { acct_tag = make_atag_from_value(0); tag = combine_atag_with_uid(acct_tag, uid); uid_tag = make_tag_from_uid(uid);