accel/ivpu: Use cached buffers for FW loading
authorKarol Wachowski <karol.wachowski@linux.intel.com>
Tue, 26 Sep 2023 12:09:43 +0000 (14:09 +0200)
committerStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Wed, 27 Sep 2023 05:40:43 +0000 (07:40 +0200)
commit645d694559cab36fe6a57c717efcfa27d9321396
treeba9908c30790c1d488e98fc5de5ed8fc50b27191
parent09bb81cf243d151dd1c02fcd727a4604829d9927
accel/ivpu: Use cached buffers for FW loading

Create buffers with cache coherency on the CPU side (write-back) while
disabling snooping on the VPU side. These buffers require an explicit
cache flush after each CPU-side modification.

Configuring pages as write-combined may introduce significant delays,
potentially taking hundreds of milliseconds for 64 MB buffers.

Added internal DRM_IVPU_BO_NOSNOOP mask which disables snooping on the
VPU side. Allocate FW runtime memory buffer (64 MB) as cached with
snooping-disabled.

This fixes random long FW loading times and boot params memory
corruption on warmboot (due to missed wmb).

Fixes: 02d5b0aacd05 ("accel/ivpu: Implement firmware parsing and booting")
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230926120943.GD846747@linux.intel.com
drivers/accel/ivpu/ivpu_fw.c
drivers/accel/ivpu/ivpu_gem.h