diff options
author | Vasant Hegde <vasant.hegde@amd.com> | 2024-08-28 14:10:22 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2024-09-04 12:34:11 +0300 |
commit | fdc39b77db95e36f6b4d3c006a2642b9f47510c5 (patch) | |
tree | 3e71f220723388a52ab727f6bf6bfdf71fbf05f0 /drivers/iommu/amd/iommu.c | |
parent | 014e756247e847cde8a06fc27ee3a72a5140b972 (diff) | |
download | linux-fdc39b77db95e36f6b4d3c006a2642b9f47510c5.tar.xz |
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>
Diffstat (limited to 'drivers/iommu/amd/iommu.c')
-rw-r--r-- | drivers/iommu/amd/iommu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 87c5385ce3f2..8ada0b227ca1 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -825,10 +825,12 @@ static void iommu_poll_events(struct amd_iommu *iommu) while (head != tail) { iommu_print_event(iommu, iommu->evt_buf + head); + + /* Update head pointer of hardware ring-buffer */ head = (head + EVENT_ENTRY_SIZE) % EVT_BUFFER_SIZE; + writel(head, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET); } - writel(head, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET); } #ifdef CONFIG_IRQ_REMAP |