All of lore.kernel.org
 help / color / mirror / Atom feed
* Choosing scatter/gather limits
@ 2004-10-11 10:53 Pierre Ossman
  2004-10-13 11:22 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Ossman @ 2004-10-11 10:53 UTC (permalink / raw)
  To: LKML

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Choosing scatter/gather limits
  2004-10-11 10:53 Choosing scatter/gather limits Pierre Ossman
@ 2004-10-13 11:22 ` Russell King
  2004-10-13 12:48   ` Pierre Ossman
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2004-10-13 11:22 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML

On Mon, Oct 11, 2004 at 12:53:23PM +0200, Pierre Ossman wrote:
> 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.

It seems that you have to read the block layer code to find out what's
going on with these limits.  There's some documentation on it in
Documentation/block/bio.txt.  If it's lacking, then please send
comments to the block layer people to add the necessary information.

Please also note that I'm intending to make the MMC host drivers
know nothing about block IO stuff, so all you'll be passed is the
MMC commands and a scatter gather list - so making sure that your
driver always uses blk_rq_map_sg() and works from the SG list will
ensure that your driver remains easy to update.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Choosing scatter/gather limits
  2004-10-13 11:22 ` Russell King
@ 2004-10-13 12:48   ` Pierre Ossman
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Ossman @ 2004-10-13 12:48 UTC (permalink / raw)
  To: Russell King; +Cc: LKML

Russell King wrote:

>On Mon, Oct 11, 2004 at 12:53:23PM +0200, Pierre Ossman wrote:
>  
>
>>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.
>>    
>>
>
>It seems that you have to read the block layer code to find out what's
>going on with these limits.  There's some documentation on it in
>Documentation/block/bio.txt.  If it's lacking, then please send
>comments to the block layer people to add the necessary information.
>
>  
>
I just wanted to make sure I don't pick values that causes problems 
somewhere else. I'll make an attempt to dig through the bio code though.

>Please also note that I'm intending to make the MMC host drivers
>know nothing about block IO stuff, so all you'll be passed is the
>MMC commands and a scatter gather list - so making sure that your
>driver always uses blk_rq_map_sg() and works from the SG list will
>ensure that your driver remains easy to update.
>
>  
>
Shouldn't be a problem. The SGIO support in the driver is done. Just 
need to get rid of all bugs.

Rgds
Pierre



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-13 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 10:53 Choosing scatter/gather limits Pierre Ossman
2004-10-13 11:22 ` Russell King
2004-10-13 12:48   ` Pierre Ossman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.