[PATCH] drm/etnaviv: during dump, read registers twice

Derek Foreman derek.foreman at collabora.com
Fri May 3 14:22:55 UTC 2024


The vivante driver always reads dma registers twice and discards the first
value - we need to do this too or at least the DMA address and low/high
fetches can return wrong results.

Signed-off-by: Derek Foreman <derek.foreman at collabora.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_dump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_dump.c b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
index 898f84a0fc30..8a8ca8dcc49a 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
@@ -91,6 +91,8 @@ static void etnaviv_core_dump_registers(struct core_dump_iterator *iter,
 		    read_addr <= VIVS_PM_PULSE_EATER)
 			read_addr = gpu_fix_power_address(gpu, read_addr);
 		reg->reg = cpu_to_le32(etnaviv_dump_registers[i]);
+		/* Discard first read, as it is frequently inaccurate */
+		gpu_read(gpu, read_addr);
 		reg->value = cpu_to_le32(gpu_read(gpu, read_addr));
 	}
 
-- 
2.44.0



More information about the etnaviv mailing list