Commit Graph

1130090 Commits

Author SHA1 Message Date
Chris Goldsworthy
6acada3f6e abi_gki_aarch64_qcom: Add fastmap symbols
Add symbols for fastmap.

Change-Id: Iad33c705b716b5268f42ed6e02c3de7d8717fe4d
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2022-11-18 14:22:52 -08:00
Chris Goldsworthy
f817953a3b dma-mapping-fast: IOMMU helper clean up
iommu_put_dma_cookie() is now called by the IOMMU framework code
before each driver's domain free callback function is invoked. Remove
iommu_put_dma_cookie() accordingly.

qcom_iommu_put_resv_regions() is now replaced by
iommu_put_resv_regions(), drop all references to our qcom_ function
versions.

Change-Id: Ib9c1c431faf4988707e449ad00c1e3fe7ee2dd47
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2022-11-18 14:22:51 -08:00
Sukadev Bhattiprolu
b6ae4515d3 qcom-iommu-debug: Fail incorrect fastmap usecases
In the current iommu-debug fastmap test device, we map and unmap the entire
iova range from 0..4G for each of the usecases. However for the following
secure usecase:

	$ cd /sys/kernel/debug/iommu-test
	$ cat usecase

	$ echo 4 > usecase
	$ cat functional_fast_dma_api

this mapping of iova range fails with following warning after about 496640
iterations of 8K-size mapping.

	batched_hyp_assign: Failed to assign memory protection, ret = -22
	------------[ cut here ]------------
	failed to assign memory to VMID: 10 rc:-99
	WARNING: CPU: 0 PID: 240 at drivers/iommu/qcom-io-pgtable-alloc.c:39 qcom_io_pgtable_alloc_page+0x110/0x120

Once this happens the memory is no longer usable by HLOS (according to
following comments batched_hyp_assign():

344         if (ret) {
345                 pr_info("%s: Failed to assign memory protection, ret= %d\n",
346                         __func__, ret);
347                 /*
348                  * Make it clear to clients that the memory may no
349                  * longer be in a usable state.
350                  */
351                 ret = -EADDRNOTAVAIL;
352                 break;
353         }

To run any other usecase, we must first destroy the device and recreate it.
But when destroying the device, we get the following warning continuously
(presumably for the 496640 mappings that succeeded):

	------------[ cut here ]------------
	failed to unassign memory from VMID: 10 rc: -99
	WARNING: CPU: 0 PID: 240 at drivers/iommu/qcom-io-pgtable-alloc.c:54 io_pgtable_pool_release+0x1b8/0x24c

	Call trace:
		io_pgtable_pool_release+0x1b8/0x24c
		qcom_io_pgtable_allocator_unregister+0x5c/0xa8
		arm_lpae_free_pgtable+0x30/0x4c
		qcom_free_io_pgtable_ops+0x80/0xa4
		arm_smmu_destroy_domain_context+0xd0/0x1ec
		arm_smmu_domain_free+0x34/0x50
		iommu_group_release+0x5c/0xa8
		kobject_cleanup+0x78/0x1dc
		kobject_cleanup+0xd8/0x1dc
		kobject_put+0x68/0xa8
		iommu_group_remove_device+0x114/0x184
		iommu_release_device+0x48/0x8c
		iommu_bus_notifier+0x4c/0xa4
		blocking_notifier_call_chain+0x5c/0xa8
		device_del+0x2d8/0x3d4
		platform_device_unregister+0x34/0xb4
		of_platform_device_destroy+0xac/0xe4
		iommu_debug_switch_usecase+0x38/0x194
		iommu_debug_usecase_reset+0x18/0x28
		iommu_debug_functional_fast_dma_api_show+0x13e8/0x1538

IOW, the device is unusable and requires a reboot. Its not clear what the
behavior should be for a fastmap test on a non-fastmap device. For now,
detect an invalid usecase and fail cleanly.

Change-Id: I77b827825215f262e836e8902143ea297448612e
Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
2022-11-18 14:22:49 -08:00
Sukadev Bhattiprolu
7ff9dff2e6 qcom-iommu-debug: handle unexpected dma_addr
When __full_va_sweep(), __rand_va_sweep() and __tlb_stress_sweep(), do
their cleanup, they assume that the entire iova range 0..4G was mapped
correctly (i.e assigned iova starts at 0 and goes to 4G).

But if for some reason the iova starts at a different address (eg: with
fastmap, it could start at 0xFFFFF000), we end up with the following
warning from iommu_dma_unmap_page() because the iova 0 was never mapped.

 898         phys = iommu_iova_to_phys(domain, dma_handle);
 899         if (WARN_ON(!phys))
 900                 return;

Worse, since the cleanup tries to unmap the entire 0..4G range, this
warning is repeated a large number of times, making the device unusable.

Instead, report an error on the unexpected and unmap the incorrect dma
address immediately. And when unmapping the iova range, make sure to only
unmap regions that were correctly (when iova == dma_addr) mapped.

Change-Id: Ia0ab4fd49ba5021d4866daf69fb9a3fa7e61928d
Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
2022-11-18 14:20:59 -08:00
Qingqing Zhou
86b4d3af60 iommu: Fix compilation issues on sdxbaagha
Current codes may don't consider the 32-bit possibility, some
compilation errors happen when try to enable smmu on sdxbaagha:
  1. arm-smmu-qcom.c:
    "error: shift count is negative" reports at
    "FIELD_GET(QTB_OVR_ECATS_OUTFLD0_PA, val)".
  2. qcom-iommu-debug-user.c:
    "error: incompatible pointer types passing" reports at
    "if (kstrtox_from_user(ubuf, count, 0, &iova))".
  3. qcom-io-pgtable-arm.c:
    "error: implicit declaration of function 'FIELD_GET'"
    reports at "FIELD_GET(TOP_IGNORED_MASK, table_pte)".
  4. qcom-iommu-debug-user.c:
    "error: implicit declaration of function 'FIELD_GET'"
    reports at "FIELD_GET(ARM_SMMU_SMR_ID, fwspec->ids[0])".
  5. qcom-iommu-debug.c:
    "error: implicit declaration of function 'FIELD_GET'"
    reports at "FIELD_GET(ARM_SMMU_SMR_ID, (fwspec->ids[0]))".

Change-Id: I38b96e411eaf37d87e48b4c9fe860a94643bc5b7
Signed-off-by: Qingqing Zhou <quic_qqzhou@quicinc.com>
2022-11-18 14:20:52 -08:00
qctecmdr
025e33318e Merge "defconfig: pineapple: Enable CONFIG_REGMAP_QTI_DEBUGFS{_ALLOW_WRITE}" 2022-11-11 17:04:36 -08:00
qctecmdr
0146cbfa86 Merge "arm-smmu: Fix compilation issue in CB interrupt selftest" 2022-11-11 17:04:33 -08:00
qctecmdr
fe600bc810 Merge "ARM: config: msm: Enable BAM config for Pineapple" 2022-11-11 17:04:30 -08:00
qctecmdr
73ecad8643 Merge "soc: hw-fence: Add MSM_HW_FENCE_FLAG_SIGNALED_BIT" 2022-11-11 17:04:30 -08:00
qctecmdr
4e4d361474 Merge "abi_gki_aarch64_qcom: Update list of symbols" 2022-11-11 17:04:29 -08:00
qctecmdr
6fabe4da7a Merge "tmc-usb: Add drop data size count" 2022-11-11 17:04:29 -08:00
qctecmdr
a4be16c25f Merge "soc: hw_fence: add support for 64-bit client_data" 2022-11-11 17:04:27 -08:00
qctecmdr
6a0b4f3c39 Merge "pci: msm: Use the platform_get_irq_byname API" 2022-11-11 17:04:25 -08:00
qctecmdr
fa561d1bbe Merge "defconfig: pineapple-gki: Enable BCL peripheral and soc driver" 2022-11-11 17:04:23 -08:00
qctecmdr
a97ea251ac Merge "modules.list.msm.pineapple: Add WALT module" 2022-11-11 17:04:20 -08:00
qctecmdr
04a37de2a2 Merge "net: qrtr: Update data_len when padding large skbs" 2022-11-11 17:04:18 -08:00
qctecmdr
2fb9ec5be7 Merge "soc: qcom : tmecom: add support for v4 policy" 2022-11-11 13:35:11 -08:00
qctecmdr
dacc8de3d0 Merge "ARCH: arm: configs: Enable CONFIG_IPA3 on Pineapple" 2022-11-11 13:35:09 -08:00
qctecmdr
553a8b2012 Merge "defconfig: pineapple-gki: Enable the mem-offline driver" 2022-11-11 13:35:07 -08:00
qctecmdr
2c0f8bf90a Merge "clk: qcom: videocc-pineapple: Add VIDEO_CC_XO_CLK_ARES" 2022-11-11 13:35:07 -08:00
qctecmdr
6e4382ba68 Merge "driver: thermal: sdpm: Add a snapshot of sdpm clock notifier driver" 2022-11-11 13:35:05 -08:00
qctecmdr
a9f455f3dc Merge "wcd939x-usbss: Add i2c driver for wcd939x usbss" 2022-11-11 13:35:03 -08:00
qctecmdr
987b611bea Merge "input: qcom-hv-haptics: Update haptics_parse_per_effect_dt()" 2022-11-11 05:32:29 -08:00
qctecmdr
4c27283738 Merge "driver: thermal: userspace_cdev: Add a snapshot of userspace cooling driver" 2022-11-11 05:32:26 -08:00
qctecmdr
1dfc4603f0 Merge "iio: qcom-spmi-adc5-gen3: poll for CONV_REQ in adc5_gen3_poll_wait_hs()" 2022-11-11 05:32:24 -08:00
qctecmdr
614beb4231 Merge "msm: pcie: Allow NULL as a valid return value for icc_get" 2022-11-11 05:32:21 -08:00
qctecmdr
37afffb8ef Merge "android: abi_gki_aarch64_qcom: Add symbols needed by ubwcp" 2022-11-11 05:32:18 -08:00
qctecmdr
7e4b43a633 Merge "defconfig: pineapple: Enable the UBWC-P DMA-BUF Heap" 2022-11-11 05:32:16 -08:00
qctecmdr
f6646ebd13 Merge "defconfig: pineapple-gki: Enable SPMI_ADC5_GEN3 driver" 2022-11-11 01:40:12 -08:00
qctecmdr
1411eed2ab Merge "defconfig: Enable TLMM VM Mem Access driver" 2022-11-11 01:40:09 -08:00
qctecmdr
cac9f155f8 Merge "ANDROID: Updating module output lists" 2022-11-11 01:40:09 -08:00
qctecmdr
ff35f9d975 Merge "msm:abi_gki: Add find_vma to export symbols list" 2022-11-10 15:50:27 -08:00
qctecmdr
0f15caf52a Merge "uio: Kconfig: Enable msm shared memory driver" 2022-11-10 15:50:27 -08:00
Anjelique Melendez
c1cde953b6 input: qcom-hv-haptics: Update haptics_parse_per_effect_dt()
Update haptics_parse_per_effect_dt() to remove reading
"qcom,effect-id" property.

Change-Id: I18f362e8a02dbca6038b80e503050fe8574e3a5f
Fixes: f6c37c0958 ("input: qcom-hv-haptics: add support for primitive effect")
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-11-10 14:12:21 -08:00
qctecmdr
02ce5d8db3 Merge "ufs-host: qcom: Disable h8 with clk gate and scale" 2022-11-10 08:58:50 -08:00
qctecmdr
da644b5622 Merge "soc: llcc: qcom: Update config data for pineapple SoC" 2022-11-10 08:58:49 -08:00
qctecmdr
2c5bffcdb3 Merge "usb: phy: Remove delay from QMP phy init sequence" 2022-11-10 08:58:47 -08:00
qctecmdr
7bb4b80d6e Merge "pinctrl: qcom: Update driver to match TLMM data" 2022-11-10 08:58:45 -08:00
qctecmdr
755b0b2bfb Merge "scsi: ufs: ufs-qcom: Correct the REG_UFS_CFG0 setting for pineapple" 2022-11-10 08:58:43 -08:00
qctecmdr
34dec33a6e Merge "modules.list.msm.pineapple: Add UFS PHY module for pineapple" 2022-11-10 08:58:42 -08:00
Mao Jinlong
0a7c5a53c5 tmc-usb: Add drop data size count
Add drop data size count and data overwritten tag for the drop
data case.

Change-Id: Ib066215ecf8c9ef2a1920d75afafb45b4a6382e7
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
2022-11-09 18:54:46 -08:00
Harshdeep Dhatt
9a0e3cee09 soc: hw-fence: Add MSM_HW_FENCE_FLAG_SIGNALED_BIT
This bit is set by hw-fence driver when it sees that the hw-fence
is already signaled at the time when a client wants to add itself
as a waiter for this hw-fence. This helps the client to avoid adding
itself as a waiter for an already signaled hw-fence.

Change-Id: I767745923066ee66c4bd8cd756ff05cd8cdbc833
Signed-off-by: Harshdeep Dhatt <quic_hdhatt@quicinc.com>
2022-11-09 15:55:28 -08:00
Michael Adisumarta
7a75273966 abi_gki_aarch64_qcom: Update list of symbols
Add new symbols to the list.

Change-Id: I3f1b17cc69ece6a58ab4d0400e9bb0f524a1dd48
Signed-off-by: Michael Adisumarta <quic_madisuma@quicinc.com>
2022-11-09 15:18:06 -08:00
Subbaraman Narayanamurthy
e33ca179cc defconfig: pineapple: Enable CONFIG_REGMAP_QTI_DEBUGFS{_ALLOW_WRITE}
Enable CONFIG_REGMAP_QTI_DEBUGFS in pineapple GKI config so that
the regmap interfaces which uses regmap_qti_debugfs APIs can be
read using debugfs.

Enable CONFIG_REGMAP_QTI_DEBUGFS_ALLOW_WRITE in pineapple consolidate
config so that the regmap interfaces which uses regmap_qti_debugfs
APIs can be written via debugfs.

Change-Id: Ibd6f57312851c5482d2ca964cabfca76f8192ac1
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-11-09 15:14:34 -08:00
John Moon
3faf5b6ee7 ANDROID: Updating module output lists
Updating module output lists for kalama and pineapple.

Change-Id: I0fd6cb8b586b1dab62293483f768041f12e897b8
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-11-09 12:56:59 -08:00
Mao Jinlong
317c566fa4 coresight-tmc-usb: Flush read_work before usb_qdss_close()
When disabling USB SW path ensure all calls to usb_qdss_write()
are completed before calling usb_qdss_close(), otherwise the
two APIs may race and result in out-of-order sequencing between
the underlying usb_ep_queue() and usb_ep_dequeue() calls.  This
may result in usb_qdss_close() getting stuck since it is waiting
on an unqueued request to complete.

Change-Id: Ibdccf082a6273f8d3a78e664b58bd0a5b9ce8f69
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-11-09 06:25:25 -08:00
Xubin Bai
f4bf0d795c clk: qcom: videocc-pineapple: Add VIDEO_CC_XO_CLK_ARES
In order to ensure video power collapse can work fine,
the CLK_ARES is added for VIDEO_CC_XO_CLK so that
asserting/de-asserting the reset can automatically
disable/enable the clock.

Change-Id: Ibf20a768d95aa0394ebec1c8be163a0fa4d85754
Signed-off-by: Xubin Bai <quic_xubibai@quicinc.com>
2022-11-08 19:03:12 -08:00
Xubin Bai
dbb9312948 dt-bindings: clock: Add VIDEO_CC_XO_CLK_ARES for Pineapple
Add CLK_ARES for VIDEO_CC_XO_CLK to ensure video power
collapse can work fine in Pineapple.

Change-Id: Id76e3ef29f59f5745469cd43800cefc0d82f8499
Signed-off-by: Xubin Bai <quic_xubibai@quicinc.com>
2022-11-08 18:45:27 -08:00
Grace An
c2861e2808 soc: hw_fence: add support for 64-bit client_data
Modify msm_hw_fence_wait_update_v2 api to include the optional
parameter client_data_list, a list of values that are returned
to the client upon signaling of the corresponding fence through
the RxQ.

Change-Id: I1daeadc7812cf475fba635be2fc446157da9d73b
Signed-off-by: Grace An <quic_gracan@quicinc.com>
2022-11-08 16:09:47 -08:00
Asutosh Das
8c74b78d69 ufs-host: qcom: Disable h8 with clk gate and scale
Work-around for hangs during bootup.
No ramdumps/tools available to debug during BU.
So, disable hibern8 during clock gating.
This would let the clocks to be off thus allowing CxPC.

Clock scaling needs SYS1CLK_1US_REG and
DME_VS_CORE_CLK_CTRL.MAX_CORE_CLK_1US_CYCLES and
PA_VS_CORE_CLK_40NS_CYCLES to be defined for 403Mhz.
Disable clock scaling until values are determined.

Change-Id: I702a561ecce627a8b00a676fc2e6118ce1ebc4a0
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
2022-11-08 15:39:05 -08:00