Skip to content

Commit df89f1b

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: cs5536: define dma_sff_read_status() method ide: fix barriers support ide: Remove void casts hpt366: use ATA_DMA_* constants hpt366: fix HPT370 DMA timeouts
2 parents 62f2730 + 15da90b commit df89f1b

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

drivers/ide/cs5536.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ static const struct ide_dma_ops cs5536_dma_ops = {
236236
.dma_test_irq = ide_dma_test_irq,
237237
.dma_lost_irq = ide_dma_lost_irq,
238238
.dma_timer_expiry = ide_dma_sff_timer_expiry,
239+
.dma_sff_read_status = ide_dma_sff_read_status,
239240
};
240241

241242
static const struct ide_port_info cs5536_info = {

drivers/ide/hpt366.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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
@@ -114,6 +114,8 @@
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
117119
* Sergei Shtylyov, <[email protected]> or <[email protected]>
118120
*/
119121

@@ -133,7 +135,7 @@
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

139141
static 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;

drivers/ide/ide-io.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
102102
drive->dev_flags |= IDE_DFLAG_PARKED;
103103
}
104104

105-
if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
106-
memcpy(rq->special, cmd, sizeof(*cmd));
105+
if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
106+
struct ide_cmd *orig_cmd = rq->special;
107107

108-
if (cmd->tf_flags & IDE_TFLAG_DYN)
109-
kfree(cmd);
108+
if (cmd->tf_flags & IDE_TFLAG_DYN)
109+
kfree(orig_cmd);
110+
else
111+
memcpy(orig_cmd, cmd, sizeof(*cmd));
112+
}
110113
}
111114

112115
/* obsolete, blk_rq_bytes() should be used instead */

drivers/ide/pmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif,
16821682
* The +2 is +1 for the stop command and +1 to allow for
16831683
* aligning the start address to a multiple of 16 bytes.
16841684
*/
1685-
pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent(
1685+
pmif->dma_table_cpu = pci_alloc_consistent(
16861686
dev,
16871687
(MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
16881688
&hwif->dmatable_dma);

0 commit comments

Comments
 (0)