summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
diff options
context:
space:
mode:
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>2020-03-04 13:07:00 -0500
committerAlex Deucher <alexander.deucher@amd.com>2020-03-05 00:33:30 -0500
commit6863d60732acf57c86e70558640ae357a83bce0f (patch)
tree050f984d0750426339a983d5130ccc40877064a5 /drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
parent57430471e2fa60a412e220fa3014567e792aaa6f (diff)
downloadlinux-6863d60732acf57c86e70558640ae357a83bce0f.tar.bz2
drm/amdgpu: Wrap clflush_cache_range with x86 ifdef
To avoid compile errors on other platforms. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index cff0fd27762e..3836acc2e95e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -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);