Commit Graph

1111457 Commits

Author SHA1 Message Date
Xubin Bai
caed56e132 cpufreq: qcom-hw-debug: Fix buffer overflow
Currently the hw_regs->base array size is hardcoded to 3,
but some chips have more frequency domains than this,
which will result in buffer overflows

The array size should be dynamically allocated according
to hw_regs->domain_cnt, not hardcoded directly.

Change-Id: Ida14766fe77195aef41c6e754f2875b5a24fe742
Signed-off-by: Xubin Bai <quic_xubibai@quicinc.com>
2022-08-17 15:56:25 -07:00
qctecmdr
6bcead9de0 Merge "arm64: defconfig: Enable SS/HS USB PHY drivers for Pineapple" 2022-08-17 02:36:09 -07:00
qctecmdr
3ceff11adc Merge "swiotlb: Limit max bounce buffer size" 2022-08-17 02:36:08 -07:00
Wesley Cheng
af0031c521 arm64: defconfig: Enable SS/HS USB PHY drivers for Pineapple
Enable the USB PHY drivers used on pineapple.  This includes the QMP PHY
for SSUSB and EUSB2 PHY + repeater for HSUSB.

Change-Id: I9f4176c3628e14e10a1719ebfedbb99be86770d5
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2022-08-16 16:25:49 -07:00
qctecmdr
b85e5ef307 Merge "stm: class: Add MIPI OST protocol support" 2022-08-16 11:08:35 -07:00
qctecmdr
88a494895f Merge "soc: qcom: Add snapshot of DCC driver" 2022-08-16 11:08:35 -07:00
qctecmdr
ea82617440 Merge "virtual io: avoid setting swiotlb_force in virtual io mmio" 2022-08-16 08:05:42 -07:00
Mao Jinlong
9a11894fa4 soc: qcom: Add snapshot of DCC driver
Add snapshot for DCC driver from msm-5.15
commit be57d8832275 ("Merge "usb: phy: m31: fix compile issue"").

change-Id: Ied7bc57b3378f2f7310d431aee48e5c126000bad
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-08-16 07:33:16 -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
Srivatsa Vaddagiri
8dbe481c45 swiotlb: Limit max bounce buffer size
Limiting to 4096, assuming this is used for virtual io block device. The
default maximum (256kB) would result in overflowing of bounce buffers
and stalling of IO (max_segments of 254 for block device and max
bounce size of 256kB could result in block layer submitting a huge IO
request that can never be finished successfully). With 4096, we have
the max size of request set to 254*4096, which is a reasonable space
to set aside per block device.

Change-Id: I8a3b0ec6d26a1b7f5ccdcee649f02c3556bce93b
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2022-08-15 21:16:26 -07:00
Srivatsa Vaddagiri
13a1aaf641 virtual io: mmio: Use memory-region attribute to get memory address
Handled changed DT format to extract memory region address.

Change-Id: Ia6b2d77c018d8639fe5eeaf6883e472f477bacc7
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2022-08-15 21:16:21 -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
Tao Zhang
6f94b791ee stm: class: Add MIPI OST protocol support
Add MIPI OST protocol support for stm to format the traces.
Framework copied from drivers/hwtracing/stm.p-sys-t.c as of
commit d69d5e8311 ("stm class: Add MIPI SyS-T protocol
support").

Change-Id: I3530f2c794e2cc09b63ce06e44d269ad13c4ef2b
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-08-13 07:25:16 -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