Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3610f211 authored by Joerg Roedel's avatar Joerg Roedel Committed by Ingo Molnar
Browse files

x86/iommu: convert GART need_flush to bool



Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 237a6224
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ AGPEXTERN int agp_memory_reserved;
AGPEXTERN __u32 *agp_gatt_table;
AGPEXTERN __u32 *agp_gatt_table;


static unsigned long next_bit;  /* protected by iommu_bitmap_lock */
static unsigned long next_bit;  /* protected by iommu_bitmap_lock */
static int need_flush;		/* global flush state. set for each gart wrap */
static bool need_flush;		/* global flush state. set for each gart wrap */


static unsigned long alloc_iommu(struct device *dev, int size,
static unsigned long alloc_iommu(struct device *dev, int size,
				 unsigned long align_mask)
				 unsigned long align_mask)
@@ -98,7 +98,7 @@ static unsigned long alloc_iommu(struct device *dev, int size,
	offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, next_bit,
	offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, next_bit,
				  size, base_index, boundary_size, align_mask);
				  size, base_index, boundary_size, align_mask);
	if (offset == -1) {
	if (offset == -1) {
		need_flush = 1;
		need_flush = true;
		offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, 0,
		offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, 0,
					  size, base_index, boundary_size,
					  size, base_index, boundary_size,
					  align_mask);
					  align_mask);
@@ -107,11 +107,11 @@ static unsigned long alloc_iommu(struct device *dev, int size,
		next_bit = offset+size;
		next_bit = offset+size;
		if (next_bit >= iommu_pages) {
		if (next_bit >= iommu_pages) {
			next_bit = 0;
			next_bit = 0;
			need_flush = 1;
			need_flush = true;
		}
		}
	}
	}
	if (iommu_fullflush)
	if (iommu_fullflush)
		need_flush = 1;
		need_flush = true;
	spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
	spin_unlock_irqrestore(&iommu_bitmap_lock, flags);


	return offset;
	return offset;
@@ -136,7 +136,7 @@ static void flush_gart(void)
	spin_lock_irqsave(&iommu_bitmap_lock, flags);
	spin_lock_irqsave(&iommu_bitmap_lock, flags);
	if (need_flush) {
	if (need_flush) {
		k8_flush_garts();
		k8_flush_garts();
		need_flush = 0;
		need_flush = false;
	}
	}
	spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
	spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
}
}