diff options
-rw-r--r-- | drivers/ide/ide-disk.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 5 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 3 | ||||
-rw-r--r-- | drivers/ide/pci/cs5520.c | 30 | ||||
-rw-r--r-- | include/linux/ide.h | 3 |
5 files changed, 4 insertions, 39 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 3a2e80237c10..df5fe5756871 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -158,7 +158,7 @@ static void ide_tf_set_cmd(ide_drive_t *drive, ide_task_t *task, u8 dma) | |||
158 | write = (task->tf_flags & IDE_TFLAG_WRITE) ? 1 : 0; | 158 | write = (task->tf_flags & IDE_TFLAG_WRITE) ? 1 : 0; |
159 | 159 | ||
160 | if (dma) | 160 | if (dma) |
161 | index = drive->vdma ? 4 : 8; | 161 | index = 8; |
162 | else | 162 | else |
163 | index = drive->mult_count ? 0 : 4; | 163 | index = drive->mult_count ? 0 : 4; |
164 | 164 | ||
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index ecf60dbbe3e9..e72112efab9a 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -756,9 +756,8 @@ static int ide_tune_dma(ide_drive_t *drive) | |||
756 | static int ide_dma_check(ide_drive_t *drive) | 756 | static int ide_dma_check(ide_drive_t *drive) |
757 | { | 757 | { |
758 | ide_hwif_t *hwif = drive->hwif; | 758 | ide_hwif_t *hwif = drive->hwif; |
759 | int vdma = (hwif->host_flags & IDE_HFLAG_VDMA)? 1 : 0; | ||
760 | 759 | ||
761 | if (!vdma && ide_tune_dma(drive)) | 760 | if (ide_tune_dma(drive)) |
762 | return 0; | 761 | return 0; |
763 | 762 | ||
764 | /* TODO: always do PIO fallback */ | 763 | /* TODO: always do PIO fallback */ |
@@ -767,7 +766,7 @@ static int ide_dma_check(ide_drive_t *drive) | |||
767 | 766 | ||
768 | ide_set_max_pio(drive); | 767 | ide_set_max_pio(drive); |
769 | 768 | ||
770 | return vdma ? 0 : -1; | 769 | return -1; |
771 | } | 770 | } |
772 | 771 | ||
773 | int ide_id_dma_bug(ide_drive_t *drive) | 772 | int ide_id_dma_bug(ide_drive_t *drive) |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 6c54fe1f9841..c9d15be4c48d 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -866,8 +866,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed) | |||
866 | 866 | ||
867 | skip: | 867 | skip: |
868 | #ifdef CONFIG_BLK_DEV_IDEDMA | 868 | #ifdef CONFIG_BLK_DEV_IDEDMA |
869 | if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) && | 869 | if (speed >= XFER_SW_DMA_0 && drive->using_dma) |
870 | drive->using_dma) | ||
871 | hwif->dma_ops->dma_host_set(drive, 1); | 870 | hwif->dma_ops->dma_host_set(drive, 1); |
872 | else if (hwif->dma_ops) /* check if host supports DMA */ | 871 | else if (hwif->dma_ops) /* check if host supports DMA */ |
873 | ide_dma_off_quietly(drive); | 872 | ide_dma_off_quietly(drive); |
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index a13f2bc0665c..d30cb4d99c45 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c | |||
@@ -62,8 +62,6 @@ static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
62 | struct pci_dev *pdev = to_pci_dev(hwif->dev); | 62 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
63 | int controller = drive->dn > 1 ? 1 : 0; | 63 | int controller = drive->dn > 1 ? 1 : 0; |
64 | 64 | ||
65 | /* FIXME: if DMA = 1 do we need to set the DMA bit here ? */ | ||
66 | |||
67 | /* 8bit CAT/CRT - 8bit command timing for channel */ | 65 | /* 8bit CAT/CRT - 8bit command timing for channel */ |
68 | pci_write_config_byte(pdev, 0x62 + controller, | 66 | pci_write_config_byte(pdev, 0x62 + controller, |
69 | (cs5520_pio_clocks[pio].recovery << 4) | | 67 | (cs5520_pio_clocks[pio].recovery << 4) | |
@@ -89,45 +87,17 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
89 | cs5520_set_pio_mode(drive, 0); | 87 | cs5520_set_pio_mode(drive, 0); |
90 | } | 88 | } |
91 | 89 | ||
92 | /* | ||
93 | * We wrap the DMA activate to set the vdma flag. This is needed | ||
94 | * so that the IDE DMA layer issues PIO not DMA commands over the | ||
95 | * DMA channel | ||
96 | * | ||
97 | * ATAPI is harder so disable it for now using IDE_HFLAG_NO_ATAPI_DMA | ||
98 | */ | ||
99 | |||
100 | static void cs5520_dma_host_set(ide_drive_t *drive, int on) | ||
101 | { | ||
102 | drive->vdma = on; | ||
103 | ide_dma_host_set(drive, on); | ||
104 | } | ||
105 | |||
106 | static const struct ide_port_ops cs5520_port_ops = { | 90 | static const struct ide_port_ops cs5520_port_ops = { |
107 | .set_pio_mode = cs5520_set_pio_mode, | 91 | .set_pio_mode = cs5520_set_pio_mode, |
108 | .set_dma_mode = cs5520_set_dma_mode, | 92 | .set_dma_mode = cs5520_set_dma_mode, |
109 | }; | 93 | }; |
110 | 94 | ||
111 | static const struct ide_dma_ops cs5520_dma_ops = { | ||
112 | .dma_host_set = cs5520_dma_host_set, | ||
113 | .dma_setup = ide_dma_setup, | ||
114 | .dma_exec_cmd = ide_dma_exec_cmd, | ||
115 | .dma_start = ide_dma_start, | ||
116 | .dma_end = __ide_dma_end, | ||
117 | .dma_test_irq = ide_dma_test_irq, | ||
118 | .dma_lost_irq = ide_dma_lost_irq, | ||
119 | .dma_timeout = ide_dma_timeout, | ||
120 | }; | ||
121 | |||
122 | /* FIXME: VDMA is disabled because it caused system hangs */ | ||
123 | #define DECLARE_CS_DEV(name_str) \ | 95 | #define DECLARE_CS_DEV(name_str) \ |
124 | { \ | 96 | { \ |
125 | .name = name_str, \ | 97 | .name = name_str, \ |
126 | .port_ops = &cs5520_port_ops, \ | 98 | .port_ops = &cs5520_port_ops, \ |
127 | .dma_ops = &cs5520_dma_ops, \ | ||
128 | .host_flags = IDE_HFLAG_ISA_PORTS | \ | 99 | .host_flags = IDE_HFLAG_ISA_PORTS | \ |
129 | IDE_HFLAG_CS5520 | \ | 100 | IDE_HFLAG_CS5520 | \ |
130 | IDE_HFLAG_NO_ATAPI_DMA | \ | ||
131 | IDE_HFLAG_ABUSE_SET_DMA_MODE, \ | 101 | IDE_HFLAG_ABUSE_SET_DMA_MODE, \ |
132 | .pio_mask = ATA_PIO4, \ | 102 | .pio_mask = ATA_PIO4, \ |
133 | } | 103 | } |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 0544ff7d9afc..3f2889400250 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -355,7 +355,6 @@ typedef struct ide_drive_s { | |||
355 | unsigned nodma : 1; /* disallow DMA */ | 355 | unsigned nodma : 1; /* disallow DMA */ |
356 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | 356 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ |
357 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | 357 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ |
358 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ | ||
359 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | 358 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
360 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 359 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
361 | unsigned post_reset : 1; | 360 | unsigned post_reset : 1; |
@@ -1097,8 +1096,6 @@ enum { | |||
1097 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), | 1096 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), |
1098 | /* never unmask IRQs */ | 1097 | /* never unmask IRQs */ |
1099 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), | 1098 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), |
1100 | /* host uses VDMA (disabled for now) */ | ||
1101 | IDE_HFLAG_VDMA = 0, | ||
1102 | }; | 1099 | }; |
1103 | 1100 | ||
1104 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1101 | #ifdef CONFIG_BLK_DEV_OFFBOARD |