Lines Matching refs:tail

214 #define OA_TAKEN(tail, head)	((tail - head) & (OA_BUFFER_SIZE - 1))
219 * There's a HW race condition between OA unit tail pointer register updates and
220 * writes to memory whereby the tail pointer can sometimes get ahead of what's
225 * by checking for a zeroed report-id field in tail reports, we want to account
230 * in the OA buffer, starting from the tail reported by the HW until we find a
241 * Note for posterity: previously the driver used to define an effective tail
242 * pointer that lagged the real pointer by a 'tail margin' measured in bytes
300 * be used as a mask to align the OA tail pointer.
438 * oa_buffer_check_unlocked - check for data and update tail ptr state
442 * check hrtimer (atomic ctx) to check the OA buffer tail pointer and check
445 * This function is central to providing a workaround for the OA unit tail
447 * It is responsible for reading tail pointers from the hardware and giving
452 * also updates the tail, aging_tail and aging_timestamp in the oa_buffer
472 * tail state.
478 /* The tail pointer increases in 64 byte increments,
487 /* If the HW tail hasn't move since the last check and the HW
488 * tail has been aging for long enough, declare it the new
489 * tail.
491 stream->oa_buffer.tail = stream->oa_buffer.aging_tail;
493 u32 head, tail, aged_tail;
497 * anywhere between this head and stream->oa_buffer.tail.
500 aged_tail = stream->oa_buffer.tail - gtt_offset;
503 tail = hw_tail;
516 while (OA_TAKEN(tail, aged_tail) >= report_size) {
517 u32 *report32 = (void *)(stream->oa_buffer.vaddr + tail);
522 tail = (tail - report_size) & (OA_BUFFER_SIZE - 1);
525 if (OA_TAKEN(hw_tail, tail) > report_size &&
528 "tail=0x%x hw_tail=0x%x\n",
529 head, tail, hw_tail);
531 stream->oa_buffer.tail = gtt_offset + tail;
536 pollin = OA_TAKEN(stream->oa_buffer.tail - gtt_offset,
638 * tail, so the tail chases the head?... If you think that's mad
656 u32 head, tail;
666 tail = stream->oa_buffer.tail;
671 * NB: oa_buffer.head/tail include the gtt_offset which we don't want
675 tail -= gtt_offset;
678 * An out of bounds or misaligned head or tail pointer implies a driver
679 * bug since we validate + align the tail pointers we read from the
686 tail > OA_BUFFER_SIZE || tail % report_size,
687 "Inconsistent OA buffer pointers: head = %u, tail = %u\n",
688 head, tail))
693 (taken = OA_TAKEN(tail, head));
935 * tail, so the tail chases the head?... If you think that's mad
953 u32 head, tail;
963 tail = stream->oa_buffer.tail;
967 /* NB: oa_buffer.head/tail include the gtt_offset which we don't want
971 tail -= gtt_offset;
973 /* An out of bounds or misaligned head or tail pointer implies a driver
974 * bug since we validate + align the tail pointers we read from the
981 tail > OA_BUFFER_SIZE || tail % report_size,
982 "Inconsistent OA buffer pointers: head = %u, tail = %u\n",
983 head, tail))
988 (taken = OA_TAKEN(tail, head));
1081 * bits while the OA unit is enabled (while the tail pointer
1103 * guard band between head/tail, avoiding this overflow
1416 intel_uncore_write(uncore, GEN7_OASTATUS1, /* tail */
1419 /* Mark that we need updated tail pointers to read from... */
1421 stream->oa_buffer.tail = gtt_offset;
1471 /* Mark that we need updated tail pointers to read from... */
1473 stream->oa_buffer.tail = gtt_offset;
1525 /* Mark that we need updated tail pointers to read from... */
1527 stream->oa_buffer.tail = gtt_offset;