Skip to contentSkip to conversation

drm/amdgpu: Wrap clflush_cache_range with x86 ifdef

PATCH In review Andrey Grodzovsky 2 participants 2 messages Mar 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Wrap clflush_cache_range with x86 ifdef

To avoid compile errors on other platforms.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +8 -1
index cff0fd2..3836acc 100644
@@ -1883,8 +1883,15 @@ static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev,
 
 	memcpy_toio(cpu_addr, usbc_pd_fw->data, usbc_pd_fw->size);
 
-	/*TODO Remove once PSP starts snooping CPU cache */
+	/*
+	 * x86 specific workaround.
+	 * Without it the buffer is invisible in PSP.
+	 *
+	 * TODO Remove once PSP starts snooping CPU cache
+	 */
+#ifdef CONFIG_X86
 	clflush_cache_range(cpu_addr, (usbc_pd_fw->size & ~(L1_CACHE_BYTES - 1)));
+#endif
 
 	mutex_lock(&adev->psp.mutex);
 	ret = psp_load_usbc_pd_fw(&adev->psp, dma_addr);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Public Use]

________________________________
From: Andrey Grodzovsky <[email protected]>
Sent: Wednesday, March 4, 2020 1:08 PM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Grodzovsky, Andrey <[email protected]>
Subject: [PATCH] drm/amdgpu: Wrap clflush_cache_range with x86 ifdef

To avoid compile errors on other platforms.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +8 -1
index cff0fd2..3836acc 100644
@@ -1883,8 +1883,15 @@ static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev,
 
         memcpy_toio(cpu_addr, usbc_pd_fw->data, usbc_pd_fw->size);
 
-       /*TODO Remove once PSP starts snooping CPU cache */
+       /*
+        * x86 specific workaround.
+        * Without it the buffer is invisible in PSP.
+        *
+        * TODO Remove once PSP starts snooping CPU cache
+        */
+#ifdef CONFIG_X86
         clflush_cache_range(cpu_addr, (usbc_pd_fw->size & ~(L1_CACHE_BYTES - 1)));
+#endif
 
         mutex_lock(&adev->psp.mutex);
         ret = psp_load_usbc_pd_fw(&adev->psp, dma_addr);

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx