Skip to content

Commit 98c9d27

Browse files
committed
drm/xe/oa: Ensure that polled read returns latest data
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@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250212010255.1423343-1-umesh.nerlige.ramappa@intel.com
1 parent 70c7273 commit 98c9d27

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ static ssize_t xe_oa_read(struct file *file, char __user *buf,
548548
mutex_unlock(&stream->stream_lock);
549549
} while (!offset && !ret);
550550
} else {
551+
xe_oa_buffer_check_unlocked(stream);
551552
mutex_lock(&stream->stream_lock);
552553
ret = __xe_oa_read(stream, buf, count, &offset);
553554
mutex_unlock(&stream->stream_lock);

0 commit comments

Comments
 (0)