Skip to contentSkip to conversation

Fix ALi15x3 DMA on sparc64 (maybe others)

PATCH In review Ben Collins 2 participants 2 messages Jul 17, 2003 – Jul 18, 2003 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix ALi15x3 DMA on sparc64 (maybe others)

Attached is a patch that is known to fix atleast the DMA corruption occuring on sparc64 in 2.4.x kernels for ALi15x3 IDE chipsets. I think Alan hinted that someone also reported it fixed a similar problem on alpha.

I've been using this patch for some time now, with great results, and Debian unstable sparc64 users have unknowingly been testing the patch aswell. No reports of problems.

Please apply for 2.4.22. Original patch was from Ivan Kokshaysky.

drivers/ide/pci/alim15x3.c renamed from drivers/ide/pci/alim15x3.c.orig +6 -4
@@ -525,10 +525,14 @@ static int ali15x3_config_drive_for_dma(
 
 	drive->init_speed = 0;
 
+	/* Set reasonable PIO timings first - some of them are needed
+	   for DMA as well. */
+	hwif->tuneproc(drive, 255);
+
 	if ((id->capability & 1) != 0 && drive->autodma) {
 		/* Consult the list of known "bad" drives */
 		if (hwif->ide_dma_bad_drive(drive))
-			goto ata_pio;
+			goto no_dma_set;
 		if ((id->field_valid & 4) && (m5229_revision >= 0xC2)) {
 			if (id->dma_ultra & hwif->ultra_mask) {
 				/* Force if Capable UltraDMA */
@@ -550,11 +554,9 @@ try_dma_modes:
 			if (!config_chipset_for_dma(drive))
 				goto no_dma_set;
 		} else {
-			goto ata_pio;
+			goto no_dma_set;
 		}
 	} else {
-ata_pio:
-		hwif->tuneproc(drive, 255);
 no_dma_set:
 		return hwif->ide_dma_off_quietly(drive);
 	}
Signature · 3 lines
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
#1 lore raw
Quoted 4 lines · On Thu, 17 Jul 2003 14:14:10 -0400 Ben Collins <[email protected]> wrote:

Attached is a patch that is known to fix atleast the DMA corruption occuring on sparc64 in 2.4.x kernels for ALi15x3 IDE chipsets. I think Alan hinted that someone also reported it fixed a similar problem on alpha.

Marcelo, please apply this. Not only does it indeed fix problems on Sparc64 and Alpha, it also is ACK'd by Alan and already present in 2.5.x

Thanks.