Commit Graph

1111448 Commits

Author SHA1 Message Date
Chris Lew
4837e4e0f4 rpmsg: glink: spss: Add snapshot of spss transport
This snapshot is taken as of msm-5.15 'commit <c79afcd18535>
("va_minidump: Add md_unregister support for clients")'.

Change-Id: Ifb19f2867c40d91b108d90437be0b4ccd936664c
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
2022-08-16 10:44:03 -07:00
qctecmdr
ea82617440 Merge "virtual io: avoid setting swiotlb_force in virtual io mmio" 2022-08-16 08:05:42 -07:00
qctecmdr
4b18039752 Merge "gunyah: virtual io: Porting Gunyah Secure Virtual io backend driver to Pineapple" 2022-08-15 22:53:54 -07:00
Sreenad Menon
2d3aafead0 virtual io: avoid setting swiotlb_force in virtual io mmio
Setting swiotlb_force to SWIOTLB_FORCE would force non virtual io
drivers also to use swiotlb. So avoid it.

Change-Id: I419700e9f38b0b00da22c8522f94edffd2fd8f52
Signed-off-by: Sreenad Menon <sreemeno@codeaurora.org>
2022-08-15 21:16:16 -07:00
Sreenad Menon
0ea7e633ca virtual io: mmio: use bounce buffers for virtual io mmio devices
In some cases, its possible that most of a VM's memory is not
accessible to virtual io backend drivers that run in the context of a
separate VM. A hypervisor could pre-share some limited memory between
both the VMs. Use such pre-arranged shared memory to allow data
exchange between front-end and back-end drivers.  DMA ops are added to
virtual io (mmio) devices, which bounces buffers to and from the
pre-shared region.

Change-Id: I6cf61cd1ca4c8b848a6d6d1aa1d5023ce9341174
Signed-off-by: Sreenad Menon <sreemeno@codeaurora.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2022-08-15 21:16:10 -07:00
qctecmdr
5d73429d48 Merge "cpufreq: qcom-hw: Disable LMH irq when disabling policy" 2022-08-15 19:48:44 -07:00
qctecmdr
b0c805234f Merge "build: config: Adding build configs for vm and pineapple tuivm" 2022-08-15 19:48:44 -07:00
qctecmdr
3799e67e82 Merge "Part Revert "modules.list.msm.pineapple: adding vm related drivers"" 2022-08-15 19:48:42 -07:00
qctecmdr
c9f7a775a1 Merge "cpufreq: qcom-hw: Enable boost support" 2022-08-15 18:17:51 -07:00
qctecmdr
bb55c3caee Merge "cpufreq: qcom-hw: remove thermal pressure on cpu hotplugged/offline" 2022-08-15 16:47:35 -07:00
qctecmdr
5810827cc9 Merge "cpufreq: qcom-hw: Add cycle_counter support" 2022-08-15 15:08:19 -07:00
Peng Yang
92a95ac59e Part Revert "modules.list.msm.pineapple: adding vm related drivers"
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>
2022-08-15 12:56:19 -07:00
qctecmdr
4e7a5df7d7 Merge "soc: qcom: Porting VM TLMM access driver for pineapple" 2022-08-12 21:20:25 -07:00
qctecmdr
19ad73622c Merge "gunyah: rm: Adding vm resource manager related drivers for pineapple" 2022-08-12 21:20:25 -07:00
qctecmdr
074ad97ebc Merge "pinctrl: Adding vm related pinctrl changes for pineapple" 2022-08-12 21:20:25 -07:00
qctecmdr
ec7da86053 Merge "modules.list.msm.pineapple: adding vm related drivers" 2022-08-12 19:19:10 -07:00
qctecmdr
cf6c961594 Merge "gunyah: Adding basic initial files needed for vm on Pineapple" 2022-08-12 19:19:10 -07:00
qctecmdr
7f51ff3bbe Merge "msm-kernel: add keygen to generate key-pair using openssl" 2022-08-12 19:19:10 -07:00
qctecmdr
51f53208c0 Merge "swiotlb: Handle swiotlb region outside of linear-mapped memory" 2022-08-12 19:19:09 -07:00
qctecmdr
022abff7a7 Merge "arm64: defconfig: kalama: Enable necessary drivers for Kalama" 2022-08-12 17:16:30 -07:00
qctecmdr
b54d798dfa Merge "pinctrl: qcom: Propagate set of changes to pinctrl-msm" 2022-08-12 17:16:29 -07:00
qctecmdr
fcd1028dbb Merge "gunyah: msgq: Porting messageq driver to pineapple" 2022-08-12 17:16:28 -07:00
Peng Yang
82023d3f20 modules.list.msm.pineapple: adding vm related drivers
Adding vm related drivers to modules list and symbols
for pineapple.

Change-Id: Ic6d2402c0c77c0d303bdfae67d3559a5736c0765
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-11 20:25:54 -07:00
Peng Yang
9bdb8793f4 msm-kernel: add keygen to generate key-pair using openssl
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>
2022-08-11 19:59:10 -07:00
Peng Yang
7327a7facf gunyah: virtual io: Porting Gunyah Secure Virtual io backend driver to Pineapple
Add gunyah secure virtual io backend driver for Pineapple.

This is just snapshot of kalama's secure virtual io backend driver
from 'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.

Change-Id: Ie4cb1c30a42a2465c37b1fe1f47850b95ac4eb24
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-11 19:42:22 -07:00
Sreenad Menon
b18abf055d swiotlb: Handle swiotlb region outside of linear-mapped memory
Porting "swiotlb: Handle swiotlb region outside of linear-mapped memory"
(Commit ID:cf0e9880897f635a2422a4479f498fcbc5b8468e)from msm-5.10.

Change-Id: I9bb5297994ac1a75c45f91b4a45969b9bf9bdb27
Signed-off-by: Sreenad Menon <sreemeno@codeaurora.org>
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-11 19:29:26 -07:00
Peng Yang
08ba873b76 soc: qcom: Porting VM TLMM access driver for pineapple
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>
2022-08-11 08:14:52 -07:00
Peng Yang
3b62b79a1d build: config: Adding build configs for vm and pineapple tuivm
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>
2022-08-11 01:46:21 -07:00
Peng Yang
07219d4f2b gunyah: Adding basic initial files needed for vm on Pineapple
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>
2022-08-10 23:11:03 -07:00
Peng Yang
4919ab2b83 gunyah: pops: Porting Gunyah Guest Power-Operations driver to Pineapple
Add gunyah guest power-operations driver for Pineapple.

This is just snapshot of kalama's gunyah power-operations driver
from 'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.

Change-Id: I87f37b3462d1655d5db051ab3ae861d2345c0c2f
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-10 23:07:16 -07:00
Peng Yang
381ac781d4 gunyah: rm: Porting gunyah memory resource notifier driver
Add gunyah memory resource notifier drivers for pineapple.

This is just snapshot of kalama's memory resource notifier driver
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.

Change-Id: I4ccdc0876031ec95f0c9e23246912b31b334df93
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-10 23:07:10 -07:00
Peng Yang
ffd10e3562 gunyah: rm: Porting gunyah vIRQ lending library
Add library for client drivers to lend interrupts to each other.

This is just snapshot of kalama's vIRQ lending driver from
'commit 5beb98404269 ("Merge "i3c: i3c-master-msm-geni: Fix
IBI for invalid device OR handler"")'from msm-5.15 branch.

Change-Id: Ia956778784a74535509edd6e7fcf95ae44fcdee2
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-10 23:07:05 -07:00
Peng Yang
4b03d7f62b gunyah: rm: Adding vm resource manager related drivers for pineapple
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>
2022-08-10 23:06:58 -07:00
Peng Yang
213f1c589f gunyah: msgq: Porting messageq driver to pineapple
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>
2022-08-10 23:06:53 -07:00
Peng Yang
4bd7265ed2 gunyah: dbl: Porting doorbell driver pineapple
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>
2022-08-10 23:06:47 -07:00
Pierre Gondois
f0b3f4cd92 cpufreq: qcom-hw: Disable LMH irq when disabling policy
If LMH (Limits Management Hardware) is available, when a policy is
disabled by unplugging the last online CPU of policy->cpus, the LMH
irq is left enabled.
When the policy is re-enabled with any of the CPU in policy->cpus
being plugged in, qcom_cpufreq_ready() re-enables the irq. This
triggers the following warning:
[  379.160106] Unbalanced enable for IRQ 154
[  379.160120] WARNING: CPU: 7 PID: 48 at kernel/irq/manage.c:774 __enable_irq+0x84/0xc0
Thus disable the irq.

Change-Id: I8cd8bec4c6039061c2efb20140b8fb3d3c941e79
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
Git-commit: f7fca54a18
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
2022-08-10 11:36:02 -07:00
Vivek Aknurwar
be83eb2675 cpufreq: qcom-hw: Enable boost support
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>
2022-08-10 11:36:02 -07:00
Vivek Aknurwar
0785922904 cpufreq: qcom-hw: remove thermal pressure on cpu hotplugged/offline
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>
2022-08-10 11:36:02 -07:00
Sai Harshini Nimmala
cb0c7a7d3a cpufreq: qcom-hw: Add cycle_counter support
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>
2022-08-10 11:36:02 -07:00
Pierre Gondois
8ce580d2f1 cpufreq: qcom-hw: Reset cancel_throttle when policy is re-enabled
If LMH (Limits Management Hardware) is available, when a policy is
disabled by unplugging the last online CPU of policy->cpus,
qcom_cpufreq_hw_cpu_offline() sets cancel_throttle=true.
cancel_throttle is not reset when the policy is re-enabled with any
of the CPU in policy->cpus being plugged in. So reset it.

This patch also adds an early exit check.

Change-Id: Iea871695e574aed6037833086fee45b13da726c3
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
Git-commit: cdcf8eb3e7
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
2022-08-10 11:36:02 -07:00
Imran Shaik
263dd3f6ce cpufreq: qcom-hw: Remove kfree() and unmap_base/release_region labels
Remove unmap_base/release_region labels to avoid kernel crash when
there is no cpufreq hardware data available and explicit kfree() and
iounmap() not required since they are dev managed.

 Trying to vfree() nonexistent vm area ((____ptrval____))
 WARNING: CPU: 3 PID: 90 at mm/vmalloc.c:2608 __vunmap+0x9c/0x2a8
 Modules linked in:
 CPU:3 PID:90 Comm:kworker/u8:1 Tainted: G W 5.15.20-ge6916696ed47-dirty #1
 Hardware name: Qualcomm Technologies, Inc. Cinder RU RUMI (DT)
 Workqueue: events_unbound deferred_probe_work_func
 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : __vunmap+0x9c/0x2a8
 lr : __vunmap+0x9c/0x2a8
 Call trace:
  __vunmap+0x9c/0x2a8
  vunmap+0x64/0x7c
  iounmap+0x2c/0x40
  devm_ioremap_release+0x18/0x28
  devres_release_all+0xd0/0x19c
  really_probe+0xfc/0x354
  __driver_probe_device+0x11c/0x184
  driver_probe_device+0x4c/0x18c

 kernel crash at mm/slub.c:363!
 Modules linked in:
 CPU:0 PID:7 Comm:kworker/u8:0 Tainted: G W 5.15.20-ge6916696ed47-dirty #1
 Hardware name: Qualcomm Technologies, Inc. Cinder RU RUMI (DT)
 Workqueue: events_unbound deferred_probe_work_func
 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : kfree+0x31c/0x38c
 lr : kfree+0x108/0x38c
 Call trace:
  kfree+0x31c/0x38c
  qcom_cpufreq_hw_cpu_init+0x340/0x408
  cpufreq_online+0x300/0x80c
  cpufreq_add_dev+0x48/0xb8
  subsys_interface_register+0xe4/0x140
  cpufreq_register_driver+0x174/0x2c8
  qcom_cpufreq_hw_driver_probe+0x144/0x1b4
  platform_probe+0xb0/0xd8

Change-Id: I75e0d40d6aa68f541cc87393e9bbef2628c1cf96
Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com>
2022-08-10 11:36:02 -07:00
Vivek Aknurwar
6d360fbe4b cpufreq: qcom-hw: Add device NULL check in notify/polling callback
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>
2022-08-10 11:36:02 -07:00
Naveen Yadav
cc321fbbae cpufreq: qcom-cpufreq-hw: Add support for CPUFreq hardware debug
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>
2022-08-10 11:36:02 -07:00
Abhijeet Dharmapurikar
48acc4c519 cpufreq: qcom-hw: switch to non deferrable work
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>
2022-08-10 11:36:02 -07:00
Vivek Aknurwar
b83f18ed9a cpufreq: qcom-hw: Keep driver_data for cycle_counter API use
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>
2022-08-10 11:36:02 -07:00
Mike Tipton
e0f4f032b5 cpufreq: qcom-hw: Fix panic when offlining core under lmh throttle
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>
2022-08-10 11:36:02 -07:00
Vivek Aknurwar
b67959cb83 cpufreq: qcom-hw: Add trace for irq and throttle freq polling
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>
2022-08-10 11:36:02 -07:00
Vivek Aknurwar
c27180b4c7 cpufreq: qcom-hw: Initialize qcom_cpufreq_counter spinlock
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>
2022-08-10 11:36:02 -07:00
Peng Yang
b73b5f735b pinctrl: Adding vm related pinctrl changes for pineapple
Adding pinctrl related changes for pineapple vm.

Change-Id: Ifef2b38affea583dd2d08dfaf290f971a1d9c6e6
Signed-off-by: Peng Yang <quic_penyan@quicinc.com>
2022-08-10 04:39:14 -07:00
Huang Yiwei
d697a03532 arm64: defconfig: kalama: Enable necessary drivers for Kalama
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>
2022-08-10 17:16:26 +08:00