Skip to content

Commit

Permalink
drm/xe: Fix dequeue of access counter work item
Browse files Browse the repository at this point in the history
The access counters worker function is fixed to advance the head pointer
when dequeuing from the acc_queue.  This now matches the similar logic in
get_pagefault().

Signed-off-by: Bruce Chang <[email protected]>
Signed-off-by: Brian Welty <[email protected]>
Reviewed-by: Stuart Summers <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
  • Loading branch information
brianwelty authored and rodrigovivi committed Dec 21, 2023
1 parent 81d11b9 commit 74a6c64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/drm/xe/xe_gt_pagefault.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ static int handle_acc(struct xe_gt *gt, struct acc *acc)

#define make_u64(hi__, low__) ((u64)(hi__) << 32 | (u64)(low__))

#define ACC_MSG_LEN_DW 4

static int get_acc(struct acc_queue *acc_queue, struct acc *acc)
{
const struct xe_guc_acc_desc *desc;
Expand All @@ -562,6 +564,9 @@ static int get_acc(struct acc_queue *acc_queue, struct acc *acc)
acc->access_type = FIELD_GET(ACC_TYPE, desc->dw0);
acc->va_range_base = make_u64(desc->dw3 & ACC_VIRTUAL_ADDR_RANGE_HI,
desc->dw2 & ACC_VIRTUAL_ADDR_RANGE_LO);

acc_queue->head = (acc_queue->head + ACC_MSG_LEN_DW) %
ACC_QUEUE_NUM_DW;
} else {
ret = -1;
}
Expand Down Expand Up @@ -589,8 +594,6 @@ static void acc_queue_work_func(struct work_struct *w)
}
}

#define ACC_MSG_LEN_DW 4

static bool acc_queue_full(struct acc_queue *acc_queue)
{
lockdep_assert_held(&acc_queue->lock);
Expand Down

0 comments on commit 74a6c64

Please sign in to comment.