Skip to content

Commit 9be6fd9

Browse files
ashutoshxThomas Hellström
authored andcommitted
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: efb315d ("drm/xe/oa/uapi: Read file_operation") Cc: [email protected] Signed-off-by: Ashutosh Dixit <[email protected]> Reviewed-by: Umesh Nerlige Ramappa<[email protected]> Link: https://patch.msgid.link/[email protected] (cherry picked from commit 4ff57c5) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 38b8dcd commit 9be6fd9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ static ssize_t xe_oa_read(struct file *file, char __user *buf,
543543
size_t offset = 0;
544544
int ret;
545545

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

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

14611460
if (stream->sample)
14621461
hrtimer_cancel(&stream->poll_check_timer);
1462+
1463+
/* Update stream->oa_buffer.tail to allow any final reports to be read */
1464+
if (xe_oa_buffer_check_unlocked(stream))
1465+
wake_up(&stream->poll_wq);
14631466
}
14641467

14651468
static int xe_oa_enable_preempt_timeslice(struct xe_oa_stream *stream)

0 commit comments

Comments
 (0)