Skip to contentSkip to conversation

Kernel diff_small_2.4.5pre4_2.4.5pre5

DISCUSSION Andrea Arcangeli 1 participant 1 message May 22, 2001 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 16 lines · Andrea Arcangeli

diff -urN 2.4.5pre4/arch/alpha/kernel/pci_iommu.c 2.4.5pre5/arch/alpha/kernel/pci_iommu.c

arch/alpha/kernel/pci_iommu.c +7 -2
@@ -402,8 +402,20 @@
 	paddr &= ~PAGE_MASK;
 	npages = calc_npages(paddr + size);
 	dma_ofs = iommu_arena_alloc(arena, npages);
-	if (dma_ofs < 0)
-		return -1;
+	if (dma_ofs < 0) {
+		/* If we attempted a direct map above but failed, die.  */
+		if (leader->dma_address == 0)
+			return -1;
+
+		/* Otherwise, break up the remaining virtually contiguous
+		   hunks into individual direct maps.  */

arch/alpha/kernel/pci_iommu.c line 421

Quoted 10 lines
arch/alpha/kernel/pci_iommu.c +7 -0
+		for (sg = leader; sg < end; ++sg)
+			if (sg->dma_address == 2 || sg->dma_address == -2)
+				sg->dma_address = 0;
+
+		/* Retry.  */
+		return sg_fill(leader, end, out, arena, max_dma);
+	}
 
 	out->dma_address = arena->dma_base + dma_ofs*PAGE_SIZE + paddr;
 	out->dma_length = size;

this is just broken as I said a few hours ago on l-k. please replace == 2 with == 1 as described in earlier email. However it's not a showstopper because it will trigger only after running of pci mappings (and by that time things are going to break pretty soon anyways on the much bigger than 2G boxes, where the 2G direct window has low probablity to save you), the fact I found this patch in in I assume is your agreemnt that the pci mapping bugs are an issue also for 2.4, good.

I couldn't hack all the day long today, I will finish the alpha updates before tomorrow though.

Andrea