Skip to content

Commit

Permalink
Synchronize code for OnePlus CPH2581_14.0.0.502(EX01)
Browse files Browse the repository at this point in the history
Based on QCOM release TAG:AU_LINUX_KERNEL.PLATFORM.3.0.R1.00.00.00.017.045
  • Loading branch information
pswbuild committed Mar 13, 2024
1 parent 1135713 commit 8af6e7b
Show file tree
Hide file tree
Showing 31 changed files with 3,138 additions and 1,862 deletions.
4,608 changes: 2,914 additions & 1,694 deletions android/abi_gki_aarch64.stg

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions android/abi_gki_aarch64_oplus
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
__traceiter_android_vh_futex_wake_up_q_finish
__traceiter_android_vh_record_mutex_lock_starttime
__traceiter_android_vh_record_pcpu_rwsem_starttime
__traceiter_android_vh_percpu_rwsem_wq_add
__traceiter_android_vh_record_rtmutex_lock_starttime
__traceiter_android_vh_record_rwsem_lock_starttime
__traceiter_android_vh_alter_mutex_list_add
Expand Down Expand Up @@ -161,6 +162,11 @@
__traceiter_task_rename
__traceiter_android_vh_tune_swappiness
__traceiter_android_vh_test_clear_look_around_ref
__traceiter_android_vh_alloc_oem_binder_struct
__traceiter_android_vh_binder_transaction_received
__traceiter_android_vh_free_oem_binder_struct
__traceiter_android_vh_binder_special_task
__traceiter_android_vh_binder_free_buf
__tracepoint_android_rvh_post_init_entity_util_avg
__tracepoint_android_rvh_rtmutex_force_update
__tracepoint_android_vh_account_process_tick_gran
Expand Down Expand Up @@ -209,6 +215,7 @@
__tracepoint_android_vh_mutex_unlock_slowpath
__tracepoint_android_vh_record_mutex_lock_starttime
__tracepoint_android_vh_record_pcpu_rwsem_starttime
__tracepoint_android_vh_percpu_rwsem_wq_add
__tracepoint_android_vh_record_rtmutex_lock_starttime
__tracepoint_android_vh_record_rwsem_lock_starttime
__tracepoint_android_vh_rtmutex_waiter_prio
Expand Down Expand Up @@ -238,6 +245,11 @@
__tracepoint_sched_waking
__tracepoint_task_rename
__trace_puts
__tracepoint_android_vh_alloc_oem_binder_struct
__tracepoint_android_vh_binder_transaction_received
__tracepoint_android_vh_free_oem_binder_struct
__tracepoint_android_vh_binder_special_task
__tracepoint_android_vh_binder_free_buf
try_to_free_mem_cgroup_pages
typec_mux_get_drvdata
unregister_memory_notifier
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/configs/vendor/pineapple_GKI.config
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ CONFIG_POWER_RESET_QCOM_PON=m
CONFIG_POWER_RESET_QCOM_REBOOT_REASON=m
CONFIG_PWM_QTI_LPG=m
CONFIG_QCOM_ADSP_SLEEPMON=m
CONFIG_OPLUS_SUBSYS_SLEEP_MONITOR=m
CONFIG_QCOM_AOSS_QMP=m
CONFIG_QCOM_BALANCE_ANON_FILE_RECLAIM=y
CONFIG_QCOM_BAM_DMA=m
Expand Down Expand Up @@ -452,6 +453,7 @@ CONFIG_OPLUS_FEATURE_FEEDBACK=m
CONFIG_INPUT_QPNP_POWER_ON=m

CONFIG_LOCKING_PROTECT=y
CONFIG_PCPU_RWSEM_LOCKING_PROTECT=y

# CONFIG_ZRAM=y
# CONFIG_ZSMALLOC=y
Expand Down
4 changes: 2 additions & 2 deletions build_with_bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import subprocess

HOST_TARGETS = ["dtc"]
DEFAULT_SKIP_LIST = ["abi"]
DEFAULT_SKIP_LIST = ["abi", "abl"]
MSM_EXTENSIONS = "build/msm_kernel_extensions.bzl"
ABL_EXTENSIONS = "build/abl_extensions.bzl"
DEFAULT_MSM_EXTENSIONS_SRC = "../msm-kernel/msm_kernel_extensions.bzl"
Expand Down Expand Up @@ -335,7 +335,7 @@ def main():
parser.add_argument(
"--log",
metavar="LEVEL",
default="info",
default="debug",
choices=["debug", "info", "warning", "error"],
help="Log level (debug, info, warning, error)",
)
Expand Down
23 changes: 19 additions & 4 deletions drivers/android/binder.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,7 @@ static void binder_free_transaction(struct binder_transaction *t)
{
struct binder_proc *target_proc = t->to_proc;

trace_android_vh_free_oem_binder_struct(t);
if (target_proc) {
binder_inner_proc_lock(target_proc);
target_proc->outstanding_txns--;
Expand Down Expand Up @@ -2945,6 +2946,7 @@ static int binder_proc_transaction(struct binder_transaction *t,
bool pending_async = false;
struct binder_transaction *t_outdated = NULL;
bool skip = false;
bool enqueue_task = true;

BUG_ON(!node);
binder_node_lock(node);
Expand Down Expand Up @@ -2984,7 +2986,10 @@ static int binder_proc_transaction(struct binder_transaction *t,
binder_transaction_priority(thread, t, node);
binder_enqueue_thread_work_ilocked(thread, &t->work);
} else if (!pending_async) {
binder_enqueue_work_ilocked(&t->work, &proc->todo);
trace_android_vh_binder_special_task(t, proc, thread,
&t->work, &proc->todo, !oneway, &enqueue_task);
if (enqueue_task)
binder_enqueue_work_ilocked(&t->work, &proc->todo);
} else {
if ((t->flags & TF_UPDATE_TXN) && proc->is_frozen) {
t_outdated = binder_find_outdated_transaction_ilocked(t,
Expand All @@ -2997,7 +3002,10 @@ static int binder_proc_transaction(struct binder_transaction *t,
proc->outstanding_txns--;
}
}
binder_enqueue_work_ilocked(&t->work, &node->async_todo);
trace_android_vh_binder_special_task(t, proc, thread,
&t->work, &node->async_todo, !oneway, &enqueue_task);
if (enqueue_task)
binder_enqueue_work_ilocked(&t->work, &node->async_todo);
}

trace_android_vh_binder_proc_transaction_finish(proc, t,
Expand Down Expand Up @@ -3474,6 +3482,7 @@ static void binder_transaction(struct binder_proc *proc,
t->buffer->target_node = target_node;
t->buffer->clear_on_free = !!(t->flags & TF_CLEAR_BUF);
trace_binder_transaction_alloc_buf(t->buffer);
trace_android_vh_alloc_oem_binder_struct(tr, t, target_proc);

if (binder_alloc_copy_user_to_buffer(
&target_proc->alloc,
Expand Down Expand Up @@ -3978,6 +3987,9 @@ binder_free_buf(struct binder_proc *proc,
struct binder_thread *thread,
struct binder_buffer *buffer, bool is_failure)
{
bool enqueue_task = true;

trace_android_vh_binder_free_buf(proc, thread, buffer);
binder_inner_proc_lock(proc);
if (buffer->transaction) {
buffer->transaction->buffer = NULL;
Expand All @@ -3997,8 +4009,10 @@ binder_free_buf(struct binder_proc *proc,
if (!w) {
buf_node->has_async_transaction = false;
} else {
binder_enqueue_work_ilocked(
w, &proc->todo);
trace_android_vh_binder_special_task(NULL, proc, thread, w,
&proc->todo, false, &enqueue_task);
if (enqueue_task)
binder_enqueue_work_ilocked(w, &proc->todo);
binder_wakeup_proc_ilocked(proc);
}
binder_node_inner_unlock(buf_node);
Expand Down Expand Up @@ -4940,6 +4954,7 @@ static int binder_thread_read(struct binder_proc *proc,
ptr += trsize;

trace_binder_transaction_received(t);
trace_android_vh_binder_transaction_received(t, proc, thread, cmd);
binder_stat_br(proc, thread, cmd);
binder_debug(BINDER_DEBUG_TRANSACTION,
"%d:%d %s %d %d:%d, cmd %u size %zd-%zd ptr %016llx-%016llx\n",
Expand Down
6 changes: 6 additions & 0 deletions drivers/android/vendor_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_mutex_lock_starttime);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rtmutex_lock_starttime);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_lock_starttime);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_pcpu_rwsem_starttime);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_percpu_rwsem_wq_add);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_module_core_rw_nx);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_module_init_rw_nx);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_module_permit_before_init);
Expand Down Expand Up @@ -325,3 +326,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_look_around);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_look_around_migrate_folio);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_test_clear_look_around_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_scan_type);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_oem_binder_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_received);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_oem_binder_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_special_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_free_buf);
2 changes: 1 addition & 1 deletion drivers/clk/qcom/clk-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ static int suspend_enabled_clocks_show(struct seq_file *s, void *unused)

struct suspend_enabled_clk *suspend_clk;
list_for_each_entry(suspend_clk, &suspend_clk_list, list) {
seq_printf(s, "%s: [%ld]\n", suspend_clk->clk_name, suspend_clk->clk_rate);
seq_printf(s, "%s: [%u]\n", suspend_clk->clk_name, suspend_clk->clk_rate);
}

return 0;
Expand Down
2 changes: 2 additions & 0 deletions drivers/input/misc/qcom-hv-haptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -5756,6 +5756,8 @@ static long richtap_file_unlocked_ioctl(struct file *file, unsigned int cmd, uns
dev_err(chip->dev, "aac RichTap get f0 error, ret=%d\n", ret);
break;
}
tmp = tmp * 10;
dev_err(chip->dev, "aac RichTap get f0 %d\n", tmp);
if (copy_to_user((void __user *)arg, &tmp, sizeof(uint32_t)))
ret = -EFAULT;
break;
Expand Down
28 changes: 28 additions & 0 deletions drivers/pinctrl/qcom/pinctrl-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,32 @@ int msm_qup_read(unsigned int mode)
}
EXPORT_SYMBOL(msm_qup_read);

static void msm_gpio_wakeup_init(struct msm_pinctrl *pctrl)
{
struct device_node *gpio_wakeup;
uint32_t gpio_num = 0, i = 0;
uint32_t * gpio_table;
gpio_wakeup = of_find_compatible_node(pctrl->dev->of_node, NULL, "gpio_wakeup");
if (!gpio_wakeup) {
pr_err("Disable wakeup gpip function not confing\n");
return;
}
gpio_num = of_property_count_elems_of_size(gpio_wakeup, "gpio_table", sizeof(uint32_t));
if (gpio_num == -EINVAL){
pr_err("Have no wakeup gpio disable\n");
return;
}

gpio_table = (uint32_t *)kzalloc(sizeof(uint32_t)*gpio_num, GFP_KERNEL);
of_property_read_u32_array(gpio_wakeup, "gpio_table", gpio_table, gpio_num);

for(i=0; i<gpio_num; i++){
msm_gpio_mpm_wake_set(gpio_table[i], false);
pr_info("The wakeup function of GPIO_%d has been disabled!",gpio_table[i]);
}

}

int msm_spare_write(int spare_reg, u32 val)
{
u32 offset;
Expand Down Expand Up @@ -2072,6 +2098,8 @@ int msm_pinctrl_probe(struct platform_device *pdev,
if (ret)
return ret;

msm_gpio_wakeup_init(pctrl);

dev_dbg(&pdev->dev, "Probed Qualcomm pinctrl driver\n");

return 0;
Expand Down
6 changes: 4 additions & 2 deletions drivers/regulator/debug-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,10 @@ static void regulator_debug_print_enabled(struct regulator_dev *rdev)
suspend_consumer->max_uV = reg->voltage[PM_SUSPEND_ON].max_uV;
suspend_consumer->uA_load = reg->uA_load;

list_add(&suspend_consumer->list, &suspend_reg->enabled_consumer_list);
suspend_consumer_cnt++;
if(suspend_reg) {
list_add(&suspend_consumer->list, &suspend_reg->enabled_consumer_list);
suspend_consumer_cnt++;
}
}
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions drivers/soc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ source "drivers/soc/oplus/dft/Kconfig"

source "drivers/soc/oplus/storage/Kconfig"

#ifdef OPLUS_SUBSYS_SLEEP_MONITOR
source "drivers/soc/oplus/power/subsys_sleep_monitor/Kconfig"
#endif /* OPLUS_SUBSYS_SLEEP_MONITOR */
4 changes: 4 additions & 0 deletions drivers/soc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ obj-$(CONFIG_OPLUS_FEATURE_QCOM_WATCHDOG) += oplus/boot/qcom_watchdog/
obj-y += oplus/dft/

obj-y += oplus/storage/

#ifdef OPLUS_SUBSYS_SLEEP_MONITOR
obj-$(CONFIG_OPLUS_SUBSYS_SLEEP_MONITOR) += oplus/power/subsys_sleep_monitor/
#endif /* OPLUS_SUBSYS_SLEEP_MONITOR */
16 changes: 16 additions & 0 deletions drivers/usb/dwc3/dwc3-msm-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5065,6 +5065,10 @@ static int dwc3_msm_set_role(struct dwc3_msm *mdwc, enum usb_role role)

dbg_log_string("cur_role:%s new_role:%s refcnt:%d\n", dwc3_msm_usb_role_string(cur_role),
dwc3_msm_usb_role_string(role), mdwc->refcnt_dp_usb);
#ifdef OPLUS_FEATURE_CHG_BASIC
dev_err(mdwc->dev, "cur_role:%s new_role:%s refcnt:%d\n", dwc3_msm_usb_role_string(cur_role),
dwc3_msm_usb_role_string(role), mdwc->refcnt_dp_usb);
#endif

/*
* For boot up without USB cable connected case, don't check
Expand Down Expand Up @@ -6714,6 +6718,10 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
u32 val;
#endif

#ifdef OPLUS_FEATURE_CHG_BASIC
dev_err(mdwc->dev, "%s: turn %s host\n", __func__, on ? "on" : "off");
#endif

if (on) {
dev_dbg(mdwc->dev, "%s: turn on host\n", __func__);
mdwc->hs_phy->flags |= PHY_HOST_MODE;
Expand Down Expand Up @@ -6914,6 +6922,10 @@ static int dwc3_otg_start_peripheral(struct dwc3_msm *mdwc, int on)
dbg_event(0xFF, "StrtGdgt gsync",
atomic_read(&mdwc->dev->power.usage_count));

#ifdef OPLUS_FEATURE_CHG_BASIC
dev_err(mdwc->dev, "%s: turn %s gadget\n", __func__, on ? "on" : "off");
#endif

if (on) {
dev_dbg(mdwc->dev, "%s: turn on gadget\n", __func__);

Expand Down Expand Up @@ -7034,7 +7046,11 @@ static void dwc3_otg_sm_work(struct work_struct *w)
}

state = dwc3_drd_state_string(mdwc->drd_state);
#ifndef OPLUS_FEATURE_CHG_BASIC
dev_dbg(mdwc->dev, "%s state\n", state);
#else
dev_err(mdwc->dev, "%s state\n", state);
#endif
dbg_event(0xFF, state, 0);

/* Check OTG state */
Expand Down
11 changes: 8 additions & 3 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3929,16 +3929,21 @@ static inline char chp_loglvl_to_char(int l)
chp_log(CHP_LOG_INFO, f, ##__VA_ARGS__)

#define CHP_BUG_ON(condition) do { \
if (unlikely(config_bug_on && condition)) BUG(); \
if (unlikely(config_bug_on && condition)) { \
BUG(); \
} else if (condition) { \
pr_err("[CHP_WARN_ON]%s:%d tgid:%d pid:%d comm:%s\n", \
__func__, __LINE__, current->tgid, \
current->pid, current->comm); \
WARN_ON(1); \
} \
} while (0)

#define CHP_BUG_ON_EMERGENCY(condition) do { \
if (unlikely(condition)) BUG(); \
} while (0)
/**************************************/

#define UNALIGNED_CONT_PTE_WARN WARN_ON

enum hpage_type {
HPAGE_POOL_CMA,
HPAGE_POOL_BUDDY,
Expand Down
2 changes: 1 addition & 1 deletion include/linux/soc/qcom/panel_event_notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum panel_event_notifier_client {
PANEL_EVENT_NOTIFIER_CLIENT_PRIMARY_THEIA_BRIGHT,
//#endif
PANEL_EVENT_NOTIFIER_CLIENT_MM,

PANEL_EVENT_NOTIFIER_CLIENT_TRI_STATE_KEY,
PANEL_EVENT_NOTIFIER_CLIENT_MAX
};

Expand Down
24 changes: 24 additions & 0 deletions include/trace/hooks/binder.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
* mechanism for vendor modules to hook and extend functionality
*/
struct binder_transaction;
struct binder_transaction_data;
struct task_struct;
struct binder_work;
struct binder_buffer;

DECLARE_HOOK(android_vh_binder_transaction_init,
TP_PROTO(struct binder_transaction *t),
TP_ARGS(t));
Expand Down Expand Up @@ -93,6 +97,26 @@ DECLARE_HOOK(android_vh_binder_new_ref,
DECLARE_HOOK(android_vh_binder_del_ref,
TP_PROTO(struct task_struct *proc, uint32_t ref_desc),
TP_ARGS(proc, ref_desc));
DECLARE_HOOK(android_vh_alloc_oem_binder_struct,
TP_PROTO(struct binder_transaction_data *tr, struct binder_transaction *t,
struct binder_proc *proc),
TP_ARGS(tr, t, proc));
DECLARE_HOOK(android_vh_binder_transaction_received,
TP_PROTO(struct binder_transaction *t, struct binder_proc *proc,
struct binder_thread *thread, uint32_t cmd),
TP_ARGS(t, proc, thread, cmd));
DECLARE_HOOK(android_vh_free_oem_binder_struct,
TP_PROTO(struct binder_transaction *t),
TP_ARGS(t));
DECLARE_HOOK(android_vh_binder_special_task,
TP_PROTO(struct binder_transaction *t, struct binder_proc *proc,
struct binder_thread *thread, struct binder_work *w,
struct list_head *head, bool sync, bool *special_task),
TP_ARGS(t, proc, thread, w, head, sync, special_task));
DECLARE_HOOK(android_vh_binder_free_buf,
TP_PROTO(struct binder_proc *proc, struct binder_thread *thread,
struct binder_buffer *buffer),
TP_ARGS(proc, thread, buffer));

#endif /* _TRACE_HOOK_BINDER_H */
/* This part must be outside protection */
Expand Down
3 changes: 3 additions & 0 deletions include/trace/hooks/dtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ DECLARE_HOOK(android_vh_record_pcpu_rwsem_starttime,
DECLARE_HOOK(android_vh_record_pcpu_rwsem_time_early,
TP_PROTO(unsigned long settime_jiffies, struct percpu_rw_semaphore *sem),
TP_ARGS(settime_jiffies, sem));
DECLARE_HOOK(android_vh_percpu_rwsem_wq_add,
TP_PROTO(struct percpu_rw_semaphore *sem, bool reader),
TP_ARGS(sem, reader));

struct mutex_waiter;
DECLARE_HOOK(android_vh_alter_mutex_list_add,
Expand Down
1 change: 1 addition & 0 deletions kernel/locking/percpu-rwsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ static void percpu_rwsem_wait(struct percpu_rw_semaphore *sem, bool reader)
if (wait) {
wq_entry.flags |= WQ_FLAG_EXCLUSIVE | reader * WQ_FLAG_CUSTOM;
__add_wait_queue_entry_tail(&sem->waiters, &wq_entry);
trace_android_vh_percpu_rwsem_wq_add(sem, reader);
}
spin_unlock_irq(&sem->waiters.lock);

Expand Down
Loading

0 comments on commit 8af6e7b

Please sign in to comment.