Alan Cox wrote:
>> It's for draining.  Let's say drive says it wanna transfer 18 bytes but
>> the buffer is only 13 bytes long.  If the transfer method consumes 2
>> bytes per read, it would consume 14 bytes.  If the transfer method
>> consumes 4 bytes per read, it would consume 16 bytes.  If we drain too
>> much, we risk hanging the machine.
> 
> Do we have any actual cases where trying to drain beyond the controller
> granuality is a problem ?
> 
> Might be cleaner to sort this (and the DMA assumption of 2 byte
> alignment, and possibly 16 byte for some devices/controllers) with 
> 
>       dev->pio_io_size;
>       dev->dma_io_size;
> 

That could be cleaner although slightly less flexible.  For example, a
driver may do 32bit IOs normally but choose to do smaller size IO at the
end for whatever reason.

DMA alignment is host restriction so I think it belongs to ata_host if
we ever need it.  Do you know of any controller which require such
thing?  No need to add complexity when it's not necessary.

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to