Add flushed_delayed_fput for usage by mem-buf.
Change-Id: I16b06de8b4b87f8e4d391229c6b13181c7be9bd9
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
When below sequence is run back-to-back, -ENOMEM is occasionally returned
by MEM_BUF_IOC_REMOTE_ALLOC.
ioctl(MEM_BUF_IOC_REMOTE_ALLOC, args)
fd = args.fd
close(fd)
This occurs because the message sent from TUIVM to PVM as part of the
file release callback is asynchonous. Resolve this by adding a new
message type which indicates when PVM has completed the free operation.
Additionally, define a separate obj_id instead of reusing the transaction
id for this purpose.
Change-Id: Iea458ec80cd14bd08848192371d0bb71cdc5de60
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
Reuse the same buffer for each message in mem_buf_msgq_recv_fn()
instead of allocating a new one for each message, and freeing it
in a dozen different locations depending on what type of message it
is.
If a consumer of the message needs to defer its work to a workqueue,
it must allocate a new copy of the message.
Change-Id: Ia5583bc7dc9937211f25624f7a679d34fe8fb521
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
gh_rm_mem_accept allows a VM to request memory to be mapped to a specific
IPA address. Modify function parameters to allow for future use of this
feature.
Change-Id: I6ad586886563e769549e4966369da48c27ca0a5c
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
Allow a guest VM to choose whether the memory it requests is obtained
via the lend, share or donate hypervisor call.
Change-Id: I7e1f25ea0f9b0ec99d4a7afd79f206f9a2b67d85
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
Support to donate memory is always present on compatible hypervisor
builds.
Change-Id: Ic7a4c03716277e379014bb31e58358cffb85409c
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
Enable CONFIG_QCOM_MEM_BUF_MSGQ, CONFIG_QCOM_MEM_BUF_GH and
CONFIG_QCOM_MEM_BUF_DEV_GH to allow mem-buf CPU use cases to be
exercised.
Change-Id: I15bbb098c1ba28924f73b203718203f4dbd6c2bd
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
add_memory_subsection() and remove_memory_subsection() are only needed
on the TVM and OEM VMs. These are downstream functions as well. Thus,
selectively allow them to be enabled so that we only compile them on
downstream kernels.
Change-Id: I8416cd8eb8db74cf8a3cfbc8e3d7ea2fff112353
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
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>
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>
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>
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>
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>
If user register minidump region with same name, return -EEXIST error
code.
Change-Id: I612a7a4f77fdd80d3b677b2b2b4e4d1221c3395f
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
Enable QDSS configs to support STM/TPDM/Remote ETM/CTI functions.
Change-Id: I297b0820794849d3dc27af30b646780f4370d1d7
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
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>
Add msleep_interruptible to list of symbols.
Change-Id: I348f22cca19c1086c04068ba1ea539b18705d84b
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Add ioctl support by which userspace can know the various stats.
Change-Id: I916232f7eeb0efd7ca5a8d99afff547fdb9ad594
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
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>
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>
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>
"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>
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>
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>
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>