This reverts commit 82023d3f20.
remove hyp_assign_phys from abi_gki_aarch64_qcom, it's not the
upstream symbol.
Change-Id: I08bc531a7bea6ea5929ffb3fc13bd50f8e9119b5
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Adding vm related drivers to modules list and symbols
for pineapple.
Change-Id: Ic6d2402c0c77c0d303bdfae67d3559a5736c0765
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Module signing and dm-verity needs key pair to be generated
using openssl. Add keygen file which is needed to generate
keys using openssl.
This is just snapshot of kalama's gh_ctrl driver from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: I6d785f2a1695bf59969b7eba4f3f7a5df6342bf9
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Adding VM TLMM access driver for pineapple.
This is just snapshot of kalama's TLMM access driver from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: Ifb567fbbd1bee5e3265f88592a3dedb45c693ecd
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Add build related configs for vm and pineapple tuivm.
This is just snapshot of kalama's vm build config from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: Ib50008461b1a22d4018e74185375f06acf93ffd3
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Adding basic library, Kconfig, make and arch specific files
needed for vm on Pineapple.
This is just snapshot of kalama's basic initial files from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: I958bcbda1136fb7b7e6d957f303af8cf7773322e
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
This is just snapshot of kalama's vm rm driver from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: Ie7c45b6a96a2ec390a73b7347d4bff8bd88d0350
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
This is just snapshot of kalama's vm msgq driver from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: I1eb3e01ebf7229f3c35bd8bc6782e80498a2db5e
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
This is just snapshot of kalama's vm doorbell driver from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.
Change-Id: I6445cab51bc03d6a18ac11faa206979b659e5ef7
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Enable platform specific boost support to be able to
set boost frequencies if available.
Change-Id: I392ef4cb0dc0b5d6fa9b4b898fe85248f9cf994d
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
When cpu is hotplugged out, cpu stack is torn down and lmh mitigation
also stops. Hence on lmh exit remove thermal pressure.
This will ensure that scheduler requests higher frequency when
cpu is back online again, since it's likely the CPU has cooled down
in the meantime. And if it hasn't, then lmh IRQ will fire again and
we'll reapply pressure.
Change-Id: I0c17e8eb3b54f4c0661c730015c19b476e322770
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
Add support for qcom_cpufreq_get_cpu_cycle_counter(), which provides the
total accumulated CPU cycle counts for use by the scheduler.
This code is a modified snapshot from msm-5.10 commit 83dbc79da4b1
("qcom-cpufreq: remove references to WALT").
Change-Id: Id3ea9a4113cbe2581d159c780ab5d4b71e4d0edb
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
If cpu is hotplugged then policy->cpus is cleared in cpufreq_offline
which will results in device being NULL on last CPU hotplugged out.
Also since cpu is hotplugged out, polling callback can safely be
ignored in this case.
Change-Id: Ic2d29fe2bdd7c6aa1e952d700d11e321e69f6acb
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Add support to print the perf state, pstate status and cycle counter
status registers for various frequency domain and notifier to print
cpufreq hardware debug registers during crash.
Change-Id: I043f5a29869f505adf49e6adb62035ceb04d810a
Signed-off-by: Naveen Yadav <naveenky@codeaurora.org>
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
Currently, when lmh interrupt fires we notify the scheduler about
thermal pressure. The scheduler reduces the capacity of the cpu(s)
for which the interrupt fired, while we requeue our deferrable work.
This leads to an interesting deadlock, since the cpu is running with
reduced capacity, the scheduler does not put any task on it,
extending the idle time and causing it to remain at reduced capacity -
leading to severe underutilization of the cpu(s).
Switch to using delayed work instead of deferrable work. This will cause
us to exit idle until the thermal condition is recovered.
Change-Id: I4c27c9a952ed556336297eb25e815c848b8266eb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
driver_data is freed between cpu_freq framework cpufreq_offline
and cpufreq_online callbacks. cycle counter api can be invoked by
irq inbetween cpu online/init call which can lead to panic if
driver_date is released on last exit callback from framework.
Hence for now keep driver_data, once allocated in init call.
Change-Id: I892fcad460b8bbe38d7240b2a43105d5fcb11639
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
The qcom_lmh_dcvs_notify() function requires the CPU OPP tables, so
cancel the lmh work before removing them.
Change-Id: I3d42362baff1632da6d8a9cfc5ba9b724da240d9
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add trace events in irq handler and throttle frequency polling
to capture DCVSH updates to sched and or when lmh irq is high.
Change-Id: I96c1af1abeb24971b8d060457feee1dbadcdb028
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
Initialize qcom_cpufreq_counter spinlock to avoid uninitilized
access or panic when driver tries to get lock during cycle_counter
framework call.
Change-Id: If56cf3030a2d468c0493a5946c778908fd015221
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Adding pinctrl related changes for pineapple vm.
Change-Id: Ifef2b38affea583dd2d08dfaf290f971a1d9c6e6
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
Enable necessary drivers for Kalama, and add these modules to
kalama module list file.
Change-Id: Ida864dce76ec0494942acbe58398d5d839be09e2
Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com>
Add a function to query the glink core layer on whether a packet has
caused a wakeup. This function also takes a parameter to specify if the
wakeup state should be reset after reading the variable.
Add print to log the wakeup packet for glink interrupts. Some channels
such as IPCRTR will already reset the wakeup info state and print their
own messages. This print is meant to be a default print for all other
channels.
Change-Id: Iff7ff4e08d595c63f1c6924b77436b8edf261485
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Glink irq should be wakeup capable, to achieve this irq is marked
with enable_irq_wake().
There are some use cases where glink communication is required in system
suspend path and glink interrupt handler needs to be run immediately.
But wakeup cpabale interrupts even if received during suspend will not
run immediately, this will be marked pending and run when system resumes
from suspend. In such scenario there can be a potential deadock in suspend
path due to any irq thread which is waiting for glink interrupt completion
while glink interrupt cannot be handled immediately.
One such use case is usb plugin interrupt received during suspend, which
calls regulator api to communicate with rpm over glink and waits for rpm
ack. RPM ack cannot be processed because glink interrupt received from rpm
goes in pending state. Suspend path is blocked because regulator irq thread
is still waiting.
So there is requirement to run glink interrupt handler in suspend path at
the same time making it wakeup capable. IRQ frameworks forbids usage of
both IRQF_NO_SUSPEND and enable_irq_wake() together. This patch adds
IRQF_NO_SUSPEND and pm_system_wakeup() for glink irq to implement this
requirement.
Change-Id: I1da199c9e10c640bb84d00e569c4fafc5c104d24
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Glink pipe indices are reset by apps in the remoteproc
subdev stop path. There is a chance that the remote that
is being shutdown is in the middle of reading from the
pipe. This causes the remote that is shutting down
gracefully to crash as index 0 is invalid.
Remove the fifo reset from the remoteproc subdev stop
path. Register a function pointer with remoteproc for the
subdev to be called during prepare stage of ssr. Split
the glink probe to have pipes initialization, rx thread
creation and setting up glink structures happen in prepare
stage and version negotiation and char device creation in
prepare stage.
Given that the pipes get re-initialized during prepare
stage, the fifo indices will be intact until after the
remote has been shutdown completely and reset before the
remote is up again.
Spliting glink probe to prepare (in BEFORE_POWERUP) and
start (in AFTER_POWERUP) stage in spss results in glink
link up callback arriving earlier on spss when one of the
destination services is not yet created. This results in
spss not finishing the boot flow after ssr.
Adding glink fifo reset to be called as part of BEFORE_SHUTDOWN
if the underlying driver has callbacks setup for it as is the
case in spss rpmsg driver.
Change-Id: I74cae7ce49cb212af9e7ec2391956339c3427aec
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
While system is going down fifo index are not reset which can
cause remote subsystem to read stale index.
Now resetting the index while system is going down.
CRs-Fixed: 2543040
Change-Id: Icb4010c120f4735da206a44a4eb1bcf06ae0a1b7
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Some remote procs do not initialize the pipe when they are started
and assume the data in the pipe descriptors is valid. Add an optional
handler to clear the pipe descriptors and call this during removal
of the glink device to ensure a clean restart of glink.
Change-Id: I62871cc5d6fd052e234843645299fdc87a71185f
Signed-off-by: Chris Lew <clew@codeaurora.org>
Currently when a remote subsystem goes down, remove_subdev will be
called from rproc for removing that subsystem from the list, but
this could be too late. Register for early SSR notifications for
getting notified about before shutdown, so that the glink_send calls
to the dead processor will not get blocked.
Change-Id: Ief7f90caf69f2855272579bc63140837e0efc447
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Wait for actul intent allocation to complete before again requesting
for same intent. Currently on getting intent request ack glink looks
for allocated intent and if it is not found it again requests.
In some cases remote host may delay allocation of intents but acknowledge
it immediately, in such cases glink will keep on requesting same intent
repeatedly. Now added code to wait for actual intent allocation to complete
and timeout if it is not allocated within 10 sec.
Change-Id: I346eb207422450cbeedc94e6451c6491bbf58bf0
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Add a status for remote processor reset. Change the intent completion
variable to a waitqueue to check both intent request completion and
processor reset status. This allows rpmsg to cancel threads that are
waiting to send to the remote procssor.
Change-Id: Ic43a8d836f347ab26daec7f906a9a1b0f585a549
Signed-off-by: Chris Lew <clew@codeaurora.org>
Channel release function is not making intent wait condition true
before calling wake_up, due to this thread waiting on intent is
stuck and does not wake up until timeout happens. By this time
channel context is freed and this casues finish wait to fail due
to access of wait queue in freed channel context.
Mark intent request complete before calling wake_up.
CRs-Fixed: 2914979
Change-Id: Ia4162c9e62f0f5a7bd04ca0e09c2cd58319ef341
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
We are not validating head and tail index of tx and rx fifo
before using to read or write fifo. This can result in out of
bound memory access if head and tail have incorrect values.
This patch adds check for validation of head and tail index.
CRs-Fixed: 2398099
Change-Id: Ia8725a731cc7a45f7e13b09e1e62842ff44d53f3
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Receive callback can be registered even before rpmsg driver probe is
complete. Assuming callback register as channel ready and allowing
remote host to send data is incorrect. In such case for any rx packet
callback may return prematurely thereby dropping the rx packet.
Adding a flag to store channel state when it is ready. Check this flag
before allocating rx intent and allowing data communication to proceed.
It will ensure that client driver is able to receive data correctly,
without any rx packet getting dropped.
CRs-Fixed: 2747216
Change-Id: Ib153cfe5689f31d7417622bf6177e9535fda628a
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Signed-off-by: Sarannya S <sarannya@codeaurora.org>
Sometime remote may try to send packet before receive callback is
assigned. Which can result in dropping of packets on apps.
Acknowledge intent request but queue the intent only when receive
callback assignment is complete.
Change-Id: Ie366c24e204db7f1609e2345ee3324cb00f56f3e
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Signed-off-by: Sarannya S <sarannya@codeaurora.org>