Commit Graph

1115959 Commits

Author SHA1 Message Date
Sai Harshini Nimmala
845834fca9 sched/walt: Expand rq_relock()
The rq_relock() function is removed upstream. Replace all instances of it
by expanding the function.

Change-Id: I7b99d46d552695ae0afdf75f3a6033b80376fe01
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-10-04 09:45:25 -07:00
Sai Harshini Nimmala
1c1b617dae sched/walt: Include header files
Due to reorganization of sched header files upstream, include missing
header files.

Change-Id: Iab3cda49a71b6a0f3f98194f975031716df47736
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-10-04 09:45:24 -07:00
Sai Harshini Nimmala
8d3a41589d sched/walt: Update enqueue,dequeue tracehooks
The Android Common Kernel has updated the enqueue,dequeue tracehooks.
Update the tracehooks accordingly.

Change-Id: Idb2efdb2f70288721c9100850e9cb344328a2c42
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-10-04 09:45:23 -07:00
Sai Harshini Nimmala
01fd5ff22e sched/walt: Update account_irq tracehook
The Android Common Kernel has replaced the irq accounting tracehook.
Update the tracehook accordingly.

Change-Id: I4d0d2e7a4d5a6d567ac2c1edaae4d050b1c82ac0
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-10-04 09:45:23 -07:00
Sai Harshini Nimmala
de003fc809 sched/walt: Remove topology.h header
Due to reorganization of tracehooks upstream, topology.h does not exist
anymore. Remove the associated header.

Change-Id: Ib4c7e630dfbefd6965524f91101784a57327af39
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-10-04 09:45:22 -07:00
Sai Harshini Nimmala
7c57963b7a sched/walt: Obtain task cpu from task_thread_info
struct task_struct does not contain a member to store task cpu
information anymore. Instead, use task_thread_info() to obtain that
information.

Change-Id: I8fc9ef4ebf11f6fccd6ecbe68d768ac48d2928c5
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-10-04 09:44:56 -07:00
Sai Harshini Nimmala
558622e9b9 sched/walt: Create attribute groups
struct kobj_type does not contain the default_attrs member anymore.
Instead create attribute group using the ATTRIBUTE_GROUPS macro and
assign to kobj_type object.

Change-Id: I5d21c816edb13b5020e064f55c3e495002897d4a
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-09-27 16:32:36 -07:00
Stephen Dickey
b0a014fc64 kernel/sched/walt: remove unused walt error type
Remove WALT_NONCRITICAL as it hasn't been useful.

Change-Id: Ia28005c5f980fcb598226b3aae4b21efeac1b526
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-27 16:27:20 -07:00
Stephen Dickey
902848221f kernel/sched/walt: test is walt is enabled
Pause will not be invoked through core control until after
walt has been initialized. However, the walt_pause apis are
made available to other vendor modules, and if those modules
attempt to invoke pause prior to walt being initialized, an
invalid reference to walt_drain_thread will be made.

Prevent the walt_pause and walt_resume apis from being used
until after walt has been properly initialized, walt_halt_init
has been called, and walt_drain_thread properly created.

Change-Id: Iadd764ebfb7402529b49de6ef121d23dfcdc5649
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-27 16:27:20 -07:00
Sai Harshini Nimmala
1a0cf49aa3 sched/walt: Change update_cpu_capacity tracepoint
Capture the fmax_capacity of the CPU reduced under cpufreq constraints
in the related tracepoint.

Change-Id: I3dc5c54a7a5850b9c5f4df8a40daea593fff023b
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-09-27 16:27:19 -07:00
qctecmdr
7622335450 Merge "usb: dwc3-msm: Don't allow dynamic speed change for host mode" 2022-09-27 16:06:07 -07:00
qctecmdr
f6a0cc734a Merge "usb: dwc3: dwc3-msm-core: Re-use usb_role callbacks for mode changes" 2022-09-27 16:06:07 -07:00
qctecmdr
4d36671e16 Merge "kernel/sched/walt: check migration disabled in allowed_ptr_locked" 2022-09-27 16:06:05 -07:00
qctecmdr
7b69ee398d Merge "kernel/sched/walt: validate runqueue entries" 2022-09-26 10:13:55 -07:00
qctecmdr
85e22bfdf0 Merge "arm64: configs: Enable CRM driver for pineapple_GKI" 2022-09-26 10:13:55 -07:00
qctecmdr
fe57ff9c8b Merge "coresight: funnel: add support for multiple output ports" 2022-09-26 10:13:54 -07:00
qctecmdr
0a48e814f4 Merge "defconfig: pineapple: Enable QDSS configs for pineapple" 2022-09-26 10:13:54 -07:00
qctecmdr
80f3cc0ceb Merge "soc: qcom: llcc: Further update config data for pineapple SoC" 2022-09-23 16:07:49 -07:00
qctecmdr
4ba8b56fbb Merge "soc: qcom: Rollback when failed to register new region" 2022-09-23 16:07:47 -07:00
qctecmdr
8ebce67790 Merge "soc: qcom: Decrease num_regions after remove region" 2022-09-23 16:07:47 -07:00
qctecmdr
136fde660c Merge "soc: qcom: Fix md_get_region failure when using minidump in SVM" 2022-09-23 16:07:45 -07:00
qctecmdr
052f6f4175 Merge "soc: qcom: Block register minidump region with same name" 2022-09-23 16:07:45 -07:00
qctecmdr
f337b0a0ee Merge "gunyah: secure_vm_loader: Don't release the memory when VM load fail" 2022-09-23 16:07:44 -07:00
qctecmdr
7a1b455714 Merge "gunyah: secure_vm_loader: Fix the hyp inject instruction/data abort" 2022-09-23 16:07:44 -07:00
qctecmdr
a2e0221707 Merge "soc: qcom: qcom_stats: Add ioctl support for stats" 2022-09-23 16:07:44 -07:00
qctecmdr
caf3c388c3 Merge "abi_gki_aarch64_qcom: Add msleep_interruptible" 2022-09-23 16:07:42 -07:00
qctecmdr
2cc87b66ce Merge "msm: ipa: add snapshot of IPA USB header file" 2022-09-23 14:30:17 -07:00
qctecmdr
d665060fae Merge "sched/walt: Early Detect Boost Optimizations" 2022-09-23 14:30:15 -07:00
Pavankumar Kondeti
e29db3c587 usb: dwc3: dwc3-msm-core: Re-use usb_role callbacks for mode changes
We have a legacy sysfs interface to change the USB operating mode. Since
usb_role callbacks are available for user space and UCSI, there is
really no need for mode sysfs interface. For the sake of not breaking
any existing use cases, keep the mode interface but re-use the usb_role
callbacks. The usb-role-switch is an optional property, so refactor
the role switch ops so that they can be called even when this property
is not available but mode sysfs interface can be made available. Note that
there is no visible change to the user space.

Change-Id: I3f8b03b420429375af8d29d7b2339b490980dee0
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2022-09-23 12:46:45 -07:00
Pavankumar Kondeti
ca9fb9573e usb: dwc3: dwc3-msm-core: Bail out early when there is no change in role
If the same role as the current role is requested, bail out early.

Change-Id: I42dc3f6759800926a4a98254a2ff30f932394704
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2022-09-23 12:45:01 -07:00
Pavankumar Kondeti
92a1df0fef usb: dwc3: dwc3-msm-core: Reject incompatible role/mode request
If USB controller is configured to work in a specific mode, reject
any compatible role/mode request. For example, if device mode is
only allowed, switching to host mode/role is not allowed. The current
code allows this and it results in accessing invalid dwc host structures.

Change-Id: I5e4d905c8240ad228f48b40fe36298029d8770e1
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2022-09-23 12:42:42 -07:00
Tao Zhang
9f74beac0a coresight: funnel: add support for multiple output ports
Funnel devices are now capable of supporting multiple-inputs and
multiple-outputs configuration with in built hardware filtering
for TPDM devices. Add software support to this function. Output
ports is selected according to the source of the trace path.

Change-Id: I491293e0b1948f3747d34eb79e7845617ace4244
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
Signed-off-by: Tao Zhang <taozha@codeaurora.org>
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-09-23 04:32:00 -07:00
Cong Zhang
b6d428f6a8 soc: qcom: Rollback when failed to register new region
Remove region from local minidump table when failed to register new
region with RM call.

Change-Id: I85bbf62e90cd423be7d3475a5f6526062b22c8c9
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:38 -07:00
Cong Zhang
032d6b0f4b soc: qcom: Fix md_get_region failure when using minidump in SVM
Find the correct minidump table in md_get_region.

Change-Id: Ib42db09f4ee3b629834cf78795ceb0c26a877bdd
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:32 -07:00
Cong Zhang
80389226be soc: qcom: Decrease num_regions after remove region
Decrease num_regions of minidump table after remove region.

Change-Id: I8be2cc2b1f29328fb0e308431893dea1b15cd084
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:25 -07:00
Cong Zhang
f7845a840c soc: qcom: Block register minidump region with same name
If user register minidump region with same name, return -EEXIST error
code.

Change-Id: I612a7a4f77fdd80d3b677b2b2b4e4d1221c3395f
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:09 -07:00
Mao Jinlong
e1ed2a9b89 defconfig: pineapple: Enable QDSS configs for pineapple
Enable QDSS configs to support STM/TPDM/Remote ETM/CTI functions.

Change-Id: I297b0820794849d3dc27af30b646780f4370d1d7
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-09-22 19:29:32 -07:00
Tao Zhang
edcceebfd9 coresight: Add the coresight qmi head file
Add the coresight qmi head file since the remote etm need it
support.

Change-Id: I282abfab76be5149dca2496bb9583951f760f17e
Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-09-22 19:29:16 -07:00
Guru Das Srinagesh
d9c33d9e5a abi_gki_aarch64_qcom: Add msleep_interruptible
Add msleep_interruptible to list of symbols.

Change-Id: I348f22cca19c1086c04068ba1ea539b18705d84b
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
2022-09-22 17:43:51 -07:00
Maulik Shah
321af67c34 soc: qcom: qcom_stats: Add ioctl support for stats
Add ioctl support by which userspace can know the various stats.

Change-Id: I916232f7eeb0efd7ca5a8d99afff547fdb9ad594
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-09-23 00:13:53 +05:30
Maulik Shah
4213c4b3b4 arm64: configs: Enable CRM driver for pineapple_GKI
Enable CRM driver.

Change-Id: I87ed4674b63f54cd35b8940a94113083e835b2ae
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-09-22 22:30:52 +05:30
Maulik Shah
b5797d6b33 soc: qcom: Add CESTA Resource Manager driver
Add CESTA Resource Manager (CRM) driver.

Change-Id: I82c905fbb2838cae72337677cf076f245b2f3865
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-09-22 22:30:44 +05:30
Stephen Dickey
a602accc3c kernel/sched/walt: check migration disabled in allowed_ptr_locked
migrate_disable is called to prevent moving a task to a different
cpu. In the process it will update the task's cpus_ptr to a
temporary mask to restrict the task to run only on the current
cpu. It has only one cpu set in this new mask. migrate_disable
must always be paired with a migrate_enable call.

When migrate_enable is called it will attempt to manipulate the
allowed ptrs mask just prior to actually enabling migration on
a task. This means __set_cpus_allowed_ptr is called. This calls
a tracehook:

  migrate_enable
  __set_cpus_allowed_ptr
  __set_cpus_allowed_ptr_locked
  trace_android_rvh_set_cpus_allowed_ptr_locked
  android_rvh_set_cpus_allowed_ptr_locked

The purpose of handling this hook in walt, is to prevent the
assignment of a task to a halted cpu. When migrate_enable
restores the affinity to p->cpus_mask and p->cpus_mask consists
of a single cpu and that single cpu is halted, WALT will cause
__set_cpus_allowed_ptr to reject and return early. IOW
p->cpus_ptr is not set to p->cpus_mask.

If the p->cpus_ptr is not restored to point to the p->cpus_mask,
a subsequent migrate_disable/migrate_enable can happen, and
is allowed to happen with the runque lock taken. Since the
p->cpus_ptr is not pointing to the p->cpus_mask, migrate_enable
will incorrectly call __set_cpus_allowed_ptr. This in turn
will take the runque lock again resulting in a spinlock
recursion.

Address this by updating the hook code, checking the
migrate_disabled flag for the task, and allowing the existing
cpu to be used even if that cpu is halted. To achieve this
utilize a different hook that is present in the code already:
trace_android_rvh_set_cpus_allowed_by_task().

Change-Id: I42204332d708c6bc96f5de52eb9739d17cfdc0a3
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:29 -07:00
Tengfei Fan
30c5ecaa7f sched/walt: make TASK_BOOST_STRICT_MAX task have high chance for running on prime core
TASK_BOOST_STRICT_MAX task can cause performance influence if it haven't
running on prime core, so do this for these tasks have high chance for
running on prime core.

Change-Id: I249dbe1c201934ea3c4610e93b1b71b24fb20d80
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
2022-09-21 15:36:29 -07:00
Shaleen Agrawal
4349ffdf24 kernel/sched/walt/energy-model: inflate cost for 1.6Ghz by 3x
Certain frequencies in min-cap cpus draw excessive power and
are more costly to the device's performance than indicated by
the energy model.

For silver frequencies above a threshold, inflate the cost by
a percentage to create a steep power curve, favoring golds at
lower frequencies. For example, to raise the cost for
frequencies above 1.6GHz by 3x:

      echo 300 > /proc/sys/walt/sched_em_inflate_pct
      echo 220 > /proc/sys/walt/sched_em_inflate_thres

Change-Id: Ia10a818ab2f217ffa3039667f52566d9894e5047
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:28 -07:00
Ashay Jaiswal
92c1eb4e2f sched: walt: remove vendor hook "trace_binder_transaction_received"
"trace_binder_transaction_received" vendor hook is used to clear binder low
latency MVP priority, but for some usecase it is observed that usespace
application is initiating read ioctl quickly and as part of ioctl handling
binder driver initiates transaction received vendor hook and binder low
latency MVP priority is cleared for the binder thread.
Handle above condition by allowing binder thread to maintain and run with
MVP priority for it's allocated MVP timeslice.

The Low latency flag of the task is reset only when the binder transactions
is initiated again on the same thread and task initiating the transaction
doesn't comply with the low latency criterion.

Change-Id: Ie068adc64796432b7d41b0256a25a04caac518b1
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
2022-09-21 15:36:28 -07:00
Shaleen Agrawal
c9410f348b sched/walt: Add tracepoint to display select_task_rt fastpath
Add tracepoint to help debug rt task placement decisions.

Change-Id: I95170b2b45adf3a614ba49d237c8ed6ca6e145aa
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:28 -07:00
Stephen Dickey
97bfb7d38f kernel/sched/walt: change formatting for not_preferred output
Core control takes a numeric input for the not_preferred field
to identify which cpus can be paused. 1 means can pause, 0 means
the cpu cannot pause.

The output is in order of the number of the cpu. For example

  # cat /sys/devices/system/cpu/cpu3/core_ctl/not_preferred
  1 0 1 0

This means that cpu 3 and cpu 5 are not_preferred and can be
paused.

Change-Id: Ia4b982352bba7e463d59579ece13ccfcb09b0baf
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:27 -07:00
Stephen Dickey
774bb80375 sched/walt: add lowlatency support for key binder transactions
The current change protects only binder transactions
targeted towards an RT process. This change attempts to
consider all binder transaction interacting with an RT task.

Change-Id: I35cbb695f6709170afa075b1b50d009b17b1b508
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <quic_bsrivenk@quicinc.com>
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:27 -07:00
Stephen Dickey
d3e9a484ac kernel/sched/walt: kernel space adaptive_low/high_freq values
Add kernel-space adaptive_low_freq and adaptive_high_freq to the
waltgov cpufreq policies, such that kernel space code or vendor
kernel space code can manipulate these values directly.

Set the actual in-use adaptive freq values to the max of the
user space value and the kernel space value.

Change-Id: I59deca1cd60bcd8bd63170e6e1bced63456b41d6
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:26 -07:00