drm/xe/eustall: Return ENODEV from read if EU stall registers get reset
authorHarish Chegondi <harish.chegondi@intel.com>
Wed, 15 Apr 2026 18:27:17 +0000 (11:27 -0700)
committerAshutosh Dixit <ashutosh.dixit@intel.com>
Fri, 8 May 2026 20:38:39 +0000 (13:38 -0700)
commit71477b7e702c88f214866a3dc400812a5da59905
tree8acd30cca21767824f5feb0d953f19d3dae4bce9
parent5dd993ef9d5e70b05adac92b3fb2f079b0a3fe1a
drm/xe/eustall: Return ENODEV from read if EU stall registers get reset

If a reset (GT or engine) happens during EU stall data sampling, all the
EU stall registers can get reset to 0. This will result in EU stall data
buffers' read and write pointer register values to be out of sync with
the cached values. This will result in read() returning invalid data. To
prevent this, check the value of a EU stall base register. If it is zero,
it indicates a reset may have happened that wiped the register to zero.
If this happens, return ENODEV from read() upon which the user space
should disable and enable EU stall data sampling or close the fd and
open a new fd for a new EU stall data collection session.

This patch has been tested by running two IGT tests simultaneously
xe_eu_stall and xe_exec_reset.

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: Felix Degrood <felix.j.degrood@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/6935698d70b6c7c347ff8b138209d601030c2c9f.1776200094.git.harish.chegondi@intel.com
drivers/gpu/drm/xe/xe_eu_stall.c