[PATCH v11 5/8] drm/xe/eustall: Add support to handle dropped EU stall data
Dixit, Ashutosh
ashutosh.dixit at intel.com
Tue Feb 25 23:34:52 UTC 2025
On Tue, 25 Feb 2025 01:20:22 -0800, Harish Chegondi wrote:
>
> static int xe_eu_stall_data_buf_read(struct xe_eu_stall_data_stream *stream,
> char __user *buf, size_t count,
> size_t *total_data_size, struct xe_gt *gt,
> @@ -362,6 +378,9 @@ static int xe_eu_stall_data_buf_read(struct xe_eu_stall_data_stream *stream,
> buf_size = stream->per_xecore_buf_size;
>
> read_data_size = buf_data_size(buf_size, read_ptr, write_ptr);
> + if (read_data_size == 0)
> + goto exit_drop;
> +
This is not needed. Just add the 'goto exit_drop;' to the 'if
(read_data_size == 0)' a couple of lines below.
> /* Read only the data that the user space buffer can accommodate */
> read_data_size = min_t(size_t, count - *total_data_size, read_data_size);
> if (read_data_size == 0)
Add 'goto exit_drop;' here instead of 'return 0;'.
Note that here count must be > *total_data_size, because in
xe_eu_stall_stream_read_locked, we break out and don't call
xe_eu_stall_data_buf_read() if count == total_size. Therefore, for
read_data_size to be 0 here, read_data_size on the right hand side must
already be zero. So the two 'goto exit_drop;''s are equivalent.
After moving the 'goto exit_drop;' this patch is also:
Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
More information about the Intel-xe
mailing list