Skip to content

Commit fdc39b7

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Update event log pointer as soon as processing is complete
Update event buffer head pointer once driver completes processing. So that IOMMU can write new log without waiting for driver to complete processing all event logs. Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Link: https://lore.kernel.org/r/20240828111029.5429-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 014e756 commit fdc39b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/iommu/amd/iommu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,12 @@ static void iommu_poll_events(struct amd_iommu *iommu)
825825

826826
while (head != tail) {
827827
iommu_print_event(iommu, iommu->evt_buf + head);
828+
829+
/* Update head pointer of hardware ring-buffer */
828830
head = (head + EVENT_ENTRY_SIZE) % EVT_BUFFER_SIZE;
831+
writel(head, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);
829832
}
830833

831-
writel(head, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);
832834
}
833835

834836
#ifdef CONFIG_IRQ_REMAP

0 commit comments

Comments
 (0)