Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145883
b: refs/heads/master
c: 7e05575
h: refs/heads/master
i:
  145881: 8e5743f
  145879: 2aa8d68
v: v3
  • Loading branch information
FUJITA Tomonori authored and Ingo Molnar committed Apr 14, 2009
1 parent fbefad5 commit 110f2a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 53 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: 42d7c5e353cef9062129b0de3ec9ddf10567b9ca
refs/heads/master: 7e05575c422d45f393c2d9b5900e97a30bf69bea
54 changes: 2 additions & 52 deletions trunk/arch/x86/kernel/pci-calgary_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,37 +186,6 @@ static struct cal_chipset_ops calioc2_chip_ops = {

static struct calgary_bus_info bus_info[MAX_PHB_BUS_NUM] = { { NULL, 0, 0 }, };

/* enable this to stress test the chip's TCE cache */
#ifdef CONFIG_IOMMU_DEBUG
static int debugging = 1;

static inline unsigned long verify_bit_range(unsigned long* bitmap,
int expected, unsigned long start, unsigned long end)
{
unsigned long idx = start;

BUG_ON(start >= end);

while (idx < end) {
if (!!test_bit(idx, bitmap) != expected)
return idx;
++idx;
}

/* all bits have the expected value */
return ~0UL;
}
#else /* debugging is disabled */
static int debugging;

static inline unsigned long verify_bit_range(unsigned long* bitmap,
int expected, unsigned long start, unsigned long end)
{
return ~0UL;
}

#endif /* CONFIG_IOMMU_DEBUG */

static inline int translation_enabled(struct iommu_table *tbl)
{
/* only PHBs with translation enabled have an IOMMU table */
Expand All @@ -228,7 +197,6 @@ static void iommu_range_reserve(struct iommu_table *tbl,
{
unsigned long index;
unsigned long end;
unsigned long badbit;
unsigned long flags;

index = start_addr >> PAGE_SHIFT;
Expand All @@ -243,14 +211,6 @@ static void iommu_range_reserve(struct iommu_table *tbl,

spin_lock_irqsave(&tbl->it_lock, flags);

badbit = verify_bit_range(tbl->it_map, 0, index, end);
if (badbit != ~0UL) {
if (printk_ratelimit())
printk(KERN_ERR "Calgary: entry already allocated at "
"0x%lx tbl %p dma 0x%lx npages %u\n",
badbit, tbl, start_addr, npages);
}

iommu_area_reserve(tbl->it_map, index, npages);

spin_unlock_irqrestore(&tbl->it_lock, flags);
Expand Down Expand Up @@ -326,7 +286,6 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
unsigned int npages)
{
unsigned long entry;
unsigned long badbit;
unsigned long badend;
unsigned long flags;

Expand All @@ -346,14 +305,6 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,

spin_lock_irqsave(&tbl->it_lock, flags);

badbit = verify_bit_range(tbl->it_map, 1, entry, entry + npages);
if (badbit != ~0UL) {
if (printk_ratelimit())
printk(KERN_ERR "Calgary: bit is off at 0x%lx "
"tbl %p dma 0x%Lx entry 0x%lx npages %u\n",
badbit, tbl, dma_addr, entry, npages);
}

iommu_area_free(tbl->it_map, entry, npages);

spin_unlock_irqrestore(&tbl->it_lock, flags);
Expand Down Expand Up @@ -1488,9 +1439,8 @@ void __init detect_calgary(void)
iommu_detected = 1;
calgary_detected = 1;
printk(KERN_INFO "PCI-DMA: Calgary IOMMU detected.\n");
printk(KERN_INFO "PCI-DMA: Calgary TCE table spec is %d, "
"CONFIG_IOMMU_DEBUG is %s.\n", specified_table_size,
debugging ? "enabled" : "disabled");
printk(KERN_INFO "PCI-DMA: Calgary TCE table spec is %d\n",
specified_table_size);

/* swiotlb for devices that aren't behind the Calgary. */
if (max_pfn > MAX_DMA32_PFN)
Expand Down

0 comments on commit 110f2a4

Please sign in to comment.