> [PATCH] ide: rework the code for selecting the best DMA transfer mode

Here's another portion of comments...

> Depends on the "ide: fix UDMA/MWDMA/SWDMA masks" patch.

> * add ide_hwif_t.filter_udma_mask hook for filtering UDMA mask

Erm, maybe a shorter method name like udma_filter would go with the others better. But well, that's my taste. :-)

> (use it in alim15x3, hpt366, siimage and serverworks drivers)> * add ide_max_dma_mode() for finding best DMA mode for the device> (loosely based on some older libata-core.c code)> * convert ide_dma_speed() users to use ide_max_dma_mode()> * make ide_rate_filter() take "ide_drive_t *drive" as an argument instead> of "u8 mode" and teach it to how to use UDMA mask to do filtering> * use ide_rate_filter() in hpt366 driver> * remove no longer needed ide_dma_speed() and *_ratemask()> * unexport eighty_ninty_three()

When I think about it, it seems quite stupid to set a PIO mode instead of a requested DMA one. So, this is actually a questionable piece of code in this driver...

Well, I must note the sorrow fact that both the IDE susbsytem as a whole doesn't keep track of PIO/DMA modes separately (having only current_mode) and the many drivers also fail to handle the timing registers shared by PIO/DMA modes correctly (well, it's actually also a hardware design issue :-).