Subject: DMA memory on IP22 unavailable ?

From: Florian Lohoff <[email-masked]>
Date: Thu, 6 Apr 2000 21:50:16 +0200

Hi,
i have fixed the original problem with the bootmem initialization 
for ARC which didnt reserve the kernel pages as unallocatable - This
is already committed to CVS for the ones trying on IP22. Now i have
a different problems - The kernel halts on further boot with
no memory for SCSI DMA.

This is due to my indigo2 having physical memory from
0x08002000 - 0x08740000
0x08200000 - 0x0ff85000

Now the official DMA able memory from include/asm/dma.h is

#define MAX_DMA_ADDRESS         (PAGE_OFFSET + 0x01000000)

which is 0x81000000 which is completely out of range for
the SGI. I now just changed this to 8f000000 but what
is the correct way to solve this and what is the correct
dma able memory (I suppose all memory is dma-able).

-- 
Florian Lohoff		[email-masked]		      	+49-subject-2-change
"Technology is a constant battle between manufacturers producing bigger and
more idiot-proof systems and nature producing bigger and better idiots."

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 6 Apr 2000 15:37:41 -0700

> dma able memory (I suppose all memory is dma-able).

This change is not acceptable for the IP22 because the Indigo2 has EISA
slots.

When only using the builtin SCSI hostadapter nothing should use GFP_DMA;
on IP22 the entire memory is DMA-able.

  Ralf

---

From: Florian Lohoff <[email-masked]>
Date: Fri, 7 Apr 2000 10:13:46 +0200

> This change is not acceptable for the IP22 because the Indigo2 has EISA

OK 

> on IP22 the entire memory is DMA-able.

It does request DMA pages which are not available within the zone allocator
or at least not because the kernel occupies the dma able pages
with the setup above. That causes the SCSI Partition scan to fail
as scsi_dma.c requests space for 96 dmaable sectors which are not available.

A couple of locations in the generic scsi code call scsi_resize_dma_pool
which itself tries to get DMA memory via

__get_free_pages(GFP_ATOMIC | GFP_DMA, 0);

Which trys to get pages from ZONE_DMA which itself contains
no free pages on MY indigo2 as the kernel occoupies the handful pages in
the default specified range. This causes scsi_resize_dma_pool to fail
but the locations i checked in the generic scsi code do not check
for return values.

BTW: Are the EISA slots supported ? 
     Does the "Default" MAX_DMA_ADDRESS apply to that DMA controller ?
     My above solution just declares all memory to DMA-able memory.

Solution ?

Flo

---

From: Florian Lohoff <[email-masked]>
Date: Fri, 7 Apr 2000 10:20:38 +0200

>      My above solution just declares all memory to DMA-able memory.

BTW: With above solution i meant a thread with Geert which contained a
probably better solution.

This is arch/mips/mm/init.c - Which puts all memory into ZONE_DMA when
no ISA or PCI available.

#if defined(CONFIG_ISA) || defined(CONFIG_PCI)
        if (low < max_dma)
                zones_size[ZONE_DMA] = low;
        else {
                zones_size[ZONE_DMA] = max_dma;
                zones_size[ZONE_NORMAL] = low - max_dma;
        }
#else
        zones_size[ZONE_DMA] = low;
#endif

Flo