[PATCH] drm/xe/oa: Ensure that polled read returns latest data

Dixit, Ashutosh ashutosh.dixit at intel.com
Wed Feb 12 02:27:01 UTC 2025


On Tue, 11 Feb 2025 17:02:55 -0800, Umesh Nerlige Ramappa wrote:
>
> In polled mode, user calls poll() for read data to be available before
> performing a read(). In the duration between these 2 calls, there may be
> new data available in the OA buffer. To ensure user reads all available
> data, check for latest data in the OA buffer in polled read.
>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_oa.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
> index fa873f3d0a9d..a692dffcb638 100644
> --- a/drivers/gpu/drm/xe/xe_oa.c
> +++ b/drivers/gpu/drm/xe/xe_oa.c
> @@ -548,6 +548,7 @@ static ssize_t xe_oa_read(struct file *file, char __user *buf,
>			mutex_unlock(&stream->stream_lock);
>		} while (!offset && !ret);
>	} else {
> +		xe_oa_buffer_check_unlocked(stream);
>		mutex_lock(&stream->stream_lock);
>		ret = __xe_oa_read(stream, buf, count, &offset);
>		mutex_unlock(&stream->stream_lock);

OK, this is what blocking read does when it gets unblocked, so this is
equivalent to blocking read.

No need to add 'Fixes:' correct?

Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>


More information about the Intel-xe mailing list