Choosing scatter/gather limits

From: Pierre Ossman
Date: Mon Oct 11 2004 - 05:55:25 EST


I've been adding scatter/gather support for the MMC host driver I'm writing. I cannot find any documentation on how to chose the limits though.

The device is an ISA device capable of DMA and PIO transfers. The scatter/gather system seems to be designed for PCI but I figured it could be used here aswell. Should save the time needed to shuffle stuff into a common buffer (or doing a lot of requests).

When in DMA mode the maximum segment size is 64kB (since ISA DMA cannot transfer larger blocks). The maximum sector limit should perhaps be 128 then. I don't know if 512 bytes per sector is something you can rely on. The MMC cards can (in theory) choose any sector size they want.

In PIO mode the segment size and sector count doesn't have an upper limit. I just traverse the scatter list as I read data.

The segment counts are also unlimited since these parts are handled in software.

So how do I choose these values? The segment counts affect memory usage (since I have to allocate the scatterlist) but the others are just a matter of how much data can be stuffed into one request. Should they be set to 0xffffffff then?

Rgds
Pierre Ossman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/