patch-2.3.99-pre9 linux/drivers/ide/alim15x3.c

Next file: linux/drivers/ide/amd7409.c
Previous file: linux/drivers/ide/aec62xx.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre8/linux/drivers/ide/alim15x3.c linux/drivers/ide/alim15x3.c
@@ -333,6 +333,7 @@
 
 	err = ide_config_drive_speed(drive, speed);
 
+#ifdef CONFIG_BLK_DEV_IDEDMA
 	if (speed >= XFER_SW_DMA_0) {
 		unsigned long dma_base = hwif->dma_base;
 
@@ -353,6 +354,9 @@
 			pci_write_config_byte(dev, 0x4b, tmpbyte);
 		}
 	}
+#endif /* CONFIG_BLK_DEV_IDEDMA */
+
+	drive->current_speed = speed;
 
 	return (err);
 }
@@ -399,6 +403,9 @@
 
 	(void) ali15x3_tune_chipset(drive, speed);
 
+	if (!drive->init_speed)
+		drive->init_speed = speed;
+
 	rval = (int)(	((id->dma_ultra >> 11) & 3) ? ide_dma_on :
 			((id->dma_ultra >> 8) & 7) ? ide_dma_on :
 			((id->dma_mword >> 8) & 7) ? ide_dma_on :
@@ -629,7 +636,7 @@
 	 * has 80-pin (from host view)
 	 */
 	pci_read_config_byte(dev, 0x4a, &tmpbyte);
-	ata66 = (!(tmpbyte & ata66mask)) ? 0 : 1;
+	ata66 = (!(tmpbyte & ata66mask)) ? 1 : 0;
 	__restore_flags(flags);
 
 	return(ata66);
@@ -673,6 +680,7 @@
 	hwif->tuneproc = &ali15x3_tune_drive;
 	hwif->drives[0].autotune = 1;
 	hwif->drives[1].autotune = 1;
+	hwif->speedproc = &ali15x3_tune_chipset;
 #ifndef CONFIG_BLK_DEV_IDEDMA
 	hwif->autodma = 0;
 	return;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)