Преглед изворни кода

cnss2: Use IOMMU_CACHE flag for audio smmu mappings

WLAN IOMMU mappings have cached attribute set whereas
ADSP IOMMU mappings do not have cached attribute set.
This is resulting in an inconsistent memory view between
ADSP SS and WLAN SS. ADSP writes to a DDR location and
WLAN HW reads from the same location but since access is
cached from WLAN side, there is a possibility of reading
incorrect values.

Fix is to use IOMMU_CACHE flag for audio smmu mappings.

Change-Id: Ife97bee34bc8224fd2d0d2bb45b606efeea5aa53
CRs-Fixed: 3375521
Yeshwanth Sriram Guntuka пре 2 година
родитељ
комит
a1b93f1d72
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      cnss2/main.c

+ 3 - 2
cnss2/main.c

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/delay.h>
@@ -494,7 +494,8 @@ int cnss_audio_smmu_map(struct device *dev, phys_addr_t paddr,
 	paddr -= page_offset;
 
 	return iommu_map(plat_priv->audio_iommu_domain, iova, paddr,
-			 roundup(size, PAGE_SIZE), IOMMU_READ | IOMMU_WRITE);
+			 roundup(size, PAGE_SIZE), IOMMU_READ | IOMMU_WRITE |
+			 IOMMU_CACHE);
 }
 EXPORT_SYMBOL(cnss_audio_smmu_map);