[PATCH] 2.5.24: generic ATA PCI auto-dma tuning (1/5)

Bartlomiej Zolnierkiewicz (B.Zolnierkiewicz@elka.pw.edu.pl)
Tue, 25 Jun 2002 21:13:54 +0200 (MET DST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-1804928587-1025032434=:27820
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi!

This is first of five patches implementing generic ATA host chips
(U)DMA auto-tuning... against 2.5.24 but should also apply cleanly
to 2.5.24 + Martin's ide-clean-94 patch...

Lot of duplicated code is removed and simple, coherent scheme is provided...

diffstat for 5 patches:
35 files changed, 338 insertions(+), 825 deletions(-)

- add int 'modes_map' and flag 'no_atapi_autodma' to
struct ata_channel, initialise them in *_init_channel()
functions

- add XFER_UDMA_ALL and XFER_UDMA_80W defines to ata-timing.h

- convert *_ratemask() functions to *_modes_map(),
mark them with __init
affected drivers: alim15x3.c, cmd64x.c, hpt366.c,
pdc202xx.c, serverworks.c, sis5513.c

- split aec62xx_udma_setup() to aec62xx_udma_setup()
and aec62xx_modes_map()

- move eighty_ninty_three(drive) check from *_ratemask()
to driver specific config_chipset_for_dma()

--
Bartlomiej Zolnierkiewicz

---559023410-1804928587-1025032434=:27820 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ata-hosts-7.diff" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.SOL.4.30.0206252113540.27820@mion.elka.pw.edu.pl> Content-Description: Content-Disposition: attachment; filename="ata-hosts-7.diff"

ZGlmZiAtdXIgbGludXgtMi41LjI0L2luY2x1ZGUvbGludXgvaWRlLmggbGlu dXgvaW5jbHVkZS9saW51eC9pZGUuaA0KLS0tIGxpbnV4LTIuNS4yNC9pbmNs dWRlL2xpbnV4L2lkZS5oCU1vbiBKdW4gMjQgMjI6MjE6MDMgMjAwMg0KKysr IGxpbnV4L2luY2x1ZGUvbGludXgvaWRlLmgJTW9uIEp1biAyNCAyMjoyND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QogCWlmIChtb2RlIDwgWEZFUl9TV19ETUFfMCkNCkBAIC01ODcsNiAr NTgxLDcgQEANCiAJCWlmIChjaGlwc2V0X2ZhbWlseSA+IEFUQV8xNikgew0K IAkJCWh3aWYtPmF1dG9kbWEgPSBub2F1dG9kbWEgPyAwIDogMTsNCiAJCQlo d2lmLT5oaWdobWVtID0gMTsNCisJCQlod2lmLT5tb2Rlc19tYXAgPSBzaXM1 NTEzX21vZGVzX21hcChod2lmKTsNCiAJCQlod2lmLT51ZG1hX3NldHVwID0g c2lzNTUxM191ZG1hX3NldHVwOw0KIAkJfSBlbHNlIHsNCiAjZW5kaWYNCg== ---559023410-1804928587-1025032434=:27820-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/