~ubuntu-branches/ubuntu/wily/linux-ti-omap4/wily

« back to all changes in this revision

Viewing changes to drivers/iommu/amd_iommu.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2013-07-11 18:35:20 UTC
  • Revision ID: package-import@ubuntu.com-20130711183520-htnf1x4y5r11hndr
Tags: 3.5.0-229.42
* Release Tracking Bug
  - LP: #1199276

[ Paolo Pisati ]

* [Config] CONFIG_ATH9K_LEGACY_RATE_CONTROL is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
531
531
 
532
532
static void iommu_poll_events(struct amd_iommu *iommu)
533
533
{
534
 
        u32 head, tail;
 
534
        u32 head, tail, status;
535
535
        unsigned long flags;
536
536
 
537
537
        spin_lock_irqsave(&iommu->lock, flags);
538
538
 
 
539
        /* enable event interrupts again */
 
540
        do {
 
541
                /*
 
542
                 * Workaround for Erratum ERBT1312
 
543
                 * Clearing the EVT_INT bit may race in the hardware, so read
 
544
                 * it again and make sure it was really cleared
 
545
                 */
 
546
                status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
 
547
                writel(MMIO_STATUS_EVT_INT_MASK,
 
548
                       iommu->mmio_base + MMIO_STATUS_OFFSET);
 
549
        } while (status & MMIO_STATUS_EVT_INT_MASK);
 
550
 
539
551
        head = readl(iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);
540
552
        tail = readl(iommu->mmio_base + MMIO_EVT_TAIL_OFFSET);
541
553
 
572
584
static void iommu_poll_ppr_log(struct amd_iommu *iommu)
573
585
{
574
586
        unsigned long flags;
575
 
        u32 head, tail;
 
587
        u32 head, tail, status;
576
588
 
577
589
        if (iommu->ppr_log == NULL)
578
590
                return;
579
591
 
 
592
        spin_lock_irqsave(&iommu->lock, flags);
 
593
 
580
594
        /* enable ppr interrupts again */
581
 
        writel(MMIO_STATUS_PPR_INT_MASK, iommu->mmio_base + MMIO_STATUS_OFFSET);
582
 
 
583
 
        spin_lock_irqsave(&iommu->lock, flags);
 
595
        do {
 
596
                /*
 
597
                 * Workaround for Erratum ERBT1312
 
598
                 * Clearing the PPR_INT bit may race in the hardware, so read
 
599
                 * it again and make sure it was really cleared
 
600
                 */
 
601
                status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
 
602
                writel(MMIO_STATUS_PPR_INT_MASK,
 
603
                       iommu->mmio_base + MMIO_STATUS_OFFSET);
 
604
        } while (status & MMIO_STATUS_PPR_INT_MASK);
584
605
 
585
606
        head = readl(iommu->mmio_base + MMIO_PPR_HEAD_OFFSET);
586
607
        tail = readl(iommu->mmio_base + MMIO_PPR_TAIL_OFFSET);