Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373567
b: refs/heads/master
c: d3263bc
h: refs/heads/master
i:
  373565: 4146a50
  373563: f2eaaac
  373559: 5900b7e
  373551: 212879f
  373535: 887dbfc
  373503: 74e2e03
v: v3
  • Loading branch information
Joerg Roedel committed Apr 19, 2013
1 parent ef0b555 commit e9d709d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d8bfa26f236bc9528415402dda6b498a0682e42
refs/heads/master: d3263bc29706e42f74d8800807c2dedf320d77f1
34 changes: 26 additions & 8 deletions trunk/drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,23 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)

static void iommu_poll_events(struct amd_iommu *iommu)
{
u32 head, tail;
u32 head, tail, status;
unsigned long flags;

/* enable event interrupts again */
writel(MMIO_STATUS_EVT_INT_MASK, iommu->mmio_base + MMIO_STATUS_OFFSET);

spin_lock_irqsave(&iommu->lock, flags);

/* enable event interrupts again */
do {
/*
* Workaround for Erratum ERBT1312
* Clearing the EVT_INT bit may race in the hardware, so read
* it again and make sure it was really cleared
*/
status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
writel(MMIO_STATUS_EVT_INT_MASK,
iommu->mmio_base + MMIO_STATUS_OFFSET);
} while (status & MMIO_STATUS_EVT_INT_MASK);

head = readl(iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);
tail = readl(iommu->mmio_base + MMIO_EVT_TAIL_OFFSET);

Expand Down Expand Up @@ -744,16 +753,25 @@ static void iommu_handle_ppr_entry(struct amd_iommu *iommu, u64 *raw)
static void iommu_poll_ppr_log(struct amd_iommu *iommu)
{
unsigned long flags;
u32 head, tail;
u32 head, tail, status;

if (iommu->ppr_log == NULL)
return;

/* enable ppr interrupts again */
writel(MMIO_STATUS_PPR_INT_MASK, iommu->mmio_base + MMIO_STATUS_OFFSET);

spin_lock_irqsave(&iommu->lock, flags);

/* enable ppr interrupts again */
do {
/*
* Workaround for Erratum ERBT1312
* Clearing the PPR_INT bit may race in the hardware, so read
* it again and make sure it was really cleared
*/
status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
writel(MMIO_STATUS_PPR_INT_MASK,
iommu->mmio_base + MMIO_STATUS_OFFSET);
} while (status & MMIO_STATUS_PPR_INT_MASK);

head = readl(iommu->mmio_base + MMIO_PPR_HEAD_OFFSET);
tail = readl(iommu->mmio_base + MMIO_PPR_TAIL_OFFSET);

Expand Down

0 comments on commit e9d709d

Please sign in to comment.