Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105012
b: refs/heads/master
c: ba4b2e6
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 23, 2008
1 parent af3e148 commit 005d665
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 472b4bc1af50431e08130c786ef0612f5b641839
refs/heads/master: ba4b2e607e4e9eaa929935325dafd5c86d3b5262
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static void ide_tf_set_cmd(ide_drive_t *drive, ide_task_t *task, u8 dma)
write = (task->tf_flags & IDE_TFLAG_WRITE) ? 1 : 0;

if (dma)
index = drive->vdma ? 4 : 8;
index = 8;
else
index = drive->mult_count ? 0 : 4;

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,8 @@ static int ide_tune_dma(ide_drive_t *drive)
static int ide_dma_check(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
int vdma = (hwif->host_flags & IDE_HFLAG_VDMA)? 1 : 0;

if (!vdma && ide_tune_dma(drive))
if (ide_tune_dma(drive))
return 0;

/* TODO: always do PIO fallback */
Expand All @@ -767,7 +766,7 @@ static int ide_dma_check(ide_drive_t *drive)

ide_set_max_pio(drive);

return vdma ? 0 : -1;
return -1;
}

int ide_id_dma_bug(ide_drive_t *drive)
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)

skip:
#ifdef CONFIG_BLK_DEV_IDEDMA
if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) &&
drive->using_dma)
if (speed >= XFER_SW_DMA_0 && drive->using_dma)
hwif->dma_ops->dma_host_set(drive, 1);
else if (hwif->dma_ops) /* check if host supports DMA */
ide_dma_off_quietly(drive);
Expand Down
30 changes: 0 additions & 30 deletions trunk/drivers/ide/pci/cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio)
struct pci_dev *pdev = to_pci_dev(hwif->dev);
int controller = drive->dn > 1 ? 1 : 0;

/* FIXME: if DMA = 1 do we need to set the DMA bit here ? */

/* 8bit CAT/CRT - 8bit command timing for channel */
pci_write_config_byte(pdev, 0x62 + controller,
(cs5520_pio_clocks[pio].recovery << 4) |
Expand All @@ -89,45 +87,17 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed)
cs5520_set_pio_mode(drive, 0);
}

/*
* We wrap the DMA activate to set the vdma flag. This is needed
* so that the IDE DMA layer issues PIO not DMA commands over the
* DMA channel
*
* ATAPI is harder so disable it for now using IDE_HFLAG_NO_ATAPI_DMA
*/

static void cs5520_dma_host_set(ide_drive_t *drive, int on)
{
drive->vdma = on;
ide_dma_host_set(drive, on);
}

static const struct ide_port_ops cs5520_port_ops = {
.set_pio_mode = cs5520_set_pio_mode,
.set_dma_mode = cs5520_set_dma_mode,
};

static const struct ide_dma_ops cs5520_dma_ops = {
.dma_host_set = cs5520_dma_host_set,
.dma_setup = ide_dma_setup,
.dma_exec_cmd = ide_dma_exec_cmd,
.dma_start = ide_dma_start,
.dma_end = __ide_dma_end,
.dma_test_irq = ide_dma_test_irq,
.dma_lost_irq = ide_dma_lost_irq,
.dma_timeout = ide_dma_timeout,
};

/* FIXME: VDMA is disabled because it caused system hangs */
#define DECLARE_CS_DEV(name_str) \
{ \
.name = name_str, \
.port_ops = &cs5520_port_ops, \
.dma_ops = &cs5520_dma_ops, \
.host_flags = IDE_HFLAG_ISA_PORTS | \
IDE_HFLAG_CS5520 | \
IDE_HFLAG_NO_ATAPI_DMA | \
IDE_HFLAG_ABUSE_SET_DMA_MODE, \
.pio_mask = ATA_PIO4, \
}
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ typedef struct ide_drive_s {
unsigned nodma : 1; /* disallow DMA */
unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */
unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */
unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */
unsigned sleeping : 1; /* 1=sleeping & sleep field valid */
unsigned post_reset : 1;
Expand Down Expand Up @@ -1097,8 +1096,6 @@ enum {
IDE_HFLAG_NO_IO_32BIT = (1 << 30),
/* never unmask IRQs */
IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31),
/* host uses VDMA (disabled for now) */
IDE_HFLAG_VDMA = 0,
};

#ifdef CONFIG_BLK_DEV_OFFBOARD
Expand Down

0 comments on commit 005d665

Please sign in to comment.