33 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
44 * Portions Copyright (C) 2003 Red Hat Inc
55 * Portions Copyright (C) 2007 Bartlomiej Zolnierkiewicz
6- * Portions Copyright (C) 2005-2008 MontaVista Software, Inc.
6+ * Portions Copyright (C) 2005-2009 MontaVista Software, Inc.
77 *
88 * Thanks to HighPoint Technologies for their assistance, and hardware.
99 * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his
114114 * the register setting lists into the table indexed by the clock selected
115115 * - set the correct hwif->ultra_mask for each individual chip
116116 * - add Ultra and MW DMA mode filtering for the HPT37[24] based SATA cards
117+ * - stop resetting HPT370's state machine before each DMA transfer as that has
118+ * caused more harm than good
117119118120 */
119121
133135#define DRV_NAME "hpt366"
134136
135137/* various tuning parameters */
136- #define HPT_RESET_STATE_ENGINE
138+ #undef HPT_RESET_STATE_ENGINE
137139#undef HPT_DELAY_INTERRUPT
138140
139141static const char * quirk_drives [] = {
@@ -808,7 +810,7 @@ static void hpt370_irq_timeout(ide_drive_t *drive)
808810 /* get DMA command mode */
809811 dma_cmd = inb (hwif -> dma_base + ATA_DMA_CMD );
810812 /* stop DMA */
811- outb (dma_cmd & ~0x1 , hwif -> dma_base + ATA_DMA_CMD );
813+ outb (dma_cmd & ~ATA_DMA_START , hwif -> dma_base + ATA_DMA_CMD );
812814 hpt370_clear_engine (drive );
813815}
814816
@@ -825,11 +827,11 @@ static int hpt370_dma_end(ide_drive_t *drive)
825827 ide_hwif_t * hwif = drive -> hwif ;
826828 u8 dma_stat = inb (hwif -> dma_base + ATA_DMA_STATUS );
827829
828- if (dma_stat & 0x01 ) {
830+ if (dma_stat & ATA_DMA_ACTIVE ) {
829831 /* wait a little */
830832 udelay (20 );
831833 dma_stat = inb (hwif -> dma_base + ATA_DMA_STATUS );
832- if (dma_stat & 0x01 )
834+ if (dma_stat & ATA_DMA_ACTIVE )
833835 hpt370_irq_timeout (drive );
834836 }
835837 return ide_dma_end (drive );
@@ -851,7 +853,7 @@ static int hpt374_dma_test_irq(ide_drive_t *drive)
851853
852854 dma_stat = inb (hwif -> dma_base + ATA_DMA_STATUS );
853855 /* return 1 if INTR asserted */
854- if (dma_stat & 4 )
856+ if (dma_stat & ATA_DMA_INTR )
855857 return 1 ;
856858
857859 return 0 ;
0 commit comments