Commit 9be6fd9f authored by Ashutosh Dixit's avatar Ashutosh Dixit Committed by Thomas Hellström
Browse files

drm/xe/oa: Allow reading after disabling OA stream



Some OA data might be present in the OA buffer when OA stream is
disabled. Allow UMD's to retrieve this data, so that all data till the
point when OA stream is disabled can be retrieved.

v2: Update tail pointer after disable (Umesh)

Fixes: efb315d0 ("drm/xe/oa/uapi: Read file_operation")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: default avatarUmesh Nerlige <Ramappa&lt;umesh.nerlige.ramappa@intel.com>
Link: https://patch.msgid.link/20260313053630.3176100-1-ashutosh.dixit@intel.com


(cherry picked from commit 4ff57c5e)
Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
parent 38b8dcde
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -543,8 +543,7 @@ static ssize_t xe_oa_read(struct file *file, char __user *buf,
	size_t offset = 0;
	int ret;

	/* Can't read from disabled streams */
	if (!stream->enabled || !stream->sample)
	if (!stream->sample)
		return -EINVAL;

	if (!(file->f_flags & O_NONBLOCK)) {
@@ -1460,6 +1459,10 @@ static void xe_oa_stream_disable(struct xe_oa_stream *stream)

	if (stream->sample)
		hrtimer_cancel(&stream->poll_check_timer);

	/* Update stream->oa_buffer.tail to allow any final reports to be read */
	if (xe_oa_buffer_check_unlocked(stream))
		wake_up(&stream->poll_wq);
}

static int xe_oa_enable_preempt_timeslice(struct xe_oa_stream *stream)